Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Rennie2012-04-30 22:24:08 -0400
committerMike Rennie2012-05-01 13:11:35 -0400
commite848def81cee4873d827120b9c4068c3f101b353 (patch)
tree8273c1183976b96b490a626764749f38299ed0bd
parentfae6ff74493e33acdb1cabc06338970ec76cf6df (diff)
downloadeclipse.platform.debug-e848def81cee4873d827120b9c4068c3f101b353.tar.gz
eclipse.platform.debug-e848def81cee4873d827120b9c4068c3f101b353.tar.xz
eclipse.platform.debug-e848def81cee4873d827120b9c4068c3f101b353.zip
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java16
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.properties2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RulerEnableDisableBreakpointAction.java8
3 files changed, 22 insertions, 4 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java
index 33f47b77c..4e6a8d0ad 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java
@@ -78,6 +78,7 @@ import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.debug.ui.IDebugModelPresentation;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.debug.ui.ILaunchGroup;
+import org.eclipse.jface.bindings.keys.KeyStroke;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialogWithToggle;
@@ -964,6 +965,21 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener,
*/
public void launchRemoved(ILaunch launch) {}
+ /**
+ * Formats the given key stroke or click name and the modifier keys
+ * to a key binding string that can be used in action texts.
+ *
+ * @param modifierKeys the modifier keys
+ * @param keyOrClick a key stroke or click, e.g. "Double Click"
+ * @return the formatted keyboard shortcut string, e.g. "Shift+Double Click"
+ *
+ * @since 3.8
+ */
+ public static final String formatKeyBindingString(int modifierKeys, String keyOrClick) {
+ // this should actually all be delegated to KeyStroke class
+ return KeyStroke.getInstance(modifierKeys, KeyStroke.NO_KEY).format() + keyOrClick;
+ }
+
public static boolean DEBUG_TEST_PRESENTATION_ID(IPresentationContext context) {
if (context == null) {
return true;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.properties
index 7a9e3192a..317d81f90 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.properties
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.properties
@@ -162,7 +162,7 @@ RulerEnableDisableBreakpointAction_0=Error
RulerEnableDisableBreakpointAction_1=Failed to toggle breakpoint enablement
RulerEnableDisableBreakpointAction_2=&Disable Breakpoint
RulerEnableDisableBreakpointAction_3=&Enable Breakpoint
-RulerEnableDisableBreakpointAction_4=Shift+Double Click
+RulerEnableDisableBreakpointAction_4=Double Click
TerminateAndRelaunchAction_0=org.eclipse.debug.ui.commands.TerminateAndRelaunch
TerminateAndRelaunchAction_3=Terminate and Relaunch
TerminateAndRelaunchAction_4=Terminate and Relaunch
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RulerEnableDisableBreakpointAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RulerEnableDisableBreakpointAction.java
index fb19c1a25..a37f31e09 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RulerEnableDisableBreakpointAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RulerEnableDisableBreakpointAction.java
@@ -16,6 +16,7 @@ import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.internal.ui.actions.ActionMessages;
import org.eclipse.debug.ui.actions.RulerBreakpointAction;
import org.eclipse.jface.text.source.IVerticalRulerInfo;
+import org.eclipse.swt.SWT;
import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.ui.texteditor.IUpdate;
@@ -50,17 +51,18 @@ public class RulerEnableDisableBreakpointAction extends RulerBreakpointAction im
public void update() {
fBreakpoint = getBreakpoint();
setEnabled(fBreakpoint != null);
+ String accelerator = DebugUIPlugin.formatKeyBindingString(SWT.MOD2, ActionMessages.RulerEnableDisableBreakpointAction_4);
if (fBreakpoint != null) {
try {
if (fBreakpoint.isEnabled()) {
- setText(ActionMessages.RulerEnableDisableBreakpointAction_2 + '\t' + ActionMessages.RulerEnableDisableBreakpointAction_4);
+ setText(ActionMessages.RulerEnableDisableBreakpointAction_2 + '\t' + accelerator);
} else {
- setText(ActionMessages.RulerEnableDisableBreakpointAction_3 + '\t' + ActionMessages.RulerEnableDisableBreakpointAction_4);
+ setText(ActionMessages.RulerEnableDisableBreakpointAction_3 + '\t' + accelerator);
}
} catch (CoreException e) {
}
} else {
- setText(ActionMessages.RulerEnableDisableBreakpointAction_2 + '\t' + ActionMessages.RulerEnableDisableBreakpointAction_4);
+ setText(ActionMessages.RulerEnableDisableBreakpointAction_2 + '\t' + accelerator);
}
}

Back to the top