diff options
author | Mike Rennie | 2012-05-01 02:24:08 +0000 |
---|---|---|
committer | Mike Rennie | 2012-05-01 17:11:35 +0000 |
commit | e848def81cee4873d827120b9c4068c3f101b353 (patch) | |
tree | 8273c1183976b96b490a626764749f38299ed0bd | |
parent | fae6ff74493e33acdb1cabc06338970ec76cf6df (diff) | |
download | eclipse.platform.debug-e848def81cee4873d827120b9c4068c3f101b353.tar.gz eclipse.platform.debug-e848def81cee4873d827120b9c4068c3f101b353.tar.xz eclipse.platform.debug-e848def81cee4873d827120b9c4068c3f101b353.zip |
Bug 378008 - Toggle breakpoint modifier string is not shown on Macv20120501-1711I20120520-2100I20120520-1900I20120519-2100I20120519-1900I20120518-2345I20120518-2145I20120518-1730I20120518-1530I20120517-1915I20120516-2100I20120516-1900I20120515-2300I20120515-2200I20120515-2145I20120515-2100I20120515-1900I20120514-2100I20120514-1900I20120513-2100I20120513-1900I20120513-1300I20120513-0740I20120512-2100I20120512-1940I20120512-1900I20120511-2330I20120511-2100I20120511-1900I20120510-2100I20120510-1900I20120509-2100I20120509-1900I20120503-1800I20120503-1500I20120502-2000I20120502-1800I20120502-1500I20120502-1300I20120502-1000I20120502-0800
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); } } |