Search in sources :

Example 26 with ToolWindow

use of com.intellij.openapi.wm.ToolWindow in project intellij-community by JetBrains.

the class PsiPackageImplementationHelperImpl method navigate.

@Override
public void navigate(@NotNull final PsiPackage psiPackage, final boolean requestFocus) {
    final Project project = psiPackage.getProject();
    ToolWindow window = ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.PROJECT_VIEW);
    window.activate(null);
    window.getActivation().doWhenDone(() -> {
        final ProjectView projectView = ProjectView.getInstance(project);
        PsiDirectory[] directories = suggestMostAppropriateDirectories(psiPackage);
        if (directories.length == 0)
            return;
        projectView.select(directories[0], directories[0].getVirtualFile(), requestFocus);
    });
}
Also used : Project(com.intellij.openapi.project.Project) ToolWindow(com.intellij.openapi.wm.ToolWindow) ProjectView(com.intellij.ide.projectView.ProjectView)

Example 27 with ToolWindow

use of com.intellij.openapi.wm.ToolWindow in project intellij-community by JetBrains.

the class TestErrorViewAction method openView.

protected void openView(Project project, JComponent component) {
    final MessageView messageView = MessageView.SERVICE.getInstance(project);
    final Content content = ContentFactory.SERVICE.getInstance().createContent(component, getContentName(), true);
    messageView.getContentManager().addContent(content);
    messageView.getContentManager().setSelectedContent(content);
    ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.MESSAGES_WINDOW);
    if (toolWindow != null) {
        toolWindow.activate(null);
    }
}
Also used : ToolWindow(com.intellij.openapi.wm.ToolWindow) MessageView(com.intellij.ui.content.MessageView) Content(com.intellij.ui.content.Content)

Example 28 with ToolWindow

use of com.intellij.openapi.wm.ToolWindow in project intellij-community by JetBrains.

the class ToggleDockModeAction method setSelected.

public void setSelected(AnActionEvent event, boolean flag) {
    Project project = event.getProject();
    if (project == null) {
        return;
    }
    ToolWindowManager windowManager = ToolWindowManager.getInstance(project);
    String id = windowManager.getActiveToolWindowId();
    if (id == null) {
        return;
    }
    ToolWindow toolWindow = windowManager.getToolWindow(id);
    ToolWindowType type = toolWindow.getType();
    if (ToolWindowType.DOCKED == type) {
        toolWindow.setType(ToolWindowType.SLIDING, null);
    } else if (ToolWindowType.SLIDING == type) {
        toolWindow.setType(ToolWindowType.DOCKED, null);
    }
}
Also used : Project(com.intellij.openapi.project.Project) ToolWindow(com.intellij.openapi.wm.ToolWindow) ToolWindowManager(com.intellij.openapi.wm.ToolWindowManager) ToolWindowType(com.intellij.openapi.wm.ToolWindowType)

Example 29 with ToolWindow

use of com.intellij.openapi.wm.ToolWindow in project intellij-community by JetBrains.

the class TogglePresentationModeAction method hideAllToolWindows.

private static boolean hideAllToolWindows(ToolWindowManagerEx manager) {
    // to clear windows stack
    manager.clearSideStack();
    String[] ids = manager.getToolWindowIds();
    boolean hasVisible = false;
    for (String id : ids) {
        final ToolWindow toolWindow = manager.getToolWindow(id);
        if (toolWindow.isVisible()) {
            toolWindow.hide(null);
            hasVisible = true;
        }
    }
    return hasVisible;
}
Also used : ToolWindow(com.intellij.openapi.wm.ToolWindow)

Example 30 with ToolWindow

use of com.intellij.openapi.wm.ToolWindow in project intellij-community by JetBrains.

the class ToolWindowsPane method getStripeFor.

@Nullable
Stripe getStripeFor(String id) {
    ToolWindow window = myManager.getToolWindow(id);
    if (window == null) {
        return null;
    }
    final ToolWindowAnchor anchor = myManager.getToolWindow(id).getAnchor();
    if (ToolWindowAnchor.TOP == anchor) {
        return myTopStripe;
    }
    if (ToolWindowAnchor.BOTTOM == anchor) {
        return myBottomStripe;
    }
    if (ToolWindowAnchor.LEFT == anchor) {
        return myLeftStripe;
    }
    if (ToolWindowAnchor.RIGHT == anchor) {
        return myRightStripe;
    }
    throw new IllegalArgumentException("Anchor=" + anchor);
}
Also used : ToolWindow(com.intellij.openapi.wm.ToolWindow) ToolWindowAnchor(com.intellij.openapi.wm.ToolWindowAnchor) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

ToolWindow (com.intellij.openapi.wm.ToolWindow)124 Content (com.intellij.ui.content.Content)37 ToolWindowManager (com.intellij.openapi.wm.ToolWindowManager)34 Project (com.intellij.openapi.project.Project)21 ContentManager (com.intellij.ui.content.ContentManager)14 ToolWindowManagerEx (com.intellij.openapi.wm.ex.ToolWindowManagerEx)13 Nullable (org.jetbrains.annotations.Nullable)10 VirtualFile (com.intellij.openapi.vfs.VirtualFile)8 ConsoleView (com.intellij.execution.ui.ConsoleView)5 ToolWindowManagerAdapter (com.intellij.openapi.wm.ex.ToolWindowManagerAdapter)5 NotNull (org.jetbrains.annotations.NotNull)5 RunContentManager (com.intellij.execution.ui.RunContentManager)4 ProcessAdapter (com.intellij.execution.process.ProcessAdapter)3 ProcessEvent (com.intellij.execution.process.ProcessEvent)3 RunContentDescriptor (com.intellij.execution.ui.RunContentDescriptor)3 ProjectView (com.intellij.ide.projectView.ProjectView)3 Presentation (com.intellij.openapi.actionSystem.Presentation)3 DumbAwareRunnable (com.intellij.openapi.project.DumbAwareRunnable)3 ChangesViewContentManager (com.intellij.openapi.vcs.changes.ui.ChangesViewContentManager)3 ToolWindowEP (com.intellij.openapi.wm.ToolWindowEP)3