use of com.intellij.ide.projectView.impl.AbstractProjectViewPane in project intellij-community by JetBrains.
the class MoveModulesToGroupAction method doMove.
public static void doMove(final Module[] modules, final ModuleGroup group, @Nullable final DataContext dataContext) {
Project project = modules[0].getProject();
for (final Module module : modules) {
ModifiableModuleModel model = dataContext != null ? LangDataKeys.MODIFIABLE_MODULE_MODEL.getData(dataContext) : null;
if (model != null) {
model.setModuleGroupPath(module, group == null ? null : group.getGroupPath());
} else {
ModuleManagerImpl.getInstanceImpl(project).setModuleGroupPath(module, group == null ? null : group.getGroupPath());
}
}
AbstractProjectViewPane pane = ProjectView.getInstance(project).getCurrentProjectViewPane();
if (pane != null) {
pane.updateFromRoot(true);
}
if (!ProjectSettingsService.getInstance(project).processModulesMoved(modules, group) && pane != null) {
if (group != null) {
pane.selectModuleGroup(group, true);
} else {
pane.selectModule(modules[0], true);
}
}
}
use of com.intellij.ide.projectView.impl.AbstractProjectViewPane in project intellij-community by JetBrains.
the class ProjectViewSelectInTarget method select.
@NotNull
public static ActionCallback select(@NotNull Project project, final Object toSelect, @Nullable final String viewId, @Nullable final String subviewId, final VirtualFile virtualFile, final boolean requestFocus) {
final ActionCallback result = new ActionCallback();
final ProjectView projectView = ProjectView.getInstance(project);
if (ApplicationManager.getApplication().isUnitTestMode()) {
AbstractProjectViewPane pane = projectView.getProjectViewPaneById(ProjectViewPane.ID);
pane.select(toSelect, virtualFile, requestFocus);
return result;
}
ToolWindowManager windowManager = ToolWindowManager.getInstance(project);
final ToolWindow projectViewToolWindow = windowManager.getToolWindow(ToolWindowId.PROJECT_VIEW);
final Runnable runnable = () -> {
Runnable r = () -> projectView.selectCB(toSelect, virtualFile, requestFocus).notify(result);
projectView.changeViewCB(ObjectUtils.chooseNotNull(viewId, ProjectViewPane.ID), subviewId).doWhenProcessed(r);
};
if (requestFocus) {
projectViewToolWindow.activate(runnable, true);
} else {
projectViewToolWindow.show(runnable);
}
return result;
}
use of com.intellij.ide.projectView.impl.AbstractProjectViewPane in project intellij-community by JetBrains.
the class ProjectViewSelectInTarget method getSubTargets.
@Override
@NotNull
public Collection<SelectInTarget> getSubTargets(@NotNull SelectInContext context) {
List<SelectInTarget> result = new ArrayList<>();
AbstractProjectViewPane pane = ProjectView.getInstance(myProject).getProjectViewPaneById(getMinorViewId());
int index = 0;
for (String subId : pane.getSubIds()) {
result.add(new ProjectSubViewSelectInTarget(this, subId, index++));
}
return result;
}
use of com.intellij.ide.projectView.impl.AbstractProjectViewPane in project intellij-community by JetBrains.
the class PyCharmEduInitialConfigurator method patchProjectAreaExtensions.
private static void patchProjectAreaExtensions(@NotNull final Project project) {
Executor debugExecutor = DefaultDebugExecutor.getDebugExecutorInstance();
unregisterAction(debugExecutor.getId(), ExecutorRegistryImpl.RUNNERS_GROUP);
unregisterAction(debugExecutor.getContextActionId(), ExecutorRegistryImpl.RUN_CONTEXT_GROUP);
ExtensionsArea projectArea = Extensions.getArea(project);
for (SelectInTarget target : Extensions.getExtensions(SelectInTarget.EP_NAME, project)) {
if (ToolWindowId.FAVORITES_VIEW.equals(target.getToolWindowId()) || ToolWindowId.STRUCTURE_VIEW.equals(target.getToolWindowId())) {
projectArea.getExtensionPoint(SelectInTarget.EP_NAME).unregisterExtension(target);
}
}
for (AbstractProjectViewPane pane : Extensions.getExtensions(AbstractProjectViewPane.EP_NAME, project)) {
if (pane.getId().equals(ScopeViewPane.ID)) {
Disposer.dispose(pane);
projectArea.getExtensionPoint(AbstractProjectViewPane.EP_NAME).unregisterExtension(pane);
}
}
}
Aggregations