mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-11 18:25:40 +02:00
Bug 374153 - [patch][breakpoints] Show accelerator for toggle breakpoint modifiers in ruler popup menu
Added accelerator mnemonic for CDT actions only.
This commit is contained in:
parent
61f66fecce
commit
309010c452
4 changed files with 130 additions and 14 deletions
|
@ -435,7 +435,7 @@
|
||||||
<action
|
<action
|
||||||
label="%EnableBreakpoint.label"
|
label="%EnableBreakpoint.label"
|
||||||
helpContextId="enable_disable_breakpoint_action_context"
|
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"
|
menubarPath="debug"
|
||||||
id="org.eclipse.cdt.debug.internal.ui.actions.EnableDisableBreakpointRulerActionDelegate">
|
id="org.eclipse.cdt.debug.internal.ui.actions.EnableDisableBreakpointRulerActionDelegate">
|
||||||
</action>
|
</action>
|
||||||
|
@ -444,14 +444,14 @@
|
||||||
helpContextId="add_breakpoint_interactive_action_context"
|
helpContextId="add_breakpoint_interactive_action_context"
|
||||||
class="org.eclipse.cdt.debug.internal.ui.actions.breakpoints.CAddBreakpointInteractiveRulerActionDelegate"
|
class="org.eclipse.cdt.debug.internal.ui.actions.breakpoints.CAddBreakpointInteractiveRulerActionDelegate"
|
||||||
menubarPath="debug"
|
menubarPath="debug"
|
||||||
id="org.eclipse.debug.ui.actions.RulerCreateBreakpointInteractiveAction">
|
id="org.eclipse.cdt.debug.ui.actions.RulerCreateBreakpointInteractiveAction">
|
||||||
</action>
|
</action>
|
||||||
<action
|
<action
|
||||||
label="%AddBreakpoint.label"
|
label="%AddBreakpoint.label"
|
||||||
helpContextId="manage_breakpoint_action_context"
|
helpContextId="manage_breakpoint_action_context"
|
||||||
class="org.eclipse.debug.ui.actions.RulerToggleBreakpointActionDelegate"
|
class="org.eclipse.cdt.debug.internal.ui.actions.breakpoints.CRulerToggleBreakpointActionDelegate"
|
||||||
menubarPath="debug"
|
menubarPath="debug"
|
||||||
id="org.eclipse.debug.ui.actions.RulerToggleBreakpointAction">
|
id="org.eclipse.cdt.debug.ui.actions.RulerToggleBreakpointAction">
|
||||||
</action>
|
</action>
|
||||||
</viewerContribution>
|
</viewerContribution>
|
||||||
<viewerContribution
|
<viewerContribution
|
||||||
|
@ -508,28 +508,28 @@
|
||||||
helpContextId="breakpoint_properties_action_context"
|
helpContextId="breakpoint_properties_action_context"
|
||||||
class="org.eclipse.cdt.debug.internal.ui.actions.breakpoints.CBreakpointPropertiesRulerActionDelegate"
|
class="org.eclipse.cdt.debug.internal.ui.actions.breakpoints.CBreakpointPropertiesRulerActionDelegate"
|
||||||
menubarPath="debug"
|
menubarPath="debug"
|
||||||
id="org.eclipse.cdt.debug.internal.ui.actions.CBreakpointPropertiesRulerActionDelegate">
|
id="org.eclipse.cdt.debug.internal.ui.actions.asm.CBreakpointPropertiesRulerActionDelegate">
|
||||||
</action>
|
</action>
|
||||||
<action
|
<action
|
||||||
label="%EnableBreakpoint.label"
|
label="%EnableBreakpoint.label"
|
||||||
helpContextId="enable_disable_breakpoint_action_context"
|
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"
|
menubarPath="debug"
|
||||||
id="org.eclipse.cdt.debug.internal.ui.actions.EnableDisableBreakpointRulerActionDelegate">
|
id="org.eclipse.cdt.debug.internal.ui.actions.asm.EnableDisableBreakpointRulerActionDelegate">
|
||||||
</action>
|
</action>
|
||||||
<action
|
<action
|
||||||
label="%AddBreakpointInteractive.label"
|
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"
|
class="org.eclipse.cdt.debug.internal.ui.actions.breakpoints.CAddBreakpointInteractiveRulerActionDelegate"
|
||||||
menubarPath="debug"
|
menubarPath="debug"
|
||||||
id="org.eclipse.debug.ui.actions.RulerCreateBreakpointInteractiveAction">
|
id="org.eclipse.cdt.debug.ui.actions.asm.RulerCreateBreakpointInteractiveAction">
|
||||||
</action>
|
</action>
|
||||||
<action
|
<action
|
||||||
label="%AddBreakpoint.label"
|
label="%AddBreakpoint.label"
|
||||||
helpContextId="manage_breakpoint_action_context"
|
helpContextId="manage_breakpoint_action_context"
|
||||||
class="org.eclipse.debug.ui.actions.RulerToggleBreakpointActionDelegate"
|
class="org.eclipse.cdt.debug.internal.ui.actions.breakpoints.CRulerToggleBreakpointActionDelegate"
|
||||||
menubarPath="debug"
|
menubarPath="debug"
|
||||||
id="org.eclipse.debug.ui.actions.RulerToggleBreakpointAction">
|
id="org.eclipse.cdt.debug.ui.actions.asm.RulerToggleBreakpointAction">
|
||||||
</action>
|
</action>
|
||||||
</viewerContribution>
|
</viewerContribution>
|
||||||
<viewerContribution
|
<viewerContribution
|
||||||
|
|
|
@ -132,6 +132,4 @@ RetargetResumeAtLineAction.0=The operation is unavailable on the current selecti
|
||||||
CAddBreakpointInteractiveRulerAction_label=&Add Breakpoint...\tCtrl+Double Click
|
CAddBreakpointInteractiveRulerAction_label=&Add Breakpoint...\tCtrl+Double Click
|
||||||
CAddBreakpointInteractiveRulerAction_error_title=Error
|
CAddBreakpointInteractiveRulerAction_error_title=Error
|
||||||
CAddBreakpointInteractiveRulerAction_error_message=Unable to create breakpoint
|
CAddBreakpointInteractiveRulerAction_error_message=Unable to create breakpoint
|
||||||
CBreakpointToggleRulerAction_error_label=Toggle Brea&kpoint\tDouble Click
|
CRulerToggleBreakpointActionDelegate_label=Toggle Brea&kpoint\tDouble Click
|
||||||
CBreakpointToggleRulerAction_error_title=Error
|
|
||||||
CBreakpointToggleRulerAction_error_message=Unable to toggle breakpoint
|
|
||||||
|
|
|
@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue