mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-80753 - assert: AnAction.setShortcutSet
This commit is contained in:
@@ -689,10 +689,19 @@
|
||||
<action id="ToggleTemporaryLineBreakpoint">
|
||||
<keyboard-shortcut first-keystroke="control shift alt F8"/>
|
||||
</action>
|
||||
<action id="XDebugger.SetValue">
|
||||
<keyboard-shortcut first-keystroke="F2"/>
|
||||
</action>
|
||||
<action id="XDebugger.EditWatch">
|
||||
<keyboard-shortcut first-keystroke="F2"/>
|
||||
</action>
|
||||
<action id="XDebugger.NewWatch">
|
||||
<keyboard-shortcut first-keystroke="INSERT"/>
|
||||
</action>
|
||||
<action id="Debugger.EditTypeSource">
|
||||
<keyboard-shortcut first-keystroke="shift F4"/>
|
||||
</action>
|
||||
<action id="ToggleBookmark">
|
||||
<action id="ToggleBookmark">
|
||||
<keyboard-shortcut first-keystroke="F11"/>
|
||||
</action>
|
||||
<action id="ToggleBookmarkWithMnemonic">
|
||||
|
||||
@@ -712,25 +712,29 @@
|
||||
|
||||
<group id="XDebugger.Actions">
|
||||
<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"/>
|
||||
<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"/>
|
||||
<action id="XDebugger.CopyName" class="com.intellij.xdebugger.impl.ui.tree.actions.XCopyNameAction"/>
|
||||
<action id="XDebugger.Inspect" class="com.intellij.xdebugger.impl.ui.tree.actions.XInspectAction"/>
|
||||
<action id="XDebugger.JumpToSource" class="com.intellij.xdebugger.impl.ui.tree.actions.XJumpToSourceAction"/>
|
||||
<action id="XDebugger.JumpToTypeSource" class="com.intellij.xdebugger.impl.ui.tree.actions.XJumpToTypeSourceAction"/>
|
||||
<action id="XDebugger.JumpToSource" class="com.intellij.xdebugger.impl.ui.tree.actions.XJumpToSourceAction"
|
||||
use-shortcut-of="EditSource"/>
|
||||
<action id="XDebugger.JumpToTypeSource" class="com.intellij.xdebugger.impl.ui.tree.actions.XJumpToTypeSourceAction"
|
||||
use-shortcut-of="Debugger.EditTypeSource"/>
|
||||
|
||||
<action id="Debugger.Tree.AddToWatches" class="com.intellij.xdebugger.impl.ui.tree.actions.XAddToWatchesAction" icon="AllIcons.Debugger.AddToWatch"/>
|
||||
<action id="Debugger.Tree.EvaluateInConsole" class="com.intellij.xdebugger.impl.ui.tree.actions.EvaluateInConsoleFromTreeAction"/>
|
||||
|
||||
<action id="XDebugger.NewWatch" class="com.intellij.xdebugger.impl.frame.actions.XNewWatchAction" icon="AllIcons.Debugger.NewWatch"/>
|
||||
<action id="XDebugger.EditWatch" class="com.intellij.xdebugger.impl.frame.actions.XEditWatchAction"/>
|
||||
<action id="XDebugger.CopyWatch" class="com.intellij.xdebugger.impl.frame.actions.XCopyWatchAction" icon="AllIcons.Actions.Copy" text="Copy Watch"/>
|
||||
<action id="XDebugger.RemoveWatch" class="com.intellij.xdebugger.impl.frame.actions.XRemoveWatchAction" icon="AllIcons.Actions.Delete"/>
|
||||
<action id="XDebugger.CopyWatch" class="com.intellij.xdebugger.impl.frame.actions.XCopyWatchAction" icon="AllIcons.Actions.Copy"
|
||||
text="Copy Watch" use-shortcut-of="EditorDuplicate"/>
|
||||
<action id="XDebugger.RemoveWatch" class="com.intellij.xdebugger.impl.frame.actions.XRemoveWatchAction" icon="AllIcons.Actions.Delete"
|
||||
use-shortcut-of="$Delete"/>
|
||||
<action id="XDebugger.RemoveAllWatches" class="com.intellij.xdebugger.impl.frame.actions.XRemoveAllWatchesAction"/>
|
||||
<action id="XDebugger.MuteBreakpoints" class="com.intellij.xdebugger.impl.actions.MuteBreakpointAction"
|
||||
icon="AllIcons.Debugger.MuteBreakpoints"/>
|
||||
<action id="XDebugger.ToggleSortValues" class="com.intellij.xdebugger.impl.ui.tree.actions.SortValuesToggleAction" icon="AllIcons.ObjectBrowser.Sorted"/>
|
||||
<action id="Debugger.MarkObject" class="com.intellij.xdebugger.impl.actions.MarkObjectAction"/>
|
||||
<action id="Debugger.MarkObject" class="com.intellij.xdebugger.impl.actions.MarkObjectAction" use-shortcut-of="ToggleBookmark"/>
|
||||
<action id="Debugger.FocusOnBreakpoint" class="com.intellij.xdebugger.impl.actions.FocusOnBreakpointAction"/>
|
||||
<action id="Debugger.ShowReferring" class="com.intellij.xdebugger.impl.ui.tree.actions.ShowReferringObjectsAction"/>
|
||||
</group>
|
||||
|
||||
+8
-14
@@ -43,6 +43,7 @@ import com.intellij.xdebugger.impl.XDebugSessionImpl;
|
||||
import com.intellij.xdebugger.impl.actions.XDebuggerActions;
|
||||
import com.intellij.xdebugger.impl.breakpoints.XExpressionImpl;
|
||||
import com.intellij.xdebugger.impl.frame.actions.XWatchesTreeActionBase;
|
||||
import com.intellij.xdebugger.impl.ui.DebuggerUIUtil;
|
||||
import com.intellij.xdebugger.impl.ui.XDebugSessionData;
|
||||
import com.intellij.xdebugger.impl.ui.XDebugSessionTab;
|
||||
import com.intellij.xdebugger.impl.ui.tree.XDebuggerTree;
|
||||
@@ -80,19 +81,11 @@ public class XWatchesViewImpl extends XVariablesView implements DnDNativeTarget,
|
||||
|
||||
XDebuggerTree tree = getTree();
|
||||
createNewRootNode(null);
|
||||
AnAction newWatchAction = actionManager.getAction(XDebuggerActions.XNEW_WATCH);
|
||||
AnAction removeWatchAction = actionManager.getAction(XDebuggerActions.XREMOVE_WATCH);
|
||||
AnAction copyAction = actionManager.getAction(XDebuggerActions.XCOPY_WATCH);
|
||||
AnAction editWatchAction = actionManager.getAction(XDebuggerActions.XEDIT_WATCH);
|
||||
|
||||
newWatchAction.registerCustomShortcutSet(CommonShortcuts.INSERT, tree, myDisposables);
|
||||
removeWatchAction.registerCustomShortcutSet(CommonShortcuts.getDelete(), tree, myDisposables);
|
||||
|
||||
CustomShortcutSet f2Shortcut = new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_F2, 0));
|
||||
editWatchAction.registerCustomShortcutSet(f2Shortcut, tree, myDisposables);
|
||||
|
||||
copyAction.registerCustomShortcutSet(
|
||||
ActionManager.getInstance().getAction(IdeActions.ACTION_EDITOR_DUPLICATE).getShortcutSet(), tree, myDisposables);
|
||||
DebuggerUIUtil.registerActionOnComponent(XDebuggerActions.XNEW_WATCH, tree, myDisposables);
|
||||
DebuggerUIUtil.registerActionOnComponent(XDebuggerActions.XREMOVE_WATCH, tree, myDisposables);
|
||||
DebuggerUIUtil.registerActionOnComponent(XDebuggerActions.XCOPY_WATCH, tree, myDisposables);
|
||||
DebuggerUIUtil.registerActionOnComponent(XDebuggerActions.XEDIT_WATCH, tree, myDisposables);
|
||||
|
||||
DnDManager.getInstance().registerTarget(this, tree);
|
||||
|
||||
@@ -113,8 +106,9 @@ public class XWatchesViewImpl extends XVariablesView implements DnDNativeTarget,
|
||||
final ToolbarDecorator decorator = ToolbarDecorator.createDecorator(getTree()).disableUpDownActions();
|
||||
|
||||
decorator.setAddAction(button -> executeAction(XDebuggerActions.XNEW_WATCH));
|
||||
decorator.setAddActionName(newWatchAction.getTemplatePresentation().getText());
|
||||
decorator.setAddActionName(actionManager.getAction(XDebuggerActions.XNEW_WATCH).getTemplatePresentation().getText());
|
||||
|
||||
AnAction removeWatchAction = actionManager.getAction(XDebuggerActions.XREMOVE_WATCH);
|
||||
decorator.setRemoveAction(button -> executeAction(XDebuggerActions.XREMOVE_WATCH));
|
||||
decorator.setRemoveActionName(removeWatchAction.getTemplatePresentation().getText());
|
||||
|
||||
@@ -122,7 +116,7 @@ public class XWatchesViewImpl extends XVariablesView implements DnDNativeTarget,
|
||||
removeWatchAction.update(e);
|
||||
return e.getPresentation().isEnabled();
|
||||
});
|
||||
decorator.addExtraAction(AnActionButton.fromAction(copyAction));
|
||||
decorator.addExtraAction(AnActionButton.fromAction(actionManager.getAction(XDebuggerActions.XCOPY_WATCH)));
|
||||
decorator.addExtraAction(
|
||||
new ToggleActionButton(XDebuggerBundle.message("debugger.session.tab.show.watches.in.variables"), AllIcons.Debugger.Watches) {
|
||||
@Override
|
||||
|
||||
@@ -16,7 +16,9 @@
|
||||
package com.intellij.xdebugger.impl.ui;
|
||||
|
||||
import com.intellij.codeInsight.hint.HintUtil;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.actionSystem.ActionManager;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.LogicalPosition;
|
||||
@@ -370,6 +372,11 @@ public class DebuggerUIUtil {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void registerActionOnComponent(String name, JComponent component, Disposable parentDisposable) {
|
||||
AnAction action = ActionManager.getInstance().getAction(name);
|
||||
action.registerCustomShortcutSet(action.getShortcutSet(), component, parentDisposable);
|
||||
}
|
||||
|
||||
public static void registerExtraHandleShortcuts(final ListPopupImpl popup, String... actionNames) {
|
||||
for (String name : actionNames) {
|
||||
KeyStroke stroke = KeymapUtil.getKeyStroke(ActionManager.getInstance().getAction(name).getShortcutSet());
|
||||
|
||||
@@ -350,16 +350,11 @@ public class XDebuggerTree extends DnDAwareTree implements DataProvider, Disposa
|
||||
}
|
||||
|
||||
private void registerShortcuts() {
|
||||
ActionManager actionManager = ActionManager.getInstance();
|
||||
actionManager.getAction(XDebuggerActions.SET_VALUE)
|
||||
.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_F2, 0)), this, this);
|
||||
actionManager.getAction(XDebuggerActions.COPY_VALUE).registerCustomShortcutSet(CommonShortcuts.getCopy(), this, this);
|
||||
actionManager.getAction(XDebuggerActions.JUMP_TO_SOURCE).registerCustomShortcutSet(CommonShortcuts.getEditSource(), this, this);
|
||||
Shortcut[] editTypeShortcuts = KeymapManager.getInstance().getActiveKeymap().getShortcuts(XDebuggerActions.EDIT_TYPE_SOURCE);
|
||||
actionManager.getAction(XDebuggerActions.JUMP_TO_TYPE_SOURCE).registerCustomShortcutSet(
|
||||
new CustomShortcutSet(editTypeShortcuts), this, this);
|
||||
actionManager.getAction(XDebuggerActions.MARK_OBJECT).registerCustomShortcutSet(
|
||||
new CustomShortcutSet(KeymapManager.getInstance().getActiveKeymap().getShortcuts("ToggleBookmark")), this, this);
|
||||
DebuggerUIUtil.registerActionOnComponent(XDebuggerActions.SET_VALUE, this, this);
|
||||
DebuggerUIUtil.registerActionOnComponent(XDebuggerActions.COPY_VALUE, this, this);
|
||||
DebuggerUIUtil.registerActionOnComponent(XDebuggerActions.JUMP_TO_SOURCE, this, this);
|
||||
DebuggerUIUtil.registerActionOnComponent(XDebuggerActions.JUMP_TO_TYPE_SOURCE, this, this);
|
||||
DebuggerUIUtil.registerActionOnComponent(XDebuggerActions.MARK_OBJECT, this, this);
|
||||
}
|
||||
|
||||
private static void markNodesObsolete(final XValueContainerNode<?> node) {
|
||||
|
||||
Reference in New Issue
Block a user