Search in sources :

Example 6 with Content

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

the class PydevConsoleRunnerImpl method clearContent.

protected void clearContent(RunContentDescriptor descriptor) {
    PythonConsoleToolWindow toolWindow = PythonConsoleToolWindow.getInstance(myProject);
    if (toolWindow != null && toolWindow.getToolWindow() != null) {
        Content content = toolWindow.getToolWindow().getContentManager().findContent(descriptor.getDisplayName());
        assert content != null;
        toolWindow.getToolWindow().getContentManager().removeContent(content, true);
    }
}
Also used : Content(com.intellij.ui.content.Content)

Example 7 with Content

use of com.intellij.ui.content.Content 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 8 with Content

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

the class BrowseRepositoryAction method actionPerformed.

public void actionPerformed(AnActionEvent e) {
    Project project = e.getData(CommonDataKeys.PROJECT);
    if (project == null) {
        RepositoryBrowserDialog dialog = new RepositoryBrowserDialog(ProjectManager.getInstance().getDefaultProject());
        dialog.show();
    } else {
        ToolWindowManager manager = ToolWindowManager.getInstance(project);
        ToolWindow w = manager.getToolWindow(REPOSITORY_BROWSER_TOOLWINDOW);
        if (w == null) {
            RepositoryToolWindowPanel component = new RepositoryToolWindowPanel(project);
            w = manager.registerToolWindow(REPOSITORY_BROWSER_TOOLWINDOW, true, ToolWindowAnchor.BOTTOM, project, true);
            final Content content = ContentFactory.SERVICE.getInstance().createContent(component, "", false);
            Disposer.register(content, component);
            w.getContentManager().addContent(content);
        }
        w.show(null);
        w.activate(null);
    }
}
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) RepositoryBrowserDialog(org.jetbrains.idea.svn.dialogs.RepositoryBrowserDialog)

Example 9 with Content

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

the class TerminalToolWindowPanel method initTerminal.

public void initTerminal(final ToolWindow toolWindow) {
    LocalTerminalDirectRunner terminalRunner = LocalTerminalDirectRunner.createTerminalRunner(myProject);
    toolWindow.setToHideOnEmptyContent(true);
    Content content = createTerminalInContentPanel(terminalRunner, toolWindow);
    toolWindow.getContentManager().addContent(content);
    ((ToolWindowManagerEx) ToolWindowManager.getInstance(myProject)).addToolWindowManagerListener(new ToolWindowManagerListener() {

        @Override
        public void toolWindowRegistered(@NotNull String id) {
        }

        @Override
        public void stateChanged() {
            ToolWindow window = ToolWindowManager.getInstance(myProject).getToolWindow(TerminalToolWindowFactory.TOOL_WINDOW_ID);
            if (window != null) {
                boolean visible = window.isVisible();
                if (visible && toolWindow.getContentManager().getContentCount() == 0) {
                    initTerminal(window);
                }
            }
        }
    });
    Disposer.register(myProject, new Disposable() {

        @Override
        public void dispose() {
            if (myTerminalWidget != null) {
                myTerminalWidget.dispose();
                myTerminalWidget = null;
            }
        }
    });
    if (myDockContainer == null) {
        myDockContainer = new TerminalDockContainer(toolWindow);
        Disposer.register(myProject, myDockContainer);
        DockManager.getInstance(myProject).register(myDockContainer);
    }
}
Also used : ToolWindowManagerListener(com.intellij.openapi.wm.ex.ToolWindowManagerListener) Disposable(com.intellij.openapi.Disposable) ToolWindow(com.intellij.openapi.wm.ToolWindow) Content(com.intellij.ui.content.Content) DockableContent(com.intellij.ui.docking.DockableContent) ToolWindowManagerEx(com.intellij.openapi.wm.ex.ToolWindowManagerEx)

Example 10 with Content

use of com.intellij.ui.content.Content 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

Content (com.intellij.ui.content.Content)157 ContentManager (com.intellij.ui.content.ContentManager)42 ToolWindow (com.intellij.openapi.wm.ToolWindow)37 NotNull (org.jetbrains.annotations.NotNull)19 ContentFactory (com.intellij.ui.content.ContentFactory)14 Project (com.intellij.openapi.project.Project)13 Nullable (org.jetbrains.annotations.Nullable)13 MessageView (com.intellij.ui.content.MessageView)10 Disposable (com.intellij.openapi.Disposable)8 ToolWindowManager (com.intellij.openapi.wm.ToolWindowManager)8 RunnerLayoutUi (com.intellij.execution.ui.RunnerLayoutUi)7 ToolWindowManagerEx (com.intellij.openapi.wm.ex.ToolWindowManagerEx)7 ConsoleView (com.intellij.execution.ui.ConsoleView)6 SimpleToolWindowPanel (com.intellij.openapi.ui.SimpleToolWindowPanel)6 TabbedContent (com.intellij.ui.content.TabbedContent)6 DefaultActionGroup (com.intellij.openapi.actionSystem.DefaultActionGroup)5 Ref (com.intellij.openapi.util.Ref)5 ExecutionConsole (com.intellij.execution.ui.ExecutionConsole)4 ToolWindowManagerAdapter (com.intellij.openapi.wm.ex.ToolWindowManagerAdapter)4 Assert.assertNotNull (junit.framework.Assert.assertNotNull)4