use of com.intellij.openapi.externalSystem.view.TaskNode in project intellij-community by JetBrains.
the class SelectExternalTaskDialog method doOKAction.
@Override
protected void doOKAction() {
SimpleNode node = getSelectedNode();
if (node instanceof NullNode)
node = null;
myResult = node instanceof TaskNode ? Pair.create(((TaskNode) node).getModuleOwnerName(), ((TaskNode) node).getData()) : null;
super.doOKAction();
}
use of com.intellij.openapi.externalSystem.view.TaskNode 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.TaskNode in project android by JetBrains.
the class GradleToolWindowFixture method fillTaskPath.
private static boolean fillTaskPath(@NotNull DefaultMutableTreeNode node, @NotNull String taskName, @NotNull List<DefaultMutableTreeNode> path) {
path.add(node);
Object userObject = node.getUserObject();
if (userObject instanceof TaskNode) {
TaskNode taskNode = (TaskNode) userObject;
if (taskName.equals(taskNode.getName())) {
return true;
}
}
for (int i = 0; i < node.getChildCount(); i++) {
boolean found = fillTaskPath((DefaultMutableTreeNode) node.getChildAt(i), taskName, path);
if (found) {
return true;
}
}
if (!path.isEmpty()) {
path.remove(path.size() - 1);
}
return false;
}
Aggregations