protected void appendActions(@NotNull DefaultActionGroup actionGroup, @Nullable String helpID) { actionGroup.add(myAutoScrollToSourceHandler.createToggleAction()); final ActionManager actionManager = ActionManager.getInstance(); actionGroup.add(actionManager.getAction(IdeActions.ACTION_EXPAND_ALL)); actionGroup.add(new PinToolwindowTabAction(){ @Override public void update(AnActionEvent event) { super.update(event); // sometimes there is no content to close, e.g. in usage view preview event.getPresentation().setVisible(myContent != null); } }); actionGroup.add(CommonActionsManager.getInstance().createExportToTextFileAction(new ExporterToTextFileHierarchy(this))); actionGroup.add(new CloseAction()); if (helpID != null) { actionGroup.add(new ContextHelpAction(helpID)); } }
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(); }
protected void appendActions(@NotNull DefaultActionGroup actionGroup, @Nullable String helpID) { actionGroup.add(myAutoScrollToSourceHandler.createToggleAction()); actionGroup.add(ActionManager.getInstance().getAction(IdeActions.ACTION_EXPAND_ALL)); actionGroup.add(new PinToolwindowTabAction(){ @Override public void update(AnActionEvent event) { super.update(event); // sometimes there is no content to close, e.g. in usage view preview event.getPresentation().setVisible(myContent != null); } }); actionGroup.add(new CloseAction()); if (helpID != null) { actionGroup.add(new ContextHelpAction(helpID)); } }
protected void appendActions(@Nonnull DefaultActionGroup actionGroup, @Nullable String helpID) { actionGroup.add(myAutoScrollToSourceHandler.createToggleAction()); actionGroup.add(ActionManager.getInstance().getAction(IdeActions.ACTION_EXPAND_ALL)); actionGroup.add(new PinToolwindowTabAction() { @Override public void update(AnActionEvent event) { super.update(event); // sometimes there is no content to close, e.g. in usage view preview event.getPresentation().setVisible(myContent != null); } }); actionGroup.add(new CloseAction()); if (helpID != null) { actionGroup.add(new ContextHelpAction(helpID)); } }
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); }
@NotNull private ActionGroup createActionToolbar(@NotNull final RunContentDescriptor contentDescriptor) { final DefaultActionGroup actionGroup = new DefaultActionGroup(); actionGroup.add(ActionManager.getInstance().getAction(IdeActions.ACTION_RERUN)); final AnAction[] actions = contentDescriptor.getRestartActions(); actionGroup.addAll(actions); if (actions.length > 0) { actionGroup.addSeparator(); } actionGroup.add(ActionManager.getInstance().getAction(IdeActions.ACTION_STOP_PROGRAM)); if (myExecutionResult instanceof DefaultExecutionResult) { actionGroup.addAll(((DefaultExecutionResult)myExecutionResult).getAdditionalStopActions()); } actionGroup.addAll(myExecutionResult.getActions()); for (AnAction anAction : myRunnerActions) { if (anAction != null) { actionGroup.add(anAction); } else { actionGroup.addSeparator(); } } actionGroup.addSeparator(); actionGroup.add(myUi.getOptions().getLayoutActions()); actionGroup.addSeparator(); actionGroup.add(PinToolwindowTabAction.getPinAction()); actionGroup.add(new CloseAction(myEnvironment.getExecutor(), contentDescriptor, myProject)); final String helpId = contentDescriptor.getHelpId(); actionGroup.add(new ContextHelpAction(helpId != null ? helpId : myEnvironment.getExecutor().getHelpId())); return actionGroup; }
@Nonnull private ActionGroup createActionToolbar(@Nonnull RunContentDescriptor contentDescriptor) { final DefaultActionGroup actionGroup = new DefaultActionGroup(); actionGroup.add(ActionManager.getInstance().getAction(IdeActions.ACTION_RERUN)); final AnAction[] actions = contentDescriptor.getRestartActions(); actionGroup.addAll(actions); if (actions.length > 0) { actionGroup.addSeparator(); } actionGroup.add(ActionManager.getInstance().getAction(IdeActions.ACTION_STOP_PROGRAM)); if (myExecutionResult instanceof DefaultExecutionResult) { actionGroup.addAll(((DefaultExecutionResult)myExecutionResult).getAdditionalStopActions()); } actionGroup.addAll(myExecutionResult.getActions()); for (AnAction anAction : myRunnerActions) { if (anAction != null) { actionGroup.add(anAction); } else { actionGroup.addSeparator(); } } actionGroup.addSeparator(); actionGroup.add(myUi.getOptions().getLayoutActions()); actionGroup.addSeparator(); actionGroup.add(PinToolwindowTabAction.getPinAction()); actionGroup.add(new CloseAction(myEnvironment.getExecutor(), contentDescriptor, myProject)); final String helpId = contentDescriptor.getHelpId(); actionGroup.add(new ContextHelpAction(helpId != null ? helpId : myEnvironment.getExecutor().getHelpId())); return actionGroup; }
private void attachToSession(@NotNull XDebugSessionImpl session) { for (XDebugView view : myViews) { session.addSessionListener(new XDebugViewSessionListener(view), myRunContentDescriptor); } XDebugTabLayouter layouter = session.getDebugProcess().createTabLayouter(); Content consoleContent = layouter.registerConsoleContent(myUi, myConsole); attachNotificationTo(consoleContent); layouter.registerAdditionalContent(myUi); RunContentBuilder.addAdditionalConsoleEditorActions(myConsole, consoleContent); if (ApplicationManager.getApplication().isUnitTestMode()) { return; } DefaultActionGroup leftToolbar = new DefaultActionGroup(); final Executor debugExecutor = DefaultDebugExecutor.getDebugExecutorInstance(); if (myEnvironment != null) { leftToolbar.add(ActionManager.getInstance().getAction(IdeActions.ACTION_RERUN)); List<AnAction> additionalRestartActions = session.getRestartActions(); if (!additionalRestartActions.isEmpty()) { leftToolbar.addAll(additionalRestartActions); leftToolbar.addSeparator(); } leftToolbar.addAll(session.getExtraActions()); } leftToolbar.addAll(getCustomizedActionGroup(XDebuggerActions.TOOL_WINDOW_LEFT_TOOLBAR_GROUP)); for (AnAction action : session.getExtraStopActions()) { leftToolbar.add(action, new Constraints(Anchor.AFTER, IdeActions.ACTION_STOP_PROGRAM)); } //group.addSeparator(); //addAction(group, DebuggerActions.EXPORT_THREADS); leftToolbar.addSeparator(); leftToolbar.add(myUi.getOptions().getLayoutActions()); final AnAction[] commonSettings = myUi.getOptions().getSettingsActionsList(); DefaultActionGroup settings = new DefaultActionGroup(ActionsBundle.message("group.XDebugger.settings.text"), true); settings.getTemplatePresentation().setIcon(myUi.getOptions().getSettingsActions().getTemplatePresentation().getIcon()); settings.addAll(commonSettings); leftToolbar.add(settings); leftToolbar.addSeparator(); leftToolbar.add(PinToolwindowTabAction.getPinAction()); leftToolbar.add(new CloseAction(myEnvironment != null ? myEnvironment.getExecutor() : debugExecutor, myRunContentDescriptor, myProject)); leftToolbar.add(new ContextHelpAction(debugExecutor.getHelpId())); DefaultActionGroup topToolbar = new DefaultActionGroup(); topToolbar.addAll(getCustomizedActionGroup(XDebuggerActions.TOOL_WINDOW_TOP_TOOLBAR_GROUP)); session.getDebugProcess().registerAdditionalActions(leftToolbar, topToolbar, settings); myUi.getOptions().setLeftToolbar(leftToolbar, ActionPlaces.DEBUGGER_TOOLBAR); myUi.getOptions().setTopToolbar(topToolbar, ActionPlaces.DEBUGGER_TOOLBAR); if (myEnvironment != null) { initLogConsoles(myEnvironment.getRunProfile(), myRunContentDescriptor, myConsole); } }
private ActionGroup createActionToolbar(final RunContentDescriptor contentDescriptor, final JComponent component) { final DefaultActionGroup actionGroup = new DefaultActionGroup(); final RestartAction restartAction = new RestartAction(myExecutor, myRunner, contentDescriptor, getEnvironment()); restartAction.registerShortcut(component); actionGroup.add(restartAction); contentDescriptor.setRestarter(new Runnable() { @Override public void run() { restartAction.restart(); } }); if (myExecutionResult instanceof DefaultExecutionResult) { final AnAction[] actions = ((DefaultExecutionResult)myExecutionResult).getRestartActions(); if (actions != null) { actionGroup.addAll(actions); if (actions.length > 0) { actionGroup.addSeparator(); } } } final AnAction stopAction = ActionManager.getInstance().getAction(IdeActions.ACTION_STOP_PROGRAM); actionGroup.add(stopAction); if (myExecutionResult instanceof DefaultExecutionResult) { actionGroup.addAll(((DefaultExecutionResult)myExecutionResult).getAdditionalStopActions()); } actionGroup.addAll(myExecutionResult.getActions()); for (final AnAction anAction : myRunnerActions) { if (anAction != null) { actionGroup.add(anAction); } else { actionGroup.addSeparator(); } } actionGroup.addSeparator(); actionGroup.add(myUi.getOptions().getLayoutActions()); actionGroup.addSeparator(); actionGroup.add(PinToolwindowTabAction.getPinAction()); actionGroup.add(new CloseAction(myExecutor, contentDescriptor, getProject())); final String helpId = contentDescriptor.getHelpId(); actionGroup.add(new ContextHelpAction(helpId != null ? helpId : myExecutor.getHelpId())); return actionGroup; }
private void attachToSession(@Nonnull XDebugSessionImpl session) { for (XDebugView view : myViews.values()) { attachViewToSession(session, view); } XDebugTabLayouter layouter = session.getDebugProcess().createTabLayouter(); Content consoleContent = layouter.registerConsoleContent(myUi, myConsole); attachNotificationTo(consoleContent); layouter.registerAdditionalContent(myUi); RunContentBuilder.addAdditionalConsoleEditorActions(myConsole, consoleContent); if (ApplicationManager.getApplication().isUnitTestMode()) { return; } DefaultActionGroup leftToolbar = new DefaultActionGroup(); final Executor debugExecutor = DefaultDebugExecutor.getDebugExecutorInstance(); if (myEnvironment != null) { leftToolbar.add(ActionManager.getInstance().getAction(IdeActions.ACTION_RERUN)); List<AnAction> additionalRestartActions = session.getRestartActions(); if (!additionalRestartActions.isEmpty()) { leftToolbar.addAll(additionalRestartActions); leftToolbar.addSeparator(); } leftToolbar.addAll(session.getExtraActions()); } leftToolbar.addAll(getCustomizedActionGroup(XDebuggerActions.TOOL_WINDOW_LEFT_TOOLBAR_GROUP)); for (AnAction action : session.getExtraStopActions()) { leftToolbar.add(action, new Constraints(Anchor.AFTER, IdeActions.ACTION_STOP_PROGRAM)); } //group.addSeparator(); //addAction(group, DebuggerActions.EXPORT_THREADS); leftToolbar.addSeparator(); leftToolbar.add(myUi.getOptions().getLayoutActions()); final AnAction[] commonSettings = myUi.getOptions().getSettingsActionsList(); DefaultActionGroup settings = new DefaultActionGroup(ActionsBundle.message("group.XDebugger.settings.text"), true); settings.getTemplatePresentation().setIcon(myUi.getOptions().getSettingsActions().getTemplatePresentation().getIcon()); settings.addAll(commonSettings); leftToolbar.add(settings); leftToolbar.addSeparator(); leftToolbar.add(PinToolwindowTabAction.getPinAction()); leftToolbar.add(new CloseAction(myEnvironment != null ? myEnvironment.getExecutor() : debugExecutor, myRunContentDescriptor, myProject)); leftToolbar.add(new ContextHelpAction(debugExecutor.getHelpId())); DefaultActionGroup topToolbar = new DefaultActionGroup(); topToolbar.addAll(getCustomizedActionGroup(XDebuggerActions.TOOL_WINDOW_TOP_TOOLBAR_GROUP)); session.getDebugProcess().registerAdditionalActions(leftToolbar, topToolbar, settings); myUi.getOptions().setLeftToolbar(leftToolbar, ActionPlaces.DEBUGGER_TOOLBAR); myUi.getOptions().setTopToolbar(topToolbar, ActionPlaces.DEBUGGER_TOOLBAR); if (myEnvironment != null) { initLogConsoles(myEnvironment.getRunProfile(), myRunContentDescriptor, myConsole); } }