Search in sources :

Example 1 with CloudDebugHelpAction

use of com.google.cloud.tools.intellij.debugger.actions.CloudDebugHelpAction in project google-cloud-intellij by GoogleCloudPlatform.

the class CloudDebugProcess method registerAdditionalActions.

@Override
public void registerAdditionalActions(@NotNull DefaultActionGroup leftToolbar, @NotNull DefaultActionGroup topToolbar, @NotNull DefaultActionGroup settings) {
    ActionManager manager = ActionManager.getInstance();
    leftToolbar.add(new SaveAndExitAction(), new Constraints(Anchor.AFTER, IdeActions.ACTION_STOP_PROGRAM));
    leftToolbar.remove(manager.getAction(IdeActions.ACTION_RERUN));
    leftToolbar.remove(manager.getAction(IdeActions.ACTION_STOP_PROGRAM));
    // XDebugSessionTab puts this action second from end.
    AnAction[] actions = leftToolbar.getChildActionsOrStubs();
    for (AnAction action : actions) {
        String text = action.getTemplatePresentation().getText();
        if (ExecutionBundle.message("close.tab.action.name").equals(text)) {
            leftToolbar.remove(action);
            break;
        }
    }
    // https://github.com/GoogleCloudPlatform/gcloud-intellij/issues/149
    for (AnAction child : leftToolbar.getChildActionsOrStubs()) {
        if (child.getClass().getCanonicalName().equalsIgnoreCase("com.intellij.ide.actions.ContextHelpAction")) {
            // we never want to show IDEA's help.
            leftToolbar.remove(child);
            // show our help if we have it.
            String helpUrl = GctBundle.getString("clouddebug.helpurl");
            if (!"".equals(helpUrl)) {
                leftToolbar.add(new CloudDebugHelpAction(helpUrl));
            }
            break;
        }
    }
    leftToolbar.remove(manager.getAction(XDebuggerActions.RESUME));
    leftToolbar.remove(manager.getAction(XDebuggerActions.PAUSE));
    leftToolbar.remove(manager.getAction(XDebuggerActions.MUTE_BREAKPOINTS));
    topToolbar.remove(manager.getAction(XDebuggerActions.STEP_OVER));
    topToolbar.remove(manager.getAction(XDebuggerActions.STEP_INTO));
    topToolbar.remove(manager.getAction(XDebuggerActions.FORCE_STEP_INTO));
    topToolbar.remove(manager.getAction(XDebuggerActions.STEP_OUT));
    topToolbar.remove(manager.getAction(XDebuggerActions.RUN_TO_CURSOR));
    topToolbar.remove(manager.getAction(XDebuggerActions.EVALUATE_EXPRESSION));
    topToolbar.remove(manager.getAction(DebuggerActions.POP_FRAME));
}
Also used : ActionManager(com.intellij.openapi.actionSystem.ActionManager) CloudDebugHelpAction(com.google.cloud.tools.intellij.debugger.actions.CloudDebugHelpAction) Constraints(com.intellij.openapi.actionSystem.Constraints) AnAction(com.intellij.openapi.actionSystem.AnAction)

Aggregations

CloudDebugHelpAction (com.google.cloud.tools.intellij.debugger.actions.CloudDebugHelpAction)1 ActionManager (com.intellij.openapi.actionSystem.ActionManager)1 AnAction (com.intellij.openapi.actionSystem.AnAction)1 Constraints (com.intellij.openapi.actionSystem.Constraints)1