void () { mainClass = new LabeledComponent<>(); mainClass.setComponent(new EditorTextFieldWithBrowseButton(project, true, (declaration, place) -> { if (declaration instanceof KtLightClass aClass) { if (ConfigurationUtil.MAIN_CLASS.value(aClass) && (PsiMethodUtil.findMainMethod(aClass) != null || place.getParent() != null) && moduleSelector.findClass(((PsiClass)declaration).getQualifiedName()) != null) { return JavaCodeFragment.VisibilityChecker.Visibility.VISIBLE; } } return JavaCodeFragment.VisibilityChecker.Visibility.NOT_VISIBLE; })); }