boolean () { myErrorLabel.setText(" "); if (myClassRadioButton.isSelected()) { if (myDocument == null) { // why? return false; } if (!PsiNameHelper.getInstance(myProject).isQualifiedName(myDocument.getText())) { if (myDocument.getTextLength() > 0) { myErrorLabel.setText(UIDesignerBundle.message("add.component.error.qualified.name.required")); } return false; } try (AccessToken ignore = SlowOperations.knownIssue("IDEA-307701, EA-766233")) { final JavaPsiFacade javaPsiFacade = JavaPsiFacade.getInstance(myProject); PsiClass psiClass = javaPsiFacade.findClass(myDocument.getText(), ProjectScope.getAllScope(myProject)); PsiClass componentClass = javaPsiFacade.findClass(JComponent.class.getName(), ProjectScope.getAllScope(myProject)); if (psiClass != null && componentClass != null && !InheritanceUtil.isInheritorOrSelf(psiClass, componentClass, true)) { myErrorLabel.setText(UIDesignerBundle.message("add.component.error.component.required")); return false; } } } else { if (myTfNestedForm.getText().length() == 0) { return false; } } if (myGroupComboBox.isVisible() && myGroupComboBox.getSelectedItem() == null) { return false; } return true; }