Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPawel Piech2012-04-04 18:03:28 -0400
committerPawel Piech2012-04-04 18:04:06 -0400
commit309010c45281bca4be7aefedacb363457ba04930 (patch)
tree72a0a257681f409eb0abc51e4989e79aedd770d0 /debug/org.eclipse.cdt.debug.ui/src/org
parent61f66feccebe3db1379669b8b53914690f4c9394 (diff)
downloadorg.eclipse.cdt-309010c45281bca4be7aefedacb363457ba04930.tar.gz
org.eclipse.cdt-309010c45281bca4be7aefedacb363457ba04930.tar.xz
org.eclipse.cdt-309010c45281bca4be7aefedacb363457ba04930.zip
Bug 374153 - [patch][breakpoints] Show accelerator for toggle breakpoint modifiers in ruler popup menu
Added accelerator mnemonic for CDT actions only.
Diffstat (limited to 'debug/org.eclipse.cdt.debug.ui/src/org')
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ActionMessages.properties4
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/CRulerEnableDisableBreakpointActionDelegate.java34
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/CRulerToggleBreakpointActionDelegate.java84
3 files changed, 119 insertions, 3 deletions
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 eb47e4a36b..445761c6ea 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
@@ -132,6 +132,4 @@ RetargetResumeAtLineAction.0=The operation is unavailable on the current selecti
CAddBreakpointInteractiveRulerAction_label=&Add Breakpoint...\tCtrl+Double Click
CAddBreakpointInteractiveRulerAction_error_title=Error
CAddBreakpointInteractiveRulerAction_error_message=Unable to create breakpoint
-CBreakpointToggleRulerAction_error_label=Toggle Brea&kpoint\tDouble Click
-CBreakpointToggleRulerAction_error_title=Error
-CBreakpointToggleRulerAction_error_message=Unable to toggle breakpoint \ No newline at end of file
+CRulerToggleBreakpointActionDelegate_label=Toggle Brea&kpoint\tDouble Click
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/CRulerEnableDisableBreakpointActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/CRulerEnableDisableBreakpointActionDelegate.java
new file mode 100644
index 0000000000..bca64efccb
--- /dev/null
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/CRulerEnableDisableBreakpointActionDelegate.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2012 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.debug.internal.ui.actions.breakpoints;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.text.source.IVerticalRulerInfo;
+import org.eclipse.ui.texteditor.AbstractRulerActionDelegate;
+import org.eclipse.ui.texteditor.ITextEditor;
+
+/**
+ * This is a copy of the RulerEnableDisableBreakpointActionDelegate in platform.
+ * It updates the toggle action to include an accelertor text in its label.
+ * See bug 374153.
+ *
+ * @see org.eclipse.debug.ui.actions.RulerEnableDisableBreakpointActionDelegate
+ */
+public class CRulerEnableDisableBreakpointActionDelegate extends AbstractRulerActionDelegate {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.texteditor.AbstractRulerActionDelegate#createAction(org.eclipse.ui.texteditor.ITextEditor, org.eclipse.jface.text.source.IVerticalRulerInfo)
+ */
+ protected IAction createAction(ITextEditor editor, IVerticalRulerInfo rulerInfo) {
+ return new EnableDisableBreakpointRulerAction(editor, rulerInfo);
+ }
+
+}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/CRulerToggleBreakpointActionDelegate.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/CRulerToggleBreakpointActionDelegate.java
new file mode 100644
index 0000000000..14c16f2c76
--- /dev/null
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/breakpoints/CRulerToggleBreakpointActionDelegate.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2012 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.cdt.debug.internal.ui.actions.breakpoints;
+
+import org.eclipse.cdt.debug.internal.ui.actions.ActionMessages;
+import org.eclipse.debug.ui.actions.ToggleBreakpointAction;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.text.source.IVerticalRulerInfo;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.ui.IActionDelegate2;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.texteditor.AbstractRulerActionDelegate;
+import org.eclipse.ui.texteditor.ITextEditor;
+
+/**
+ * This is a copy of the RulerToggleBreakpointActionDelegate in platform.
+ * It updates the toggle action to include an accelertor text in its label.
+ * See bug 374153.
+ *
+ * @see org.eclipse.debug.ui.actions.RulerToggleBreakpointActionDelegate
+ */
+public class CRulerToggleBreakpointActionDelegate extends AbstractRulerActionDelegate implements IActionDelegate2 {
+
+ private IEditorPart fEditor = null;
+ private ToggleBreakpointAction fDelegate = null;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.texteditor.AbstractRulerActionDelegate#createAction(org.eclipse.ui.texteditor.ITextEditor, org.eclipse.jface.text.source.IVerticalRulerInfo)
+ */
+ protected IAction createAction(ITextEditor editor, IVerticalRulerInfo rulerInfo) {
+ fDelegate = new ToggleBreakpointAction(editor, null, rulerInfo);
+ fDelegate.setText( ActionMessages.getString("CRulerToggleBreakpointActionDelegate_label") ); //$NON-NLS-1$
+
+ return fDelegate;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IEditorActionDelegate#setActiveEditor(org.eclipse.jface.action.IAction, org.eclipse.ui.IEditorPart)
+ */
+ public void setActiveEditor(IAction callerAction, IEditorPart targetEditor) {
+ if (fEditor != null) {
+ if (fDelegate != null) {
+ fDelegate.dispose();
+ fDelegate = null;
+ }
+ }
+ fEditor = targetEditor;
+ super.setActiveEditor(callerAction, targetEditor);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
+ */
+ public void init(IAction action) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IActionDelegate2#dispose()
+ */
+ public void dispose() {
+ if (fDelegate != null) {
+ fDelegate.dispose();
+ }
+ fDelegate = null;
+ fEditor = null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
+ */
+ public void runWithEvent(IAction action, Event event) {
+ if(fDelegate != null) {
+ fDelegate.runWithEvent(event);
+ }
+ }
+}

Back to the top