use of com.intellij.openapi.externalSystem.view.ExternalSystemNode in project intellij-community by JetBrains.
the class GradleViewContributor method addCustomSourceSetsNodes.
private static void addCustomSourceSetsNodes(@NotNull ExternalProjectsView externalProjectsView, @NotNull MultiMap<Key<?>, DataNode<?>> dataNodes, @NotNull List<ExternalSystemNode<?>> result) {
final Collection<DataNode<?>> sourceSetsDataNodes = dataNodes.get(GradleSourceSetData.KEY);
if (!sourceSetsDataNodes.isEmpty()) {
final ExternalSystemNode sourceSetsNode = new SourceSetsNode(externalProjectsView);
for (DataNode<?> dataNode : sourceSetsDataNodes) {
//noinspection unchecked
sourceSetsNode.add(new SourceSetNode(externalProjectsView, (DataNode<GradleSourceSetData>) dataNode));
}
result.add(sourceSetsNode);
}
}
use of com.intellij.openapi.externalSystem.view.ExternalSystemNode 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();
}
use of com.intellij.openapi.externalSystem.view.ExternalSystemNode 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.ExternalSystemNode in project intellij-community by JetBrains.
the class ExternalSystemSelectProjectDataToImportAction method actionPerformed.
@Override
public void actionPerformed(AnActionEvent e) {
final Project project = getProject(e);
final ProjectSystemId projectSystemId = getSystemId(e);
final List<ExternalSystemNode> selectedNodes = ExternalSystemDataKeys.SELECTED_NODES.getData(e.getDataContext());
final ExternalProjectInfo projectInfo;
final ExternalSystemNode<?> externalSystemNode = ContainerUtil.getFirstItem(selectedNodes);
if (externalSystemNode == null) {
projectInfo = ContainerUtil.getFirstItem(ProjectDataManager.getInstance().getExternalProjectsData(project, projectSystemId));
} else {
final ProjectNode projectNode = externalSystemNode instanceof ProjectNode ? (ProjectNode) externalSystemNode : externalSystemNode.findParent(ProjectNode.class);
assert projectNode != null;
final ProjectData projectData = projectNode.getData();
assert projectData != null;
projectInfo = ProjectDataManager.getInstance().getExternalProjectData(project, projectSystemId, projectData.getLinkedExternalProjectPath());
}
final ExternalProjectDataSelectorDialog dialog;
if (projectInfo != null) {
dialog = new ExternalProjectDataSelectorDialog(project, projectInfo, externalSystemNode != null ? externalSystemNode.getData() : null);
dialog.showAndGet();
}
}
use of com.intellij.openapi.externalSystem.view.ExternalSystemNode in project intellij-community by JetBrains.
the class OpenTasksActivationManagerAction method perform.
@Override
public void perform(@NotNull final Project project, @NotNull ProjectSystemId projectSystemId, @NotNull AbstractExternalEntityData externalEntityData, @NotNull AnActionEvent e) {
final List<ExternalSystemNode> selectedNodes = ExternalSystemDataKeys.SELECTED_NODES.getData(e.getDataContext());
final ExternalSystemNode<?> externalSystemNode = ContainerUtil.getFirstItem(selectedNodes);
assert externalSystemNode != null;
final ExternalConfigPathAware externalConfigPathAware = externalSystemNode.getData() instanceof ExternalConfigPathAware ? (ExternalConfigPathAware) externalSystemNode.getData() : null;
assert externalConfigPathAware != null;
new ConfigureTasksActivationDialog(project, projectSystemId, externalConfigPathAware.getLinkedExternalProjectPath()).showAndGet();
}
Aggregations