Skip to main content
summaryrefslogtreecommitdiffstats
path: root/debug
diff options
context:
space:
mode:
authorPawel Piech2012-12-13 00:13:52 -0500
committerPawel Piech2012-12-14 00:11:28 -0500
commit7ef969fe79ba93b41e60ebf4e96ffbed57be3b3f (patch)
tree1d86a51b57b1cb8f4107913b2ce20260563ed5ae /debug
parentc2605537bc1c5046d539829aba24c8ac14fa5777 (diff)
downloadorg.eclipse.cdt-7ef969fe79ba93b41e60ebf4e96ffbed57be3b3f.tar.gz
org.eclipse.cdt-7ef969fe79ba93b41e60ebf4e96ffbed57be3b3f.tar.xz
org.eclipse.cdt-7ef969fe79ba93b41e60ebf4e96ffbed57be3b3f.zip
Bug 396466 - [breakpoints] warnings in log related to toggle breakpoint actions
Diffstat (limited to 'debug')
-rw-r--r--debug/org.eclipse.cdt.debug.ui/plugin.properties6
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugUIUtils.java17
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ActionMessages.properties9
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/CAddBreakpointInteractiveRulerAction.java5
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/CBreakpointPropertiesRulerAction.java5
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/EnableDisableBreakpointRulerAction.java14
6 files changed, 44 insertions, 12 deletions
diff --git a/debug/org.eclipse.cdt.debug.ui/plugin.properties b/debug/org.eclipse.cdt.debug.ui/plugin.properties
index f2df720999..34cbb7d2d3 100644
--- a/debug/org.eclipse.cdt.debug.ui/plugin.properties
+++ b/debug/org.eclipse.cdt.debug.ui/plugin.properties
@@ -38,10 +38,10 @@ ShowDebuggerConsoleAction.label=Show Debugger Console
ShowDebuggerConsoleAction.tooltip=Show Debugger Console On Target Selection
AddBreakpoint.label=Toggle Brea&kpoint
-AddBreakpointInteractive.label=&Add Breakpoint...\tCtrl+Double Click
-EnableBreakpoint.label=&Toggle Breakpoint Enabled\tShift+Double Click
+AddBreakpointInteractive.label=&Add Breakpoint...
+EnableBreakpoint.label=&Toggle Breakpoint Enabled
BreakpointProperties.label=Breakpoint P&roperties...
-RulerBreakpointProperties.label=Breakpoint P&roperties...\tCtrl+Double Click
+RulerBreakpointProperties.label=Breakpoint P&roperties...
BreakpointPropertiesCommand.name=C/C++ Breakpoint Properties
BreakpointPropertiesCommand.description=View and edit properties for a given C/C++ breakpoint
ManageFunctionBreakpointAction.label=Toggle Breakpoint
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugUIUtils.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugUIUtils.java
index 473330f68a..58f0ce164f 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugUIUtils.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugUIUtils.java
@@ -39,6 +39,7 @@ import org.eclipse.debug.core.model.IVariable;
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.debug.ui.contexts.IDebugContextListener;
import org.eclipse.debug.ui.contexts.IDebugContextProvider;
+import org.eclipse.jface.bindings.keys.KeyStroke;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
@@ -338,4 +339,20 @@ public class CDebugUIUtils {
propertiesAction.run();
propertiesAction.dispose();
}
+
+ /**
+ * 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 8.1
+ */
+ 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;
+ }
+
}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ActionMessages.properties b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ActionMessages.properties
index b805821863..6be1401ba9 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ActionMessages.properties
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ActionMessages.properties
@@ -37,14 +37,14 @@ ToggleBreakpointAdapter.Missing_document_2=Missing document
ToggleBreakpointAdapter.Missing_resource_2=Missing resource
ToggleBreakpointAdapter.Invalid_expression_1=Invalid expression:
RunToLineAdapter.Operation_is_not_supported_1=Operation is not supported.
-EnableDisableBreakpointRulerAction.Enable_Breakpoint_1=&Enable Breakpoint\tShift+Double Click
+EnableDisableBreakpointRulerAction.Enable_Breakpoint_1=&Enable Breakpoint
EnableDisableBreakpointRulerAction.Enabling_disabling_breakpoints_1=Enabling/disabling breakpoints
EnableDisableBreakpointRulerAction.Exceptions_occurred_enabling_or_disabling_breakpoint_1=Exceptions occurred enabling or disabling the breakpoint
-EnableDisableBreakpointRulerAction.Disable_Breakpoint_1=&Disable Breakpoint\tShift+Double Click
+EnableDisableBreakpointRulerAction.Disable_Breakpoint_1=&Disable Breakpoint
ToggleWatchpointActionDelegate.Operation_failed_1=Operation failed.
ToggleBreakpointRulerAction.Error_1=Error
ToggleBreakpointRulerAction.Operation_failed_1=Operation failed
-CBreakpointPropertiesRulerAction.Breakpoint_Properties=Breakpoint &Properties...\tCtrl+Double Click
+CBreakpointPropertiesRulerAction.Breakpoint_Properties=Breakpoint &Properties...
CBreakpointPropertiesRulerAction.Error=Unable to edit breakpoint properties.
ResumeAtLineActionDelegate.Error_1=Error
ResumeAtLineActionDelegate.1=Error
@@ -129,7 +129,8 @@ RetargetAction.0=Error
RetargetAction.1=Operation failed
RetargetMoveToLineAction.0=The operation is unavailable on the current selection. Please place the cursor on valid line to run to.
RetargetResumeAtLineAction.0=The operation is unavailable on the current selection. Please place the cursor on valid line to run to.
-CAddBreakpointInteractiveRulerAction_label=&Add Breakpoint...\tCtrl+Double Click
+CAddBreakpointInteractiveRulerAction_label=&Add Breakpoint...
CAddBreakpointInteractiveRulerAction_error_title=Error
CAddBreakpointInteractiveRulerAction_error_message=Unable to create breakpoint
CRulerToggleBreakpointActionDelegate_label=Toggle Brea&kpoint
+CRulerToggleBreakpointAction_accelerator=Double Click
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/CAddBreakpointInteractiveRulerAction.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/CAddBreakpointInteractiveRulerAction.java
index a7923b204c..672d73ece3 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/CAddBreakpointInteractiveRulerAction.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/CAddBreakpointInteractiveRulerAction.java
@@ -11,6 +11,7 @@
*******************************************************************************/
package org.eclipse.cdt.debug.internal.ui.actions.breakpoints;
+import org.eclipse.cdt.debug.internal.ui.CDebugUIUtils;
import org.eclipse.cdt.debug.internal.ui.actions.ActionMessages;
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
import org.eclipse.cdt.debug.ui.breakpoints.IToggleBreakpointsTargetCExtension;
@@ -30,6 +31,7 @@ import org.eclipse.jface.text.TextSelection;
import org.eclipse.jface.text.source.IVerticalRulerInfo;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.swt.SWT;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.texteditor.IDocumentProvider;
import org.eclipse.ui.texteditor.ITextEditor;
@@ -68,7 +70,8 @@ public class CAddBreakpointInteractiveRulerAction extends Action implements IUpd
* @param rulerInfo specifies location the user has double-clicked
*/
public CAddBreakpointInteractiveRulerAction(IWorkbenchPart part, IDocument document, IVerticalRulerInfo rulerInfo) {
- super(ActionMessages.getString("CAddBreakpointInteractiveRulerAction_label")); //$NON-NLS-1$
+ super(ActionMessages.getString("CAddBreakpointInteractiveRulerAction_label") + "\t" + //$NON-NLS-1$ //$NON-NLS-2$
+ CDebugUIUtils.formatKeyBindingString(SWT.MOD1, ActionMessages.getString("CRulerToggleBreakpointAction_accelerator")) ); //$NON-NLS-1$
fPart = part;
fDocument = document;
fRulerInfo = rulerInfo;
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/CBreakpointPropertiesRulerAction.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/CBreakpointPropertiesRulerAction.java
index 49f5b40c95..38a0efb84c 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/CBreakpointPropertiesRulerAction.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/CBreakpointPropertiesRulerAction.java
@@ -12,6 +12,7 @@
package org.eclipse.cdt.debug.internal.ui.actions.breakpoints;
import org.eclipse.cdt.debug.core.model.ICBreakpoint;
+import org.eclipse.cdt.debug.internal.ui.CDebugUIUtils;
import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds;
import org.eclipse.cdt.debug.internal.ui.IInternalCDebugUIConstants;
import org.eclipse.cdt.debug.internal.ui.actions.ActionMessages;
@@ -25,6 +26,7 @@ import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.SWT;
import org.eclipse.ui.IWorkbenchPart;
/**
@@ -40,7 +42,8 @@ public class CBreakpointPropertiesRulerAction extends AbstractBreakpointRulerAct
*/
public CBreakpointPropertiesRulerAction( IWorkbenchPart part, IVerticalRulerInfo info ) {
super( part, info );
- setText( ActionMessages.getString( "CBreakpointPropertiesRulerAction.Breakpoint_Properties" ) ); //$NON-NLS-1$
+ setText( ActionMessages.getString( "CBreakpointPropertiesRulerAction.Breakpoint_Properties" ) + "\t" + //$NON-NLS-1$ //$NON-NLS-2$
+ CDebugUIUtils.formatKeyBindingString(SWT.MOD1, ActionMessages.getString("CRulerToggleBreakpointAction_accelerator")) ); //$NON-NLS-1$
part.getSite().getWorkbenchWindow().getWorkbench().getHelpSystem().setHelp( this, ICDebugHelpContextIds.BREAKPOINT_PROPERTIES_ACTION );
setId( IInternalCDebugUIConstants.ACTION_BREAKPOINT_PROPERTIES );
}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/EnableDisableBreakpointRulerAction.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/EnableDisableBreakpointRulerAction.java
index 586020c4fa..ac94116652 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/EnableDisableBreakpointRulerAction.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/EnableDisableBreakpointRulerAction.java
@@ -11,6 +11,7 @@
*******************************************************************************/
package org.eclipse.cdt.debug.internal.ui.actions.breakpoints;
+import org.eclipse.cdt.debug.internal.ui.CDebugUIUtils;
import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds;
import org.eclipse.cdt.debug.internal.ui.IInternalCDebugUIConstants;
import org.eclipse.cdt.debug.internal.ui.actions.ActionMessages;
@@ -19,6 +20,7 @@ import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.model.IBreakpoint;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.text.source.IVerticalRulerInfo;
+import org.eclipse.swt.SWT;
import org.eclipse.ui.IWorkbenchPart;
public class EnableDisableBreakpointRulerAction extends AbstractBreakpointRulerAction {
@@ -30,7 +32,8 @@ public class EnableDisableBreakpointRulerAction extends AbstractBreakpointRulerA
*/
public EnableDisableBreakpointRulerAction( IWorkbenchPart part, IVerticalRulerInfo info ) {
super( part, info );
- setText( ActionMessages.getString( "EnableDisableBreakpointRulerAction.Enable_Breakpoint_1" ) ); //$NON-NLS-1$
+ setText( ActionMessages.getString( "EnableDisableBreakpointRulerAction.Enable_Breakpoint_1" ) + "\t" + //$NON-NLS-1$ //$NON-NLS-2$
+ CDebugUIUtils.formatKeyBindingString(SWT.MOD2, ActionMessages.getString("CRulerToggleBreakpointAction_accelerator")) ); //$NON-NLS-1$
part.getSite().getWorkbenchWindow().getWorkbench().getHelpSystem().setHelp( this, ICDebugHelpContextIds.ENABLE_DISABLE_BREAKPOINT_ACTION );
setId( IInternalCDebugUIConstants.ACTION_ENABLE_DISABLE_BREAKPOINT );
}
@@ -61,8 +64,13 @@ public class EnableDisableBreakpointRulerAction extends AbstractBreakpointRulerA
setEnabled( fBreakpoint != null );
if ( isEnabled() ) {
try {
- boolean enabled = getBreakpoint().isEnabled();
- setText( enabled ? ActionMessages.getString( "EnableDisableBreakpointRulerAction.Disable_Breakpoint_1" ) : ActionMessages.getString( "EnableDisableBreakpointRulerAction.Enable_Breakpoint_1" ) ); //$NON-NLS-1$ //$NON-NLS-2$
+ if (getBreakpoint().isEnabled()) {
+ setText( ActionMessages.getString("EnableDisableBreakpointRulerAction.Disable_Breakpoint_1") + "\t" + //$NON-NLS-1$ //$NON-NLS-2$
+ CDebugUIUtils.formatKeyBindingString(SWT.MOD2, ActionMessages.getString("CRulerToggleBreakpointAction_accelerator")) ); //$NON-NLS-1$
+ } else {
+ setText( ActionMessages.getString("EnableDisableBreakpointRulerAction.Enable_Breakpoint_1") + "\t" + //$NON-NLS-1$ //$NON-NLS-2$
+ CDebugUIUtils.formatKeyBindingString(SWT.MOD2, ActionMessages.getString("CRulerToggleBreakpointAction_accelerator")) ); //$NON-NLS-1$
+ }
}
catch( CoreException e ) {
DebugPlugin.log( e );

Back to the top