List<TaskData> (@NotNull AnActionEvent e) { final List<ExternalSystemNode> selectedNodes = e.getData(ExternalSystemDataKeys.SELECTED_NODES); if (selectedNodes == null) return Collections.emptyList(); List<TaskData> tasks = new SmartList<>(); for (ExternalSystemNode node : selectedNodes) { if (node instanceof TaskNode && !node.isIgnored()) { tasks.add((TaskData)node.getData()); } else if (node instanceof RunConfigurationNode) { final RunnerAndConfigurationSettings configurationSettings = ((RunConfigurationNode)node).getSettings(); final ExternalSystemRunConfiguration runConfiguration = (ExternalSystemRunConfiguration)configurationSettings.getConfiguration(); final ExternalSystemTaskExecutionSettings taskExecutionSettings = runConfiguration.getSettings(); tasks.add(new TaskData(taskExecutionSettings.getExternalSystemId(), RUN_CONFIGURATION_TASK_PREFIX + configurationSettings.getName(), taskExecutionSettings.getExternalProjectPath(), null)); } else { return Collections.emptyList(); } } return tasks; }