void (@NotNull AnActionEvent e) { Project[] projects = ProjectManager.getInstance().getOpenProjects(); for (Project project : projects) { boolean enabled = project != null && !project.isDisposed() && !ExecutionManagerImpl.getInstance(project).getRunningDescriptors(Conditions.alwaysTrue()).isEmpty(); e.getPresentation().setEnabled(enabled); if (enabled) break; } }