Search in sources :

Example 1 with CloseTabToolbarAction

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;
}
Also used : CloseTabToolbarAction(com.intellij.ide.actions.CloseTabToolbarAction) ContextHelpAction(com.intellij.ide.actions.ContextHelpAction)

Example 2 with CloseTabToolbarAction

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);
    }
}
Also used : ToolWindow(com.intellij.openapi.wm.ToolWindow) Content(com.intellij.ui.content.Content) CloseTabToolbarAction(com.intellij.ide.actions.CloseTabToolbarAction) AnActionEvent(com.intellij.openapi.actionSystem.AnActionEvent) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup) ContentFactory(com.intellij.ui.content.ContentFactory)

Aggregations

CloseTabToolbarAction (com.intellij.ide.actions.CloseTabToolbarAction)2 ContextHelpAction (com.intellij.ide.actions.ContextHelpAction)1 AnActionEvent (com.intellij.openapi.actionSystem.AnActionEvent)1 DefaultActionGroup (com.intellij.openapi.actionSystem.DefaultActionGroup)1 ToolWindow (com.intellij.openapi.wm.ToolWindow)1 Content (com.intellij.ui.content.Content)1 ContentFactory (com.intellij.ui.content.ContentFactory)1