Search in sources :

Example 21 with ToolWindow

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

the class LafManagerImpl method updateToolWindows.

public static void updateToolWindows() {
    for (Project project : ProjectManager.getInstance().getOpenProjects()) {
        final ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
        for (String id : toolWindowManager.getToolWindowIds()) {
            final ToolWindow toolWindow = toolWindowManager.getToolWindow(id);
            for (Content content : toolWindow.getContentManager().getContents()) {
                final JComponent component = content.getComponent();
                if (component != null) {
                    IJSwingUtilities.updateComponentTreeUI(component);
                }
            }
            final JComponent c = toolWindow.getComponent();
            if (c != null) {
                IJSwingUtilities.updateComponentTreeUI(c);
            }
        }
    }
}
Also used : Project(com.intellij.openapi.project.Project) ToolWindow(com.intellij.openapi.wm.ToolWindow) Content(com.intellij.ui.content.Content) ToolWindowManager(com.intellij.openapi.wm.ToolWindowManager)

Example 22 with ToolWindow

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

the class WindowSystemPlaybackCall method waitForToolWindow.

public static AsyncResult<String> waitForToolWindow(final PlaybackContext context, final String id) {
    final AsyncResult<String> result = new AsyncResult<>();
    findProject().doWhenDone(new Consumer<Project>() {

        @Override
        public void consume(Project project) {
            ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(id);
            if (toolWindow == null) {
                result.setRejected("Cannot find tool window with id: " + id);
                return;
            }
            toolWindow.getReady(context).doWhenDone(result.createSetDoneRunnable()).doWhenRejected(() -> result.setRejected("Cannot activate tool window with id:" + id));
        }
    }).doWhenRejected(() -> result.setRejected("Cannot retrieve open project"));
    return result;
}
Also used : Project(com.intellij.openapi.project.Project) ToolWindow(com.intellij.openapi.wm.ToolWindow) Consumer(com.intellij.util.Consumer) AsyncResult(com.intellij.openapi.util.AsyncResult)

Example 23 with ToolWindow

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

the class ServersToolWindowManager method updateWindowAvailable.

private void updateWindowAvailable(final boolean showIfAvailable) {
    final ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(myProject);
    toolWindowManager.invokeLater(() -> {
        boolean available = getFactory().getContribution().canContribute(myProject);
        final ToolWindow toolWindow = toolWindowManager.getToolWindow(myWindowId);
        if (toolWindow == null) {
            if (available) {
                createToolWindow(myProject, toolWindowManager).show(null);
            }
            return;
        }
        boolean doShow = !toolWindow.isAvailable() && available;
        if (toolWindow.isAvailable() && !available) {
            toolWindow.hide(null);
        }
        toolWindow.setAvailable(available, null);
        if (showIfAvailable && doShow) {
            toolWindow.show(null);
        }
    });
}
Also used : ToolWindow(com.intellij.openapi.wm.ToolWindow) ToolWindowManager(com.intellij.openapi.wm.ToolWindowManager)

Example 24 with ToolWindow

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

the class ServersToolWindowManager method createToolWindow.

private ToolWindow createToolWindow(Project project, ToolWindowManager toolWindowManager) {
    ToolWindow toolWindow = toolWindowManager.registerToolWindow(myWindowId, false, ToolWindowAnchor.BOTTOM);
    toolWindow.setIcon(myIcon);
    getFactory().createToolWindowContent(project, toolWindow);
    return toolWindow;
}
Also used : ToolWindow(com.intellij.openapi.wm.ToolWindow)

Example 25 with ToolWindow

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

the class UsageViewManagerImpl method showToolWindow.

void showToolWindow(boolean activateWindow) {
    ToolWindow toolWindow = ToolWindowManager.getInstance(myProject).getToolWindow(ToolWindowId.FIND);
    toolWindow.show(null);
    if (activateWindow && !toolWindow.isActive()) {
        toolWindow.activate(null);
    }
}
Also used : ToolWindow(com.intellij.openapi.wm.ToolWindow)

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