mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
ui: move actions to Debugger group
This commit is contained in:
@@ -16,41 +16,28 @@
|
||||
package com.intellij.debugger.actions;
|
||||
|
||||
import com.intellij.icons.AllIcons;
|
||||
import com.intellij.openapi.actionSystem.*;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.keymap.KeyMapBundle;
|
||||
import com.intellij.openapi.keymap.KeymapExtension;
|
||||
import com.intellij.openapi.keymap.KeymapGroup;
|
||||
import com.intellij.openapi.keymap.impl.ui.ActionsTreeUtil;
|
||||
import com.intellij.openapi.keymap.impl.ui.Group;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Condition;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
*/
|
||||
public class DebuggerKeymapExtension implements KeymapExtension {
|
||||
public KeymapGroup createGroup(final Condition<AnAction> filtered, final Project project) {
|
||||
ActionManager actionManager = ActionManager.getInstance();
|
||||
AnAction[] xDebuggerActions = ((DefaultActionGroup)actionManager.getActionOrStub("XDebugger.Actions")).getChildActionsOrStubs();
|
||||
AnAction[] javaDebuggerActions = ((DefaultActionGroup)actionManager.getActionOrStub("JavaDebuggerActions")).getChildActionsOrStubs();
|
||||
AnAction[] xDebuggerActions = ActionsTreeUtil.getActions("XDebugger.Actions");
|
||||
AnAction[] javaDebuggerActions = ActionsTreeUtil.getActions("JavaDebuggerActions");
|
||||
|
||||
ArrayList<String> ids = new ArrayList<>();
|
||||
for (AnAction debuggerAction : ArrayUtil.mergeArrays(xDebuggerActions, javaDebuggerActions)) {
|
||||
String actionId = debuggerAction instanceof ActionStub ? ((ActionStub)debuggerAction).getId() : actionManager.getId(debuggerAction);
|
||||
if (filtered == null || filtered.value(debuggerAction)) {
|
||||
ids.add(actionId);
|
||||
}
|
||||
}
|
||||
|
||||
Collections.sort(ids);
|
||||
Group group = new Group(KeyMapBundle.message("debugger.actions.group.title"), AllIcons.General.Debug);
|
||||
for (String id : ids) {
|
||||
group.addActionId(id);
|
||||
for (AnAction action : ArrayUtil.mergeArrays(xDebuggerActions, javaDebuggerActions)) {
|
||||
ActionsTreeUtil.addAction(group, action, filtered);
|
||||
}
|
||||
|
||||
return group;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -716,23 +716,10 @@
|
||||
<add-to-group group-id="RunMenu" anchor="last"/>
|
||||
</group>
|
||||
|
||||
<action id="Debugger.AddToWatch" class="com.intellij.xdebugger.impl.actions.AddToWatchesAction" icon="AllIcons.Debugger.AddToWatch"/>
|
||||
<action id="Debugger.EvaluateInConsole" class="com.intellij.xdebugger.impl.actions.EvaluateInConsoleAction"/>
|
||||
|
||||
<group id="EditorPopupMenuDebug">
|
||||
<separator/>
|
||||
<reference ref="EvaluateExpression"/>
|
||||
<reference ref="RunToCursor"/>
|
||||
<reference ref="ForceRunToCursor"/>
|
||||
<reference ref="Debugger.AddToWatch"/>
|
||||
<reference ref="Debugger.EvaluateInConsole"/>
|
||||
<separator/>
|
||||
|
||||
<add-to-group group-id="EditorLangPopupMenu" relative-to-action="EditorPopupMenu.Run" anchor="before"/>
|
||||
</group>
|
||||
|
||||
|
||||
<group id="XDebugger.Actions">
|
||||
<action id="Debugger.AddToWatch" class="com.intellij.xdebugger.impl.actions.AddToWatchesAction" icon="AllIcons.Debugger.AddToWatch"/>
|
||||
<action id="Debugger.EvaluateInConsole" class="com.intellij.xdebugger.impl.actions.EvaluateInConsoleAction"/>
|
||||
|
||||
<action id="XDebugger.SetValue" class="com.intellij.xdebugger.impl.ui.tree.actions.XSetValueAction"/>
|
||||
<action id="XDebugger.CopyValue" class="com.intellij.xdebugger.impl.ui.tree.actions.XCopyValueAction" use-shortcut-of="$Copy"/>
|
||||
<action id="XDebugger.CompareValueWithClipboard" class="com.intellij.xdebugger.impl.ui.tree.actions.XCompareWithClipboardAction"/>
|
||||
@@ -765,6 +752,18 @@
|
||||
<action id="Debugger.ShowReferring" class="com.intellij.xdebugger.impl.ui.tree.actions.ShowReferringObjectsAction"/>
|
||||
</group>
|
||||
|
||||
<group id="EditorPopupMenuDebug">
|
||||
<separator/>
|
||||
<reference ref="EvaluateExpression"/>
|
||||
<reference ref="RunToCursor"/>
|
||||
<reference ref="ForceRunToCursor"/>
|
||||
<reference ref="Debugger.AddToWatch"/>
|
||||
<reference ref="Debugger.EvaluateInConsole"/>
|
||||
<separator/>
|
||||
|
||||
<add-to-group group-id="EditorLangPopupMenu" relative-to-action="EditorPopupMenu.Run" anchor="before"/>
|
||||
</group>
|
||||
|
||||
<group id="XDebugger.ToolWindow.TopToolbar">
|
||||
<reference ref="ShowExecutionPoint"/>
|
||||
<separator/>
|
||||
|
||||
@@ -125,6 +125,7 @@
|
||||
|
||||
<action id="ExportThreads" class="com.intellij.debugger.actions.ExportThreadsAction" icon="AllIcons.Actions.Export">
|
||||
<add-to-group group-id="XDebugger.Frames.Tree.Popup"/>
|
||||
<add-to-group group-id="XDebugger.Actions"/>
|
||||
</action>
|
||||
<action id="DumpThreads" class="com.intellij.debugger.actions.ThreadDumpAction" text="Get thread dump" icon="AllIcons.Actions.Dump">
|
||||
<add-to-group group-id="RunMenu" anchor="last"/>
|
||||
@@ -206,12 +207,15 @@
|
||||
<action id="Debugger.AddSteppingFilter" class="com.intellij.debugger.actions.AddSteppingFilterAction" text="Add Stepping Filter...">
|
||||
<add-to-group group-id="XDebugger.Frames.Tree.Popup"/>
|
||||
</action>
|
||||
|
||||
<action id="Debugger.CreateRenderer" class="com.intellij.debugger.actions.CreateRendererAction" text="Create..."/>
|
||||
<action id="Debugger.AutoRenderer" class="com.intellij.debugger.actions.AutoRendererAction"/>
|
||||
</group>
|
||||
|
||||
<group id="Debugger.Representation">
|
||||
<action id="Debugger.CreateRenderer" class="com.intellij.debugger.actions.CreateRendererAction" text="Create..."/>
|
||||
<reference ref="Debugger.CreateRenderer"/>
|
||||
<separator/>
|
||||
<action id="Debugger.AutoRenderer" class="com.intellij.debugger.actions.AutoRendererAction"/>
|
||||
<reference ref="Debugger.AutoRenderer"/>
|
||||
</group>
|
||||
|
||||
<group id="EditorPopupMenuDebugJava">
|
||||
|
||||
Reference in New Issue
Block a user