private void initActionGroup(DefaultActionGroup group, final Content content) { if (content == null) { return; } group.addSeparator(); group.add(new TabbedContentAction.CloseAction(content)); group.add(myCloseAllAction); group.add(new TabbedContentAction.CloseAllButThisAction(content)); group.addSeparator(); if (content.isPinnable()) { group.add(PinToolwindowTabAction.getPinAction()); group.addSeparator(); } group.add(myNextTabAction); group.add(myPreviousTabAction); group.add(myShowContent); group.addSeparator(); }
private void initActionGroup(DefaultActionGroup group, final Content content) { if (content == null) { return; } group.addSeparator(); group.add(new TabbedContentAction.CloseAction(content)); group.add(myCloseAllAction); group.add(new TabbedContentAction.CloseAllButThisAction(content)); group.addSeparator(); if (content.isPinnable()) { group.add(PinToolwindowTabAction.getPinAction()); group.addSeparator(); } group.add(myNextTabAction); group.add(myPreviousTabAction); group.add(myShowContent); if (content instanceof TabbedContent && ((TabbedContent)content).getTabs().size() > 1) { group.addAction(createSplitTabsAction((TabbedContent)content)); } if (Boolean.TRUE == content.getUserData(Content.TABBED_CONTENT_KEY)) { final String groupName = content.getUserData(Content.TAB_GROUP_NAME_KEY); if (groupName != null) { group.addAction(createMergeTabsAction(myManager, groupName)); } } group.addSeparator(); }
/** * Shows showPopup menu at the specified location. The <code>x</code> and <code>y</code> coordinates * are in JTabbedPane coordinate system. */ private void showPopup(int x, int y) { Content content = getContentAt(x, y); if (content == null) { return; } DefaultActionGroup group = new DefaultActionGroup(); group.add(new TabbedContentAction.CloseAction(content)); if (myTabbedPaneWrapper.getTabCount() > 1) { group.add(new TabbedContentAction.CloseAllAction(myManager)); group.add(new TabbedContentAction.CloseAllButThisAction(content)); } group.addSeparator(); group.add(PinToolwindowTabAction.getPinAction()); group.addSeparator(); group.add(new TabbedContentAction.MyNextTabAction(myManager)); group.add(new TabbedContentAction.MyPreviousTabAction(myManager)); final List<AnAction> additionalActions = myManager.getAdditionalPopupActions(content); if (additionalActions != null) { group.addSeparator(); for (AnAction anAction : additionalActions) { group.add(anAction); } } ActionPopupMenu menu = ActionManager.getInstance().createActionPopupMenu(POPUP_PLACE, group); menu.getComponent().show(myTabbedPaneWrapper.getComponent(), x, y); }