use of com.intellij.ide.actions.CloseTabToolbarAction in project intellij-community by JetBrains.
the class CoverageView method createToolbarActions.
private ActionGroup createToolbarActions(final CoverageViewTreeStructure treeStructure) {
final DefaultActionGroup actionGroup = new DefaultActionGroup();
actionGroup.add(new GoUpAction(treeStructure));
if (treeStructure.supportFlattenPackages()) {
actionGroup.add(new FlattenPackagesAction());
}
installAutoScrollToSource(actionGroup);
installAutoScrollFromSource(actionGroup);
actionGroup.add(ActionManager.getInstance().getAction("GenerateCoverageReport"));
actionGroup.add(new CloseTabToolbarAction() {
@Override
public void actionPerformed(AnActionEvent e) {
CoverageDataManager.getInstance(myProject).chooseSuitesBundle(null);
}
});
actionGroup.add(new ContextHelpAction(HELP_ID));
return actionGroup;
}
use of com.intellij.ide.actions.CloseTabToolbarAction in project intellij-community by JetBrains.
the class AbstractVcsHelperImpl method openCommittedChangesTab.
public void openCommittedChangesTab(final CommittedChangesProvider provider, final RepositoryLocation location, final ChangeBrowserSettings settings, final int maxCount, String title) {
DefaultActionGroup extraActions = new DefaultActionGroup();
CommittedChangesPanel panel = new CommittedChangesPanel(myProject, provider, settings, location, extraActions);
panel.setMaxCount(maxCount);
panel.refreshChanges(false);
final ContentFactory factory = ContentFactory.SERVICE.getInstance();
if (title == null && location != null) {
title = VcsBundle.message("browse.changes.content.title", location.toPresentableString());
}
final Content content = factory.createContent(panel, title, false);
final ChangesViewContentI contentManager = ChangesViewContentManager.getInstance(myProject);
contentManager.addContent(content);
contentManager.setSelectedContent(content);
extraActions.add(new CloseTabToolbarAction() {
public void actionPerformed(final AnActionEvent e) {
contentManager.removeContent(content);
}
});
ToolWindow window = ToolWindowManager.getInstance(myProject).getToolWindow(ChangesViewContentManager.TOOLWINDOW_ID);
if (!window.isVisible()) {
window.activate(null);
}
}
Aggregations