diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmTextEditor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmTextEditor.java index 101292ec703..8bd4dc68232 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmTextEditor.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/asm/AsmTextEditor.java @@ -12,12 +12,18 @@ package org.eclipse.cdt.internal.ui.editor.asm; +import org.eclipse.jface.action.GroupMarker; +import org.eclipse.jface.action.IMenuManager; +import org.eclipse.jface.action.Separator; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.util.PropertyChangeEvent; import org.eclipse.ui.editors.text.TextEditor; +import org.eclipse.ui.navigator.ICommonMenuConstants; import org.eclipse.cdt.ui.CUIPlugin; +import org.eclipse.cdt.internal.ui.IContextMenuConstants; + /** * Assembly text editor @@ -38,7 +44,7 @@ public class AsmTextEditor extends TextEditor { setSourceViewerConfiguration(new AsmSourceViewerConfiguration(textTools, store)); setDocumentProvider(CUIPlugin.getDefault().getDocumentProvider()); // FIXME: Should this editor have a different preference store ? - // For now we are sharing with the CEditor and any changes will in the + // For now we are sharing with the CEditor and any changes in the // setting of the CEditor will be reflected in this editor. setPreferenceStore(store); setEditorContextMenuId("#ASMEditorContext"); //$NON-NLS-1$ @@ -51,8 +57,6 @@ public class AsmTextEditor extends TextEditor { * Pulled in from 2.0 */ protected boolean affectsTextPresentation(PropertyChangeEvent event) { - // String p= event.getProperty(); - boolean affects= false; AsmTextTools textTools= CUIPlugin.getDefault().getAsmTextTools(); affects |= textTools.affectsBehavior(event); @@ -60,4 +64,16 @@ public class AsmTextEditor extends TextEditor { return affects ? affects : super.affectsTextPresentation(event); } + /* + * @see org.eclipse.ui.editors.text.TextEditor#editorContextMenuAboutToShow(org.eclipse.jface.action.IMenuManager) + */ + protected void editorContextMenuAboutToShow(IMenuManager menu) { + // marker for contributions to the top + menu.add(new GroupMarker(ICommonMenuConstants.GROUP_TOP)); + // separator for debug related actions (similar to ruler context menu) + menu.add(new Separator(IContextMenuConstants.GROUP_DEBUG)); + menu.add(new GroupMarker(IContextMenuConstants.GROUP_DEBUG+".end")); //$NON-NLS-1$ + + super.editorContextMenuAboutToShow(menu); + } }