use of com.intellij.openapi.externalSystem.view.RunConfigurationNode in project intellij-community by JetBrains.
the class RemoveExternalSystemRunConfigurationAction method actionPerformed.
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
Project project = getProject(e);
assert project != null;
final List<ExternalSystemNode> selectedNodes = ExternalSystemDataKeys.SELECTED_NODES.getData(e.getDataContext());
if (selectedNodes == null || selectedNodes.size() != 1 || !(selectedNodes.get(0) instanceof RunConfigurationNode))
return;
RunnerAndConfigurationSettings settings = ((RunConfigurationNode) selectedNodes.get(0)).getSettings();
assert settings != null;
int res = Messages.showYesNoDialog(project, "Delete \"" + settings.getName() + "\"?", "Confirmation", Messages.getQuestionIcon());
if (res == Messages.YES) {
((RunManagerEx) RunManager.getInstance(project)).removeConfiguration(settings);
}
}
use of com.intellij.openapi.externalSystem.view.RunConfigurationNode in project intellij-community by JetBrains.
the class ToggleTaskActivationAction method getTasks.
@NotNull
private static List<TaskData> getTasks(AnActionEvent e) {
final List<ExternalSystemNode> selectedNodes = ExternalSystemDataKeys.SELECTED_NODES.getData(e.getDataContext());
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;
}
use of com.intellij.openapi.externalSystem.view.RunConfigurationNode in project intellij-community by JetBrains.
the class ExternalSystemRunConfigurationMenu method update.
@Override
public void update(AnActionEvent e) {
for (AnAction action : getChildActionsOrStubs()) {
if (action instanceof ExecuteExternalSystemRunConfigurationAction) {
remove(action);
}
}
final Project project = e.getProject();
final List<ExternalSystemNode> selectedNodes = ExternalSystemDataKeys.SELECTED_NODES.getData(e.getDataContext());
if (selectedNodes == null || selectedNodes.size() != 1 || !(selectedNodes.get(0) instanceof RunConfigurationNode))
return;
final RunnerAndConfigurationSettings settings = ((RunConfigurationNode) selectedNodes.get(0)).getSettings();
if (settings == null || project == null)
return;
Executor[] executors = ExecutorRegistry.getInstance().getRegisteredExecutors();
for (int i = executors.length; --i >= 0; ) {
final ProgramRunner runner = RunnerRegistry.getInstance().getRunner(executors[i].getId(), settings.getConfiguration());
AnAction action = new ExecuteExternalSystemRunConfigurationAction(executors[i], runner != null, project, settings);
addAction(action, Constraints.FIRST);
}
super.update(e);
}
use of com.intellij.openapi.externalSystem.view.RunConfigurationNode in project intellij-community by JetBrains.
the class AssignRunConfigurationShortcutAction method actionPerformed.
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
Project project = getProject(e);
assert project != null;
final List<ExternalSystemNode> selectedNodes = ExternalSystemDataKeys.SELECTED_NODES.getData(e.getDataContext());
if (selectedNodes == null || selectedNodes.size() != 1 || !(selectedNodes.get(0) instanceof RunConfigurationNode))
return;
RunnerAndConfigurationSettings settings = ((RunConfigurationNode) selectedNodes.get(0)).getSettings();
assert settings != null;
ExternalSystemRunConfiguration runConfiguration = (ExternalSystemRunConfiguration) settings.getConfiguration();
String actionIdPrefix = getActionPrefix(project, runConfiguration.getSettings().getExternalProjectPath());
String actionId = actionIdPrefix + settings.getName();
AnAction action = ActionManager.getInstance().getAction(actionId);
if (action == null) {
ExternalSystemKeymapExtension.getOrRegisterAction(project, settings);
}
new EditKeymapsDialog(project, actionId).show();
}
use of com.intellij.openapi.externalSystem.view.RunConfigurationNode in project intellij-community by JetBrains.
the class EditExternalSystemRunConfigurationAction method actionPerformed.
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
Project project = getProject(e);
assert project != null;
final List<ExternalSystemNode> selectedNodes = ExternalSystemDataKeys.SELECTED_NODES.getData(e.getDataContext());
if (selectedNodes == null || selectedNodes.size() != 1 || !(selectedNodes.get(0) instanceof RunConfigurationNode))
return;
RunnerAndConfigurationSettings settings = ((RunConfigurationNode) selectedNodes.get(0)).getSettings();
assert settings != null;
RunManager.getInstance(project).setSelectedConfiguration(settings);
EditConfigurationsDialog dialog = new EditConfigurationsDialog(project);
dialog.show();
}
Aggregations