void (@NotNull AnActionEvent e) { Project project = e.getProject(); RunnerAndConfigurationSettings settings = e.getData(MavenDataKeys.RUN_CONFIGURATION); boolean enabled = settings != null && project != null; e.getPresentation().setEnabledAndVisible(enabled); }