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);
}
}
Aggregations