Search in sources :

Example 1 with ChangesViewContentManager

use of com.intellij.openapi.vcs.changes.ui.ChangesViewContentManager in project intellij-community by JetBrains.

the class VcsShowToolWindowTabAction method actionPerformed.

@Override
public void actionPerformed(@NotNull AnActionEvent e) {
    final Project project = e.getRequiredData(CommonDataKeys.PROJECT);
    ToolWindow toolWindow = assertNotNull(getToolWindow(project));
    final ChangesViewContentManager changesViewContentManager = (ChangesViewContentManager) ChangesViewContentManager.getInstance(project);
    final String tabName = getTabName();
    if (toolWindow.isActive() && changesViewContentManager.isContentSelected(tabName)) {
        toolWindow.hide(null);
    } else {
        toolWindow.activate(() -> {
            if (!changesViewContentManager.isContentSelected(tabName)) {
                changesViewContentManager.selectContent(tabName, true);
            }
        }, true, true);
    }
}
Also used : Project(com.intellij.openapi.project.Project) ToolWindow(com.intellij.openapi.wm.ToolWindow) ChangesViewContentManager(com.intellij.openapi.vcs.changes.ui.ChangesViewContentManager)

Aggregations

Project (com.intellij.openapi.project.Project)1 ChangesViewContentManager (com.intellij.openapi.vcs.changes.ui.ChangesViewContentManager)1 ToolWindow (com.intellij.openapi.wm.ToolWindow)1