diff options
author | Pawel Piech | 2012-04-04 22:03:28 +0000 |
---|---|---|
committer | Pawel Piech | 2012-04-04 22:04:06 +0000 |
commit | 309010c45281bca4be7aefedacb363457ba04930 (patch) | |
tree | 72a0a257681f409eb0abc51e4989e79aedd770d0 /debug | |
parent | 61f66feccebe3db1379669b8b53914690f4c9394 (diff) | |
download | org.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')
4 files changed, 130 insertions, 14 deletions
diff --git a/debug/org.eclipse.cdt.debug.ui/plugin.xml b/debug/org.eclipse.cdt.debug.ui/plugin.xml index f59d2bf7680..5c018ca4ab7 100644 --- a/debug/org.eclipse.cdt.debug.ui/plugin.xml +++ b/debug/org.eclipse.cdt.debug.ui/plugin.xml @@ -435,7 +435,7 @@ <action label="%EnableBreakpoint.label" helpContextId="enable_disable_breakpoint_action_context" - class="org.eclipse.debug.ui.actions.RulerEnableDisableBreakpointActionDelegate" + class="org.eclipse.cdt.debug.internal.ui.actions.breakpoints.CRulerEnableDisableBreakpointActionDelegate" menubarPath="debug" id="org.eclipse.cdt.debug.internal.ui.actions.EnableDisableBreakpointRulerActionDelegate"> </action> @@ -444,14 +444,14 @@ helpContextId="add_breakpoint_interactive_action_context" class="org.eclipse.cdt.debug.internal.ui.actions.breakpoints.CAddBreakpointInteractiveRulerActionDelegate" menubarPath="debug" - id="org.eclipse.debug.ui.actions.RulerCreateBreakpointInteractiveAction"> + id="org.eclipse.cdt.debug.ui.actions.RulerCreateBreakpointInteractiveAction"> </action> <action label="%AddBreakpoint.label" helpContextId="manage_breakpoint_action_context" - class="org.eclipse.debug.ui.actions.RulerToggleBreakpointActionDelegate" + class="org.eclipse.cdt.debug.internal.ui.actions.breakpoints.CRulerToggleBreakpointActionDelegate" menubarPath="debug" - id="org.eclipse.debug.ui.actions.RulerToggleBreakpointAction"> + id="org.eclipse.cdt.debug.ui.actions.RulerToggleBreakpointAction"> </action> </viewerContribution> <viewerContribution @@ -508,28 +508,28 @@ helpContextId="breakpoint_properties_action_context" class="org.eclipse.cdt.debug.internal.ui.actions.breakpoints.CBreakpointPropertiesRulerActionDelegate" menubarPath="debug" - id="org.eclipse.cdt.debug.internal.ui.actions.CBreakpointPropertiesRulerActionDelegate"> + id="org.eclipse.cdt.debug.internal.ui.actions.asm.CBreakpointPropertiesRulerActionDelegate"> </action> <action label="%EnableBreakpoint.label" helpContextId="enable_disable_breakpoint_action_context" - class="org.eclipse.debug.ui.actions.RulerEnableDisableBreakpointActionDelegate" + class="org.eclipse.cdt.debug.internal.ui.actions.breakpoints.CRulerEnableDisableBreakpointActionDelegate" menubarPath="debug" - id="org.eclipse.cdt.debug.internal.ui.actions.EnableDisableBreakpointRulerActionDelegate"> + id="org.eclipse.cdt.debug.internal.ui.actions.asm.EnableDisableBreakpointRulerActionDelegate"> </action> <action label="%AddBreakpointInteractive.label" - helpContextId="create_breakpoint_interactive_action_context" + helpContextId="add_breakpoint_interactive_action_context" class="org.eclipse.cdt.debug.internal.ui.actions.breakpoints.CAddBreakpointInteractiveRulerActionDelegate" menubarPath="debug" - id="org.eclipse.debug.ui.actions.RulerCreateBreakpointInteractiveAction"> + id="org.eclipse.cdt.debug.ui.actions.asm.RulerCreateBreakpointInteractiveAction"> </action> <action label="%AddBreakpoint.label" helpContextId="manage_breakpoint_action_context" - class="org.eclipse.debug.ui.actions.RulerToggleBreakpointActionDelegate" + class="org.eclipse.cdt.debug.internal.ui.actions.breakpoints.CRulerToggleBreakpointActionDelegate" menubarPath="debug" - id="org.eclipse.debug.ui.actions.RulerToggleBreakpointAction"> + id="org.eclipse.cdt.debug.ui.actions.asm.RulerToggleBreakpointAction"> </action> </viewerContribution> <viewerContribution 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 eb47e4a36bb..445761c6eac 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 00000000000..bca64efccbd --- /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 00000000000..14c16f2c769 --- /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); + } + } +} |