public void changedUpdate(DocumentEvent e) {
doEnablement();
}
private void doEnablement() {
Validable classNameValidator = new NetteClassNameValidator();
Validable componentNameValidator = new NetteComponentNameValidator();
if (isFormTabSelected()) {
if (!classNameValidator.validate(getFormClass())) {
errorLabel.setIcon(errorIcon);
setWarningText(NbBundle.getMessage(CreateComponentGeneratorPanel.class, "ERR_head_form_class"));
dd.setValid(false);
} else if (!componentNameValidator.validate(getFormName())) {
errorLabel.setIcon(errorIcon);
setWarningText(NbBundle.getMessage(CreateComponentGeneratorPanel.class, "ERR_head_form_name"));
dd.setValid(false);
} else {
errorLabel.setIcon(null);
errorLabel.setText("");
dd.setValid(true);
}
} else {
if (!classNameValidator.validate(getComponentClass())) {
errorLabel.setIcon(errorIcon);
setWarningText(NbBundle.getMessage(CreateComponentGeneratorPanel.class, "ERR_head_component_class"));
dd.setValid(false);
} else if (!componentNameValidator.validate(getComponentName())) {