void (@NotNull AnActionEvent e) { Project project = e.getData(CommonDataKeys.PROJECT); boolean enabled = isEnabled(project); Presentation presentation = e.getPresentation(); presentation.setEnabledAndVisible(enabled); }