void (@NotNull AnActionEvent e) { DataContext ctx = e.getDataContext(); IdeView view = LangDataKeys.IDE_VIEW.getData(ctx); PsiDirectory target = view != null && e.getProject() != null ? getTargetDirectory(ctx, view) : null; if (target == null || !PsiUtil.isLanguageLevel9OrHigher(target)) { e.getPresentation().setEnabledAndVisible(false); } else { e.getPresentation().setVisible(true); e.getPresentation().setEnabled(JavaModuleGraphUtil.findDescriptorByElement(target) == null); } }