Search in sources :

Example 51 with ToolWindowManager

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

the class StudyUtils method registerStudyToolWindow.

public static void registerStudyToolWindow(@Nullable final Course course, Project project) {
    if (course != null && "PyCharm".equals(course.getCourseType())) {
        final ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
        registerToolWindows(toolWindowManager, project);
        final ToolWindow studyToolWindow = toolWindowManager.getToolWindow(StudyToolWindowFactory.STUDY_TOOL_WINDOW);
        if (studyToolWindow != null) {
            studyToolWindow.show(null);
            initToolWindows(project);
        }
    }
}
Also used : ToolWindow(com.intellij.openapi.wm.ToolWindow) StudyToolWindow(com.jetbrains.edu.learning.ui.StudyToolWindow) ToolWindowManager(com.intellij.openapi.wm.ToolWindowManager)

Example 52 with ToolWindowManager

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

the class MvcModuleStructureSynchronizer method updateProjectViewVisibility.

private void updateProjectViewVisibility() {
    if (ApplicationManager.getApplication().isUnitTestMode())
        return;
    StartupManager.getInstance(myProject).runWhenProjectIsInitialized(new DumbAwareRunnable() {

        @Override
        public void run() {
            ApplicationManager.getApplication().invokeLater(() -> {
                if (myProject.isDisposed())
                    return;
                for (ToolWindowEP ep : ToolWindowEP.EP_NAME.getExtensions()) {
                    if (MvcToolWindowDescriptor.class.isAssignableFrom(ep.getFactoryClass())) {
                        MvcToolWindowDescriptor descriptor = (MvcToolWindowDescriptor) ep.getToolWindowFactory();
                        String id = descriptor.getToolWindowId();
                        boolean shouldShow = descriptor.value(myProject);
                        ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(myProject);
                        ToolWindow toolWindow = toolWindowManager.getToolWindow(id);
                        if (shouldShow && toolWindow == null) {
                            toolWindow = toolWindowManager.registerToolWindow(id, true, ToolWindowAnchor.LEFT, myProject, true);
                            toolWindow.setIcon(descriptor.getFramework().getToolWindowIcon());
                            descriptor.createToolWindowContent(myProject, toolWindow);
                        } else if (!shouldShow && toolWindow != null) {
                            toolWindowManager.unregisterToolWindow(id);
                            Disposer.dispose(toolWindow.getContentManager());
                        }
                    }
                }
            });
        }
    });
}
Also used : ToolWindow(com.intellij.openapi.wm.ToolWindow) MvcToolWindowDescriptor(org.jetbrains.plugins.groovy.mvc.projectView.MvcToolWindowDescriptor) ToolWindowManager(com.intellij.openapi.wm.ToolWindowManager) ToolWindowEP(com.intellij.openapi.wm.ToolWindowEP) DumbAwareRunnable(com.intellij.openapi.project.DumbAwareRunnable)

Example 53 with ToolWindowManager

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

the class ProjectLevelVcsManagerImpl method disposeComponent.

@Override
public void disposeComponent() {
    releaseConsole();
    myMappings.disposeMe();
    Disposer.dispose(myAnnotationLocalChangesListener);
    myContentManager = null;
    ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(myProject);
    if (toolWindowManager != null && toolWindowManager.getToolWindow(ToolWindowId.VCS) != null) {
        toolWindowManager.unregisterToolWindow(ToolWindowId.VCS);
    }
}
Also used : ToolWindowManager(com.intellij.openapi.wm.ToolWindowManager)

Example 54 with ToolWindowManager

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

the class SwapPanelsAction method update.

public void update(AnActionEvent e) {
    Presentation presentation = e.getPresentation();
    Project project = e.getProject();
    if (project == null) {
        presentation.setEnabled(false);
        return;
    }
    ToolWindowManager windowManager = ToolWindowManager.getInstance(project);
    String id = windowManager.getActiveToolWindowId();
    presentation.setEnabled(ToolWindowId.COMMANDER.equals(id));
}
Also used : Project(com.intellij.openapi.project.Project) ToolWindowManager(com.intellij.openapi.wm.ToolWindowManager) Presentation(com.intellij.openapi.actionSystem.Presentation)

Example 55 with ToolWindowManager

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

the class SyncViewsAction method update.

public void update(AnActionEvent e) {
    Presentation presentation = e.getPresentation();
    Project project = e.getProject();
    if (project == null) {
        presentation.setEnabled(false);
        return;
    }
    ToolWindowManager windowManager = ToolWindowManager.getInstance(project);
    String id = windowManager.getActiveToolWindowId();
    boolean value = ToolWindowId.COMMANDER.equals(id);
    presentation.setEnabled(value);
}
Also used : Project(com.intellij.openapi.project.Project) ToolWindowManager(com.intellij.openapi.wm.ToolWindowManager) Presentation(com.intellij.openapi.actionSystem.Presentation)

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