Search in sources :

Example 1 with ContentManager

use of com.intellij.ui.content.ContentManager in project intellij-community by JetBrains.

the class DesignerToolWindowManager method initToolWindow.

//////////////////////////////////////////////////////////////////////////////////////////
//
// Impl
//
//////////////////////////////////////////////////////////////////////////////////////////
@Override
protected void initToolWindow() {
    if (myToolWindowContent == null) {
        myToolWindowContent = new DesignerToolWindow(myProject, true);
    }
    myToolWindow = ToolWindowManager.getInstance(myProject).registerToolWindow(DesignerBundle.message("designer.toolwindow.name"), false, getAnchor(), myProject, true);
    myToolWindow.setIcon(UIDesignerNewIcons.ToolWindow);
    if (!ApplicationManager.getApplication().isHeadlessEnvironment()) {
        myToolWindow.getComponent().putClientProperty(ToolWindowContentUi.HIDE_ID_LABEL, "true");
    }
    ((ToolWindowEx) myToolWindow).setTitleActions(myToolWindowContent.createActions());
    initGearActions();
    ContentManager contentManager = myToolWindow.getContentManager();
    Content content = contentManager.getFactory().createContent(myToolWindowContent.getToolWindowPanel(), DesignerBundle.message("designer.toolwindow.title"), false);
    content.setCloseable(false);
    content.setPreferredFocusableComponent(myToolWindowContent.getComponentTree());
    contentManager.addContent(content);
    contentManager.setSelectedContent(content, true);
    myToolWindow.setAvailable(false, null);
}
Also used : ToolWindowEx(com.intellij.openapi.wm.ex.ToolWindowEx) Content(com.intellij.ui.content.Content) ContentManager(com.intellij.ui.content.ContentManager)

Example 2 with ContentManager

use of com.intellij.ui.content.ContentManager in project intellij-community by JetBrains.

the class SvnMergeSourceDetails method showMe.

public static void showMe(final Project project, final SvnFileRevision revision, final VirtualFile file) {
    if (ModalityState.NON_MODAL.equals(ModalityState.current())) {
        ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.VCS);
        final ContentManager contentManager = toolWindow.getContentManager();
        final MyDialog dialog = new MyDialog(project, revision, file);
        // TODO: Temporary memory leak fix - rewrite this part not to create dialog if only createCenterPanel(), but not show() is invoked
        Disposer.register(project, dialog.getDisposable());
        Content content = ContentFactory.SERVICE.getInstance().createContent(dialog.createCenterPanel(), SvnBundle.message("merge.source.details.title", (file == null) ? revision.getURL() : file.getName(), revision.getRevisionNumber().asString()), true);
        ContentsUtil.addOrReplaceContent(contentManager, content, true);
        toolWindow.activate(null);
    } else {
        new MyDialog(project, revision, file).show();
    }
}
Also used : ToolWindow(com.intellij.openapi.wm.ToolWindow) Content(com.intellij.ui.content.Content) ContentManager(com.intellij.ui.content.ContentManager)

Example 3 with ContentManager

use of com.intellij.ui.content.ContentManager in project intellij-community by JetBrains.

the class PyEduDebugRunner method initSession.

@Override
protected void initSession(XDebugSession session, RunProfileState state, Executor executor) {
    XDebugSessionTab tab = ((XDebugSessionImpl) session).getSessionTab();
    if (tab != null) {
        RunnerLayoutUi ui = tab.getUi();
        ContentManager contentManager = ui.getContentManager();
        Content content = findContent(contentManager, XDebuggerBundle.message("debugger.session.tab.console.content.name"));
        if (content != null) {
            ExecutionConsole console = session.getDebugProcess().createConsole();
            PythonDebugLanguageConsoleView view = (PythonDebugLanguageConsoleView) console;
            Presentation presentation = view.getSwitchConsoleActionPresentation();
            ToggleAction action = new ToggleAction(presentation.getText(), presentation.getDescription(), presentation.getIcon()) {

                @Override
                public boolean isSelected(AnActionEvent e) {
                    return !view.isPrimaryConsoleEnabled();
                }

                @Override
                public void setSelected(AnActionEvent e, boolean state) {
                    view.enableConsole(!state);
                }
            };
            content.setActions(new DefaultActionGroup(action), ActionPlaces.DEBUGGER_TOOLBAR, view.getPreferredFocusableComponent());
        }
        patchLeftToolbar(session, ui);
    }
}
Also used : RunnerLayoutUi(com.intellij.execution.ui.RunnerLayoutUi) XDebugSessionTab(com.intellij.xdebugger.impl.ui.XDebugSessionTab) PythonDebugLanguageConsoleView(com.jetbrains.python.console.PythonDebugLanguageConsoleView) Content(com.intellij.ui.content.Content) ContentManager(com.intellij.ui.content.ContentManager) ExecutionConsole(com.intellij.execution.ui.ExecutionConsole) XDebugSessionImpl(com.intellij.xdebugger.impl.XDebugSessionImpl)

Example 4 with ContentManager

use of com.intellij.ui.content.ContentManager in project intellij-community by JetBrains.

the class WorkingCopiesContent method show.

public static void show(@NotNull Project project) {
    final ToolWindowManager manager = ToolWindowManager.getInstance(project);
    if (manager != null) {
        final ToolWindow window = manager.getToolWindow(ChangesViewContentManager.TOOLWINDOW_ID);
        if (window != null) {
            window.show(null);
            final ContentManager cm = window.getContentManager();
            final Content content = cm.findContent(TAB_NAME);
            if (content != null) {
                cm.setSelectedContent(content, true);
            }
        }
    }
}
Also used : ToolWindow(com.intellij.openapi.wm.ToolWindow) Content(com.intellij.ui.content.Content) ToolWindowManager(com.intellij.openapi.wm.ToolWindowManager) ChangesViewContentManager(com.intellij.openapi.vcs.changes.ui.ChangesViewContentManager) ContentManager(com.intellij.ui.content.ContentManager)

Example 5 with ContentManager

use of com.intellij.ui.content.ContentManager in project intellij-community by JetBrains.

the class DesignerToolWindowManager method initToolWindow.

@Override
protected void initToolWindow() {
    myToolWindow = ToolWindowManager.getInstance(myProject).registerToolWindow(UIDesignerBundle.message("toolwindow.ui.designer.name"), false, getAnchor(), myProject, true);
    myToolWindow.setIcon(UIDesignerIcons.ToolWindowUIDesigner);
    if (!ApplicationManager.getApplication().isHeadlessEnvironment()) {
        myToolWindow.getComponent().putClientProperty(ToolWindowContentUi.HIDE_ID_LABEL, "true");
    }
    initGearActions();
    ContentManager contentManager = myToolWindow.getContentManager();
    Content content = contentManager.getFactory().createContent(myToolWindowPanel.getToolWindowPanel(), UIDesignerBundle.message("toolwindow.ui.designer.title"), false);
    content.setCloseable(false);
    content.setPreferredFocusableComponent(myToolWindowPanel.getComponentTree());
    contentManager.addContent(content);
    contentManager.setSelectedContent(content, true);
    myToolWindow.setAvailable(false, null);
}
Also used : Content(com.intellij.ui.content.Content) ContentManager(com.intellij.ui.content.ContentManager)

Aggregations

ContentManager (com.intellij.ui.content.ContentManager)62 Content (com.intellij.ui.content.Content)45 ToolWindow (com.intellij.openapi.wm.ToolWindow)16 Project (com.intellij.openapi.project.Project)6 ToolWindowManager (com.intellij.openapi.wm.ToolWindowManager)5 RunnerLayoutUi (com.intellij.execution.ui.RunnerLayoutUi)4 ToolWindowEx (com.intellij.openapi.wm.ex.ToolWindowEx)4 ToolWindowManagerEx (com.intellij.openapi.wm.ex.ToolWindowManagerEx)4 ContentFactory (com.intellij.ui.content.ContentFactory)4 SimpleToolWindowPanel (com.intellij.openapi.ui.SimpleToolWindowPanel)3 ChangesViewContentManager (com.intellij.openapi.vcs.changes.ui.ChangesViewContentManager)3 ContentManagerEvent (com.intellij.ui.content.ContentManagerEvent)3 ConsoleView (com.intellij.execution.ui.ConsoleView)2 ExecutionConsole (com.intellij.execution.ui.ExecutionConsole)2 HierarchyBrowserBase (com.intellij.ide.hierarchy.HierarchyBrowserBase)2 Disposable (com.intellij.openapi.Disposable)2 ToolWindowManagerAdapter (com.intellij.openapi.wm.ex.ToolWindowManagerAdapter)2 ContentManagerAdapter (com.intellij.ui.content.ContentManagerAdapter)2 TabInfo (com.intellij.ui.tabs.TabInfo)2 FlutterApp (io.flutter.run.daemon.FlutterApp)2