Search in sources :

Example 71 with ToolWindow

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

the class ToggleDockModeAction method update.

public void update(AnActionEvent event) {
    super.update(event);
    Presentation presentation = event.getPresentation();
    Project project = event.getProject();
    if (project == null) {
        presentation.setEnabled(false);
        return;
    }
    ToolWindowManager mgr = ToolWindowManager.getInstance(project);
    String id = mgr.getActiveToolWindowId();
    if (id == null) {
        presentation.setEnabled(false);
        return;
    }
    ToolWindow toolWindow = mgr.getToolWindow(id);
    presentation.setEnabled(toolWindow.isAvailable() && toolWindow.getType() != ToolWindowType.FLOATING && toolWindow.getType() != ToolWindowType.WINDOWED);
}
Also used : Project(com.intellij.openapi.project.Project) ToolWindow(com.intellij.openapi.wm.ToolWindow) ToolWindowManager(com.intellij.openapi.wm.ToolWindowManager) Presentation(com.intellij.openapi.actionSystem.Presentation)

Example 72 with ToolWindow

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

the class SwitcherToolWindowsListRenderer method customizeCellRenderer.

protected void customizeCellRenderer(@NotNull JList list, Object value, int index, boolean selected, boolean hasFocus) {
    hide = false;
    setPaintFocusBorder(false);
    if (value instanceof ToolWindow) {
        final ToolWindow tw = (ToolWindow) value;
        setIcon(getIcon(tw));
        final String name;
        String stripeTitle = tw.getStripeTitle();
        String shortcut = shortcuts.get(tw);
        if (myPinned || shortcut == null) {
            name = stripeTitle;
        } else {
            append(shortcut, new SimpleTextAttributes(SimpleTextAttributes.STYLE_UNDERLINE, null));
            name = ": " + stripeTitle;
        }
        append(name);
        if (mySpeedSearch != null && mySpeedSearch.isPopupActive()) {
            hide = mySpeedSearch.matchingFragments(stripeTitle) == null && !StringUtil.isEmpty(mySpeedSearch.getEnteredPrefix());
        }
    }
}
Also used : ToolWindow(com.intellij.openapi.wm.ToolWindow) SimpleTextAttributes(com.intellij.ui.SimpleTextAttributes)

Example 73 with ToolWindow

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

the class ToolWindowsPane method setMaximized.

void setMaximized(@NotNull ToolWindow wnd, boolean maximized) {
    Pair<Resizer, Component> resizerAndComponent = findResizerAndComponent(wnd);
    if (resizerAndComponent == null)
        return;
    if (!maximized) {
        ToolWindow maximizedWindow = myMaximizedProportion.first;
        assert maximizedWindow == wnd;
        resizerAndComponent.first.setSize(myMaximizedProportion.second);
        myMaximizedProportion = null;
    } else {
        int size = wnd.getAnchor().isHorizontal() ? resizerAndComponent.second.getHeight() : resizerAndComponent.second.getWidth();
        stretch(wnd, Short.MAX_VALUE);
        myMaximizedProportion = Pair.create(wnd, size);
    }
    doLayout();
}
Also used : ToolWindow(com.intellij.openapi.wm.ToolWindow)

Example 74 with ToolWindow

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

the class XDebugSessionTab method toFront.

public void toFront(boolean focus, @Nullable final Runnable onShowCallback) {
    if (ApplicationManager.getApplication().isUnitTestMode())
        return;
    ApplicationManager.getApplication().invokeLater(() -> {
        if (myRunContentDescriptor != null) {
            RunContentManager manager = ExecutionManager.getInstance(myProject).getContentManager();
            ToolWindow toolWindow = manager.getToolWindowByDescriptor(myRunContentDescriptor);
            if (toolWindow != null) {
                if (!toolWindow.isVisible()) {
                    toolWindow.show(() -> {
                        if (onShowCallback != null) {
                            onShowCallback.run();
                        }
                        myRebuildWatchesRunnable.run();
                    });
                }
                manager.selectRunContent(myRunContentDescriptor);
            }
        }
    });
    if (focus) {
        ApplicationManager.getApplication().invokeLater(() -> {
            boolean focusWnd = Registry.is("debugger.mayBringFrameToFrontOnBreakpoint");
            ProjectUtil.focusProjectWindow(myProject, focusWnd);
            if (!focusWnd) {
                AppIcon.getInstance().requestAttention(myProject, true);
            }
        });
    }
}
Also used : ToolWindow(com.intellij.openapi.wm.ToolWindow) RunContentManager(com.intellij.execution.ui.RunContentManager)

Example 75 with ToolWindow

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

the class DebuggerSessionTabBase method select.

public void select() {
    if (ApplicationManager.getApplication().isUnitTestMode())
        return;
    UIUtil.invokeLaterIfNeeded(() -> {
        if (myRunContentDescriptor != null) {
            RunContentManager manager = ExecutionManager.getInstance(myProject).getContentManager();
            ToolWindow toolWindow = manager.getToolWindowByDescriptor(myRunContentDescriptor);
            Content content = myRunContentDescriptor.getAttachedContent();
            if (toolWindow == null || content == null)
                return;
            manager.selectRunContent(myRunContentDescriptor);
        }
    });
}
Also used : ToolWindow(com.intellij.openapi.wm.ToolWindow) Content(com.intellij.ui.content.Content) RunContentManager(com.intellij.execution.ui.RunContentManager)

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