boolean (@NotNull AnActionEvent e, boolean execute) { Project project = e.getProject(); if (project == null) { return false; } RunContentDescriptor contentDescriptor = RunContentManager.getInstance(project).getSelectedContent(); if (contentDescriptor == null) { return false; } JComponent component = contentDescriptor.getComponent(); if (component == null) { return false; } AnAction[] actions = contentDescriptor.getRestartActions(); for (AnAction action : actions) { if (action instanceof AbstractRerunFailedTestsAction) { if (execute) { ExecutionEnvironment environment = ExecutionDataKeys.EXECUTION_ENVIRONMENT.getData(DataManager.getInstance().getDataContext(component)); if (environment == null) { return false; } ((AbstractRerunFailedTestsAction)action).execute(e, environment); return true; } else { return ((AbstractRerunFailedTestsAction)action).isActive(e); } } } return false; }