diff --git a/java/debugger/impl/src/com/intellij/debugger/actions/DebuggerActions.java b/java/debugger/impl/src/com/intellij/debugger/actions/DebuggerActions.java index 2a2ae16f9c61..6b5eadf8ff34 100644 --- a/java/debugger/impl/src/com/intellij/debugger/actions/DebuggerActions.java +++ b/java/debugger/impl/src/com/intellij/debugger/actions/DebuggerActions.java @@ -38,6 +38,7 @@ public interface DebuggerActions extends XDebuggerActions { @NonNls String NEW_WATCH = "Debugger.NewWatch"; @NonNls String EDIT_WATCH = "Debugger.EditWatch"; @NonNls String MARK_OBJECT = "Debugger.MarkObject"; + @NonNls String COPY_VALUE = "Debugger.CopyValue"; @NonNls String SET_VALUE = "Debugger.SetValue"; @NonNls String EDIT_FRAME_SOURCE = "Debugger.EditFrameSource"; @NonNls String EDIT_NODE_SOURCE = "Debugger.EditNodeSource"; diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/impl/InspectPanel.java b/java/debugger/impl/src/com/intellij/debugger/ui/impl/InspectPanel.java index 5ebe1cbe28c4..4fc5a4d92453 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/impl/InspectPanel.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/impl/InspectPanel.java @@ -27,6 +27,7 @@ import com.intellij.debugger.ui.impl.watch.DebuggerTree; import com.intellij.debugger.ui.impl.watch.NodeDescriptorImpl; import com.intellij.openapi.Disposable; import com.intellij.openapi.actionSystem.ActionPopupMenu; +import com.intellij.openapi.actionSystem.CommonShortcuts; import com.intellij.openapi.project.Project; import com.intellij.ui.ScrollPaneFactory; import org.jetbrains.annotations.NotNull; @@ -40,8 +41,9 @@ public class InspectPanel extends DebuggerTreePanel { getInspectTree().setInspectDescriptor(inspectDescriptor); add(ScrollPaneFactory.createScrollPane(getInspectTree()), BorderLayout.CENTER); - final Disposable disposable = DebuggerAction.installEditAction(getInspectTree(), DebuggerActions.EDIT_NODE_SOURCE); - registerDisposable(disposable); + registerDisposable(DebuggerAction.installEditAction(getInspectTree(), DebuggerActions.EDIT_NODE_SOURCE)); + + overrideShortcut(getInspectTree(), DebuggerActions.COPY_VALUE, CommonShortcuts.getCopy()); setUpdateEnabled(true); } diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/impl/UpdatableDebuggerView.java b/java/debugger/impl/src/com/intellij/debugger/ui/impl/UpdatableDebuggerView.java index df266f486f19..a7319092470c 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/impl/UpdatableDebuggerView.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/impl/UpdatableDebuggerView.java @@ -24,6 +24,7 @@ import com.intellij.openapi.Disposable; import com.intellij.openapi.actionSystem.ActionManager; import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.CustomShortcutSet; +import com.intellij.openapi.actionSystem.ShortcutSet; import com.intellij.openapi.project.Project; import com.intellij.util.Alarm; import com.sun.jdi.VMDisconnectedException; @@ -124,7 +125,7 @@ public abstract class UpdatableDebuggerView extends JPanel implements DebuggerVi myDisposables.clear(); } - protected void overrideShortcut(final JComponent forComponent, final String actionId, final CustomShortcutSet shortcutSet) { + protected void overrideShortcut(final JComponent forComponent, final String actionId, final ShortcutSet shortcutSet) { final AnAction action = ActionManager.getInstance().getAction(actionId); action.registerCustomShortcutSet(shortcutSet, forComponent); registerDisposable(new Disposable() { diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/impl/VariablesPanel.java b/java/debugger/impl/src/com/intellij/debugger/ui/impl/VariablesPanel.java index 08f65ac0a10b..7dd4cd58eda6 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/impl/VariablesPanel.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/impl/VariablesPanel.java @@ -43,6 +43,7 @@ public class VariablesPanel extends DebuggerTreePanel implements DataProvider{ add(ScrollPaneFactory.createScrollPane(frameTree), BorderLayout.CENTER); registerDisposable(DebuggerAction.installEditAction(frameTree, DebuggerActions.EDIT_NODE_SOURCE)); + overrideShortcut(frameTree, DebuggerActions.COPY_VALUE, CommonShortcuts.getCopy()); overrideShortcut(frameTree, DebuggerActions.SET_VALUE, new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_F2, 0))); new ValueNodeDnD(myTree, parent); diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/impl/WatchPanel.java b/java/debugger/impl/src/com/intellij/debugger/ui/impl/WatchPanel.java index a961cdf15a47..2889e65f37df 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/impl/WatchPanel.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/impl/WatchPanel.java @@ -30,6 +30,7 @@ import com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeImpl; import com.intellij.debugger.ui.impl.watch.WatchItemDescriptor; import com.intellij.openapi.Disposable; import com.intellij.openapi.actionSystem.ActionPopupMenu; +import com.intellij.openapi.actionSystem.CommonShortcuts; import com.intellij.openapi.actionSystem.PlatformDataKeys; import com.intellij.openapi.project.Project; import com.intellij.ui.ScrollPaneFactory; @@ -44,8 +45,8 @@ public abstract class WatchPanel extends DebuggerTreePanel { public WatchPanel(Project project, DebuggerStateManager stateManager) { super(project, stateManager); add(ScrollPaneFactory.createScrollPane(getWatchTree()), BorderLayout.CENTER); - final Disposable disposable = DebuggerAction.installEditAction(getWatchTree(), DebuggerActions.EDIT_NODE_SOURCE); - registerDisposable(disposable); + registerDisposable(DebuggerAction.installEditAction(getWatchTree(), DebuggerActions.EDIT_NODE_SOURCE)); + overrideShortcut(getWatchTree(), DebuggerActions.COPY_VALUE, CommonShortcuts.getCopy()); } protected DebuggerTree createTreeView() { diff --git a/platform/platform-api/src/com/intellij/openapi/actionSystem/CommonShortcuts.java b/platform/platform-api/src/com/intellij/openapi/actionSystem/CommonShortcuts.java index 115fa90883b9..a01c28d4d235 100644 --- a/platform/platform-api/src/com/intellij/openapi/actionSystem/CommonShortcuts.java +++ b/platform/platform-api/src/com/intellij/openapi/actionSystem/CommonShortcuts.java @@ -39,6 +39,10 @@ public class CommonShortcuts { public static final ShortcutSet DOUBLE_CLICK_1 = new CustomShortcutSet(new Shortcut[]{new MouseShortcut(MouseEvent.BUTTON1, 0, 2)}); + public static ShortcutSet getCopy() { + return new CustomShortcutSet(KeymapManager.getInstance().getActiveKeymap().getShortcuts(IdeActions.ACTION_COPY)); + } + public static ShortcutSet getRerun() { return new CustomShortcutSet(KeymapManager.getInstance().getActiveKeymap().getShortcuts(IdeActions.ACTION_RERUN)); } diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/XDebuggerActions.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/XDebuggerActions.java index ce1621ff2213..0a6926167058 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/XDebuggerActions.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/XDebuggerActions.java @@ -51,6 +51,7 @@ public interface XDebuggerActions { @NonNls String XREMOVE_WATCH = "XDebugger.RemoveWatch"; @NonNls String XEDIT_WATCH = "XDebugger.EditWatch"; + @NonNls String COPY_VALUE = "XDebugger.CopyValue"; @NonNls String SET_VALUE = "XDebugger.SetValue"; @NonNls String MUTE_BREAKPOINTS = "XDebugger.MuteBreakpoints"; diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/XDebuggerTreePanel.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/XDebuggerTreePanel.java index 5b47aaf607fc..e3318e620a1a 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/XDebuggerTreePanel.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/XDebuggerTreePanel.java @@ -59,10 +59,10 @@ public class XDebuggerTreePanel implements DnDSource { popupMenu.getComponent().show(comp, x, y); } }; - AnAction setValueAction = actionManager.getAction(XDebuggerActions.SET_VALUE); - setValueAction.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_F2, 0)), myTree); - AnAction jumpToSourceAction = actionManager.getAction(XDebuggerActions.JUMP_TO_SOURCE); - jumpToSourceAction.registerCustomShortcutSet(CommonShortcuts.getEditSource(), myTree); + actionManager.getAction(XDebuggerActions.SET_VALUE).registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke(KeyEvent.VK_F2, 0)), myTree); + actionManager.getAction(XDebuggerActions.COPY_VALUE).registerCustomShortcutSet(CommonShortcuts.getCopy(), myTree); + actionManager.getAction(XDebuggerActions.JUMP_TO_SOURCE).registerCustomShortcutSet(CommonShortcuts.getEditSource(), myTree); + myTree.addMouseListener(myPopupHandler); }