Java Code Examples for com.intellij.ide.projectView.ProjectView#getProjectViewPaneById()
The following examples show how to use
com.intellij.ide.projectView.ProjectView#getProjectViewPaneById() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NavBarPanel.java From consulo with Apache License 2.0 | 6 votes |
protected void doubleClick(final Object object) { if (object instanceof Navigatable) { Navigatable navigatable = (Navigatable)object; if (navigatable.canNavigate()) { navigatable.navigate(true); } } else if (object instanceof Module) { ProjectView projectView = ProjectView.getInstance(myProject); AbstractProjectViewPane projectViewPane = projectView.getProjectViewPaneById(projectView.getCurrentViewId()); if (projectViewPane != null) { projectViewPane.selectModule((Module)object, true); } } else if (object instanceof Project) { return; } hideHint(true); }
Example 2
Source File: ProjectViewSelectInTarget.java From consulo with Apache License 2.0 | 5 votes |
@Nonnull public static ActionCallback select(@Nonnull 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; }