Search in sources :

Example 41 with ToolWindowManager

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

the class ToolWindowsGroup method getToolWindowActions.

public static List<ActivateToolWindowAction> getToolWindowActions(@NotNull Project project, boolean shouldSkipHidden) {
    ActionManager actionManager = ActionManager.getInstance();
    ToolWindowManager manager = ToolWindowManager.getInstance(project);
    List<ActivateToolWindowAction> result = ContainerUtil.newArrayList();
    for (String id : manager.getToolWindowIds()) {
        if (shouldSkipHidden && !manager.getToolWindow(id).isShowStripeButton())
            continue;
        String actionId = ActivateToolWindowAction.getActionIdForToolWindow(id);
        AnAction action = actionManager.getAction(actionId);
        if (action instanceof ActivateToolWindowAction) {
            result.add((ActivateToolWindowAction) action);
        }
    }
    Collections.sort(result, COMPARATOR);
    return result;
}
Also used : ToolWindowManager(com.intellij.openapi.wm.ToolWindowManager)

Example 42 with ToolWindowManager

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

the class ToggleDockModeAction method isSelected.

public boolean isSelected(AnActionEvent event) {
    Project project = event.getProject();
    if (project == null) {
        return false;
    }
    ToolWindowManager windowManager = ToolWindowManager.getInstance(project);
    String id = windowManager.getActiveToolWindowId();
    if (id == null) {
        return false;
    }
    return ToolWindowType.DOCKED == windowManager.getToolWindow(id).getType();
}
Also used : Project(com.intellij.openapi.project.Project) ToolWindowManager(com.intellij.openapi.wm.ToolWindowManager)

Example 43 with ToolWindowManager

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

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

the class ToggleFloatingModeAction method isSelected.

public boolean isSelected(AnActionEvent event) {
    Project project = event.getProject();
    if (project == null) {
        return false;
    }
    ToolWindowManager windowManager = ToolWindowManager.getInstance(project);
    String id = windowManager.getActiveToolWindowId();
    if (id == null) {
        return false;
    }
    return ToolWindowType.FLOATING == windowManager.getToolWindow(id).getType();
}
Also used : Project(com.intellij.openapi.project.Project) ToolWindowManager(com.intellij.openapi.wm.ToolWindowManager)

Example 45 with ToolWindowManager

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

the class TabNavigationActionBase method actionPerformed.

public void actionPerformed(AnActionEvent e) {
    DataContext dataContext = e.getDataContext();
    Project project = CommonDataKeys.PROJECT.getData(dataContext);
    if (project == null || project.isDisposed()) {
        return;
    }
    ToolWindowManager windowManager = ToolWindowManager.getInstance(project);
    if (windowManager.isEditorComponentActive()) {
        doNavigate(dataContext, project);
        return;
    }
    ContentManager contentManager = PlatformDataKeys.NONEMPTY_CONTENT_MANAGER.getData(dataContext);
    if (contentManager == null)
        return;
    doNavigate(contentManager);
}
Also used : Project(com.intellij.openapi.project.Project) ToolWindowManager(com.intellij.openapi.wm.ToolWindowManager) ContentManager(com.intellij.ui.content.ContentManager)

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