void (@NotNull AnActionEvent e) { Project project = e.getProject(); Presentation presentation = e.getPresentation(); if (project == null) { presentation.setEnabledAndVisible(false); return; } JBIterable<RunDashboardRunConfigurationNode> targetNodes = getLeafTargets(e); boolean enabled = targetNodes.filter(node -> { Content content = node.getContent(); return content != null && !RunContentManagerImpl.isTerminated(content); }).isNotEmpty(); presentation.setEnabled(enabled); presentation.setVisible(enabled || !ActionPlaces.isPopupPlace(e.getPlace())); }