use of com.intellij.openapi.wm.ex.ToolWindowManagerEx in project intellij-community by JetBrains.
the class JumpToLastWindowAction method update.
public void update(AnActionEvent event) {
Presentation presentation = event.getPresentation();
Project project = event.getProject();
if (project == null) {
presentation.setEnabled(false);
return;
}
ToolWindowManagerEx manager = (ToolWindowManagerEx) ToolWindowManager.getInstance(project);
String id = manager.getLastActiveToolWindowId();
presentation.setEnabled(id != null && manager.getToolWindow(id).isAvailable());
}
use of com.intellij.openapi.wm.ex.ToolWindowManagerEx in project intellij-community by JetBrains.
the class JumpToLastWindowAction method actionPerformed.
public void actionPerformed(AnActionEvent e) {
Project project = e.getProject();
if (project == null) {
return;
}
ToolWindowManagerEx manager = ToolWindowManagerEx.getInstanceEx(project);
String id = manager.getLastActiveToolWindowId();
if (id == null || !manager.getToolWindow(id).isAvailable()) {
return;
}
manager.getToolWindow(id).activate(null);
}
use of com.intellij.openapi.wm.ex.ToolWindowManagerEx in project intellij-community by JetBrains.
the class OccurenceNavigatorActionBase method getOccurenceNavigatorFromContext.
@Nullable
private static Component getOccurenceNavigatorFromContext(DataContext dataContext) {
Window window = WindowManagerEx.getInstanceEx().getMostRecentFocusedWindow();
if (window != null) {
Component component = window.getFocusOwner();
for (Component c = component; c != null; c = c.getParent()) {
if (c instanceof OccurenceNavigator) {
return c;
}
}
}
Project project = CommonDataKeys.PROJECT.getData(dataContext);
if (project == null) {
return null;
}
ToolWindowManagerEx mgr = ToolWindowManagerEx.getInstanceEx(project);
String id = mgr.getLastActiveToolWindowId(component -> findNavigator(component) != null);
if (id == null) {
return null;
}
return (Component) findNavigator(mgr.getToolWindow(id).getComponent());
}
use of com.intellij.openapi.wm.ex.ToolWindowManagerEx in project intellij-community by JetBrains.
the class PlatformProjectViewOpener method configureProject.
@Override
public void configureProject(final Project project, @NotNull final VirtualFile baseDir, Ref<Module> moduleRef) {
ToolWindowManagerEx manager = (ToolWindowManagerEx) ToolWindowManager.getInstance(project);
ToolWindow toolWindow = manager.getToolWindow(ToolWindowId.PROJECT_VIEW);
if (toolWindow == null) {
manager.addToolWindowManagerListener(new MyListener(manager, project));
} else {
StartupManager.getInstance(project).runWhenProjectIsInitialized(new DumbAwareRunnable() {
@Override
public void run() {
activateProjectToolWindow(project, toolWindow);
}
});
}
}
use of com.intellij.openapi.wm.ex.ToolWindowManagerEx in project intellij-community by JetBrains.
the class ProjectViewTestUtil method setupImpl.
public static void setupImpl(@NotNull Project project, boolean loadPaneExtensions) {
ToolWindowManagerEx toolWindowManager = ToolWindowManagerEx.getInstanceEx(project);
ToolWindow toolWindow = toolWindowManager.getToolWindow(ToolWindowId.PROJECT_VIEW);
if (toolWindow == null) {
ToolWindowEP[] beans = Extensions.getExtensions(ToolWindowEP.EP_NAME);
for (final ToolWindowEP bean : beans) {
if (bean.id.equals(ToolWindowId.PROJECT_VIEW)) {
toolWindow = toolWindowManager.registerToolWindow(bean.id, new JLabel(), ToolWindowAnchor.fromText(bean.anchor), project, false, bean.canCloseContents);
break;
}
}
}
((ProjectViewImpl) ProjectView.getInstance(project)).setupImpl(toolWindow, loadPaneExtensions);
}
Aggregations