Search in sources :

Example 41 with ToolWindow

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

the class ExternalToolWindowManager method getToolWindow.

@Nullable
private static ToolWindow getToolWindow(@NotNull Project project, @NotNull ProjectSystemId externalSystemId) {
    final ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
    if (toolWindowManager == null) {
        return null;
    }
    ToolWindow result = toolWindowManager.getToolWindow(externalSystemId.getReadableName());
    if (result instanceof ToolWindowImpl) {
        ((ToolWindowImpl) result).ensureContentInitialized();
    }
    return result;
}
Also used : ToolWindow(com.intellij.openapi.wm.ToolWindow) ToolWindowImpl(com.intellij.openapi.wm.impl.ToolWindowImpl) ToolWindowManager(com.intellij.openapi.wm.ToolWindowManager) Nullable(org.jetbrains.annotations.Nullable)

Example 42 with ToolWindow

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

the class RunDashboardManagerImpl method updateDashboard.

private void updateDashboard(final boolean withStructure) {
    final ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(myProject);
    toolWindowManager.invokeLater(() -> {
        if (myProject.isDisposed()) {
            return;
        }
        if (withStructure) {
            boolean available = hasContent();
            ToolWindow toolWindow = toolWindowManager.getToolWindow(getToolWindowId());
            if (toolWindow == null) {
                if (available) {
                    createToolWindow();
                }
                return;
            }
            boolean doShow = !toolWindow.isAvailable() && available;
            toolWindow.setAvailable(available, null);
            if (doShow) {
                toolWindow.show(null);
            }
        }
        if (myDashboardContent != null) {
            myDashboardContent.updateContent(withStructure);
        }
    });
}
Also used : ToolWindow(com.intellij.openapi.wm.ToolWindow) ToolWindowManager(com.intellij.openapi.wm.ToolWindowManager)

Example 43 with ToolWindow

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

the class ExecutionHelper method descriptorToFront.

private static void descriptorToFront(@NotNull final Project project, @NotNull final RunContentDescriptor descriptor) {
    ApplicationManager.getApplication().invokeLater(() -> {
        RunContentManager manager = ExecutionManager.getInstance(project).getContentManager();
        ToolWindow toolWindow = manager.getToolWindowByDescriptor(descriptor);
        if (toolWindow != null) {
            toolWindow.show(null);
            manager.selectRunContent(descriptor);
        }
    }, project.getDisposed());
}
Also used : ToolWindow(com.intellij.openapi.wm.ToolWindow) RunContentManager(com.intellij.execution.ui.RunContentManager)

Example 44 with ToolWindow

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

the class RunDashboardManagerImpl method createToolWindow.

private void createToolWindow() {
    ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(myProject);
    ToolWindow toolWindow = toolWindowManager.registerToolWindow(getToolWindowId(), false, ToolWindowAnchor.BOTTOM, myProject, true);
    toolWindow.setIcon(getToolWindowIcon());
    createToolWindowContent(toolWindow);
}
Also used : ToolWindow(com.intellij.openapi.wm.ToolWindow) ToolWindowManager(com.intellij.openapi.wm.ToolWindowManager)

Example 45 with ToolWindow

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

the class StructureViewWrapperImpl method isStructureViewShowing.

protected boolean isStructureViewShowing() {
    ToolWindowManager windowManager = ToolWindowManager.getInstance(myProject);
    ToolWindow toolWindow = windowManager.getToolWindow(ToolWindowId.STRUCTURE_VIEW);
    // it means that window is registered
    return toolWindow != null && toolWindow.isVisible();
}
Also used : ToolWindow(com.intellij.openapi.wm.ToolWindow) ToolWindowManager(com.intellij.openapi.wm.ToolWindowManager)

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