Search in sources :

Example 1 with ToolWindowManager

use of com.intellij.openapi.wm.ToolWindowManager in project intellij-code-outline by sitano.

the class CodeOutlinePlugin method regForProject.

/**
     * Creates a code outline tool window for the given project.
     *
     * @param project the project to register
     */
private synchronized void regForProject(final Project project) {
    final CodeOutlineToolWindow window = new CodeOutlineToolWindow(this, project);
    ToolWindowManager twm = ToolWindowManager.getInstance(project);
    ToolWindowManagerEx twmEx = (ToolWindowManagerEx) twm;
    ToolWindow tw = twm.registerToolWindow(TOOLWINDOW_ID, false, ToolWindowAnchor.RIGHT);
    ContentFactory contentFactory = ServiceManager.getService(ContentFactory.class);
    Content content = contentFactory.createContent(window, "", false);
    tw.getContentManager().addContent(content);
    tw.getContentManager().setSelectedContent(content, false);
    twmEx.addToolWindowManagerListener(window.getToolWindowManagerListener());
}
Also used : ToolWindow(com.intellij.openapi.wm.ToolWindow) Content(com.intellij.ui.content.Content) ToolWindowManager(com.intellij.openapi.wm.ToolWindowManager) ContentFactory(com.intellij.ui.content.ContentFactory) ToolWindowManagerEx(com.intellij.openapi.wm.ex.ToolWindowManagerEx)

Example 2 with ToolWindowManager

use of com.intellij.openapi.wm.ToolWindowManager in project intellij-plugins by StepicOrg.

the class StudyUtils method initToolWindows.

static void initToolWindows(@NotNull final Project project) {
    final ToolWindowManager windowManager = ToolWindowManager.getInstance(project);
    windowManager.getToolWindow(StudyToolWindowFactory.STUDY_TOOL_WINDOW).getContentManager().removeAllContents(false);
    StudyToolWindowFactory factory = new StudyToolWindowFactory();
    factory.createToolWindowContent(project, windowManager.getToolWindow(StudyToolWindowFactory.STUDY_TOOL_WINDOW));
}
Also used : StudyToolWindowFactory(org.stepik.core.ui.StudyToolWindowFactory) ToolWindowManager(com.intellij.openapi.wm.ToolWindowManager)

Example 3 with ToolWindowManager

use of com.intellij.openapi.wm.ToolWindowManager 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 4 with ToolWindowManager

use of com.intellij.openapi.wm.ToolWindowManager 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 5 with ToolWindowManager

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

the class StudyUtils method initToolWindows.

public static void initToolWindows(@NotNull final Project project) {
    final ToolWindowManager windowManager = ToolWindowManager.getInstance(project);
    windowManager.getToolWindow(StudyToolWindowFactory.STUDY_TOOL_WINDOW).getContentManager().removeAllContents(false);
    StudyToolWindowFactory factory = new StudyToolWindowFactory();
    factory.createToolWindowContent(project, windowManager.getToolWindow(StudyToolWindowFactory.STUDY_TOOL_WINDOW));
}
Also used : StudyToolWindowFactory(com.jetbrains.edu.learning.ui.StudyToolWindowFactory) ToolWindowManager(com.intellij.openapi.wm.ToolWindowManager)

Aggregations

ToolWindowManager (com.intellij.openapi.wm.ToolWindowManager)60 ToolWindow (com.intellij.openapi.wm.ToolWindow)34 Project (com.intellij.openapi.project.Project)27 Presentation (com.intellij.openapi.actionSystem.Presentation)8 Content (com.intellij.ui.content.Content)7 ToolWindowManagerEx (com.intellij.openapi.wm.ex.ToolWindowManagerEx)5 Nullable (org.jetbrains.annotations.Nullable)5 Module (com.intellij.openapi.module.Module)3 ContentManager (com.intellij.ui.content.ContentManager)3 ContentImpl (com.intellij.ui.content.impl.ContentImpl)3 NotNull (org.jetbrains.annotations.NotNull)3 ConsoleView (com.intellij.execution.ui.ConsoleView)2 ProjectView (com.intellij.ide.projectView.ProjectView)2 FileEditorManagerEx (com.intellij.openapi.fileEditor.ex.FileEditorManagerEx)2 ModuleUtilCore (com.intellij.openapi.module.ModuleUtilCore)2 ActionCallback (com.intellij.openapi.util.ActionCallback)2 ToolWindowId (com.intellij.openapi.wm.ToolWindowId)2 ToolWindowImpl (com.intellij.openapi.wm.impl.ToolWindowImpl)2 StudyToolWindow (org.stepik.core.ui.StudyToolWindow)2 AbstractProjectStructureAction.getSelectedAndroidModule (com.android.tools.idea.gradle.actions.AbstractProjectStructureAction.getSelectedAndroidModule)1