Search in sources :

Example 1 with WizardInputField

use of com.intellij.ide.util.projectWizard.WizardInputField in project intellij-community by JetBrains.

the class TemplateProjectDirectoryGenerator method validate.

@NotNull
@Override
public ValidationResult validate(@NotNull String baseDirPath) {
    String message = "Invalid settings";
    for (WizardInputField field : myTemplate.getInputFields()) {
        try {
            if (field.validate()) {
                continue;
            }
        } catch (ConfigurationException e) {
            message = e.getMessage();
        }
        return new ValidationResult(message);
    }
    ValidationResult result = myTemplate.validate(baseDirPath);
    if (result != null) {
        return result;
    }
    return ValidationResult.OK;
}
Also used : ConfigurationException(com.intellij.openapi.options.ConfigurationException) WizardInputField(com.intellij.ide.util.projectWizard.WizardInputField) ValidationResult(com.intellij.facet.ui.ValidationResult) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

ValidationResult (com.intellij.facet.ui.ValidationResult)1 WizardInputField (com.intellij.ide.util.projectWizard.WizardInputField)1 ConfigurationException (com.intellij.openapi.options.ConfigurationException)1 NotNull (org.jetbrains.annotations.NotNull)1