boolean (final AnActionEvent e) { Project project = e.getData(CommonDataKeys.PROJECT); if (project == null) return false; Editor editor = e.getData(CommonDataKeys.EDITOR); if (editor == null) return false; int offset = editor.getCaretModel().getOffset(); PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument()); if (file == null) return false; PsiElement element = file.findElementAt(offset); if (element == null) return false; PsiClass psiClass = PsiTreeUtil.getParentOfType(element, PsiClass.class); if (psiClass == null) return false; if (PsiMethodUtil.findMainMethod(psiClass) != null) return false; if (FormClassIndex.findFormsBoundToClass(project, psiClass).isEmpty()) return false; return true; }