diff options
author | Alain Magloire | 2003-10-17 02:34:10 +0000 |
---|---|---|
committer | Alain Magloire | 2003-10-17 02:34:10 +0000 |
commit | 0c011ffdda61e1fca36e3c9ed02b96a50bc2feba (patch) | |
tree | 5284a97e70156d4a405dacd6db618f3ae6636738 | |
parent | 8331d664851fcf1f9be9f0b744fde5f127efeefc (diff) | |
download | org.eclipse.cdt-0c011ffdda61e1fca36e3c9ed02b96a50bc2feba.tar.gz org.eclipse.cdt-0c011ffdda61e1fca36e3c9ed02b96a50bc2feba.tar.xz org.eclipse.cdt-0c011ffdda61e1fca36e3c9ed02b96a50bc2feba.zip |
add comment/uncomment menu.
4 files changed, 77 insertions, 0 deletions
diff --git a/build/org.eclipse.cdt.make.ui/plugin.properties b/build/org.eclipse.cdt.make.ui/plugin.properties index 0b9ce191e7e..edfa9a4e7e0 100644 --- a/build/org.eclipse.cdt.make.ui/plugin.properties +++ b/build/org.eclipse.cdt.make.ui/plugin.properties @@ -30,3 +30,19 @@ ViewMake.name=Make Targets ActionSetMake.label=Make Actions ActionSetUpdateMake.label=Update Make Projects + +# Scope and Key Commands +scope.makefileEditor.name=Makefile Editor +makefileEditor.description=Editor for Makefile Files + +category.source.name=Makefile Source +category.source.description= Makefile Source Actions + +ActionDefinition.comment.name= Comment +ActionDefinition.comment.description= Turn the selected lines into # style comments + +ActionDefinition.uncomment.name= Uncomment +ActionDefinition.uncomment.description= Uncomment the selected # style comment lines + +MakefileEditor.name=Makefile Editor + diff --git a/build/org.eclipse.cdt.make.ui/plugin.xml b/build/org.eclipse.cdt.make.ui/plugin.xml index 7287ba1087d..09eae320c28 100644 --- a/build/org.eclipse.cdt.make.ui/plugin.xml +++ b/build/org.eclipse.cdt.make.ui/plugin.xml @@ -140,6 +140,47 @@ id="org.eclipse.cdt.make.ui.targetCreateCommand"> </command> </extension> + +<!-- Makefile Editor keybindings --> + <extension + point="org.eclipse.ui.commands"> + <category + name="%category.source.name" + description="%category.source.description" + id="org.eclipse.cdt.make.ui.category.source"> + </category> + <scope + name="%scope.makefileEditor.name" + parent="org.eclipse.ui.textEditorScope" + description="%makefileEditor.description" + id="org.eclipse.cdt.make.ui.makefileEditorScope"> + </scope> + <command + name="%ActionDefinition.comment.name" + description="%ActionDefinition.comment.description" + category="org.eclipse.cdt.make.ui.category.source" + id="org.eclipse.cdt.make.ui.edit.text.makefile.comment"> + </command> + <keyBinding + string="Ctrl+/" + scope="org.eclipse.cdt.make.ui.makefileEditorScope" + command="org.eclipse.cdt.make.ui.edit.text.makefile.comment" + configuration="org.eclipse.ui.defaultAcceleratorConfiguration"> + </keyBinding> + <command + name="%ActionDefinition.uncomment.name" + description="%ActionDefinition.uncomment.description" + category="org.eclipse.cdt.make.ui.category.source" + id="org.eclipse.cdt.make.ui.edit.text.makefile.uncomment"> + </command> + <keyBinding + string="Ctrl+\" + scope="org.eclipse.cdt.make.ui.makefileEditorScope" + command="org.eclipse.cdt.make.ui.edit.text.makefile.uncomment" + configuration="org.eclipse.ui.defaultAcceleratorConfiguration"> + </keyBinding> + </extension> + <extension point="org.eclipse.ui.preferencePages"> <page diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeResources.properties b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeResources.properties index 8d442ec2c03..ce3007f2bb6 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeResources.properties +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeResources.properties @@ -84,6 +84,14 @@ TogglePresentation.label=Change Presentation TogglePresentation.tooltip=Enable/Disable Segmented Source Viewer TogglePresentation.description=Enable/Disable Segmented Source Viewer +Comment.label=&Comment +Comment.tooltip=Comment the Selected Lines +Comment.description=Turn the selected lines into # style comments + +Uncomment.label=Uncommen&t +Uncomment.tooltip=Uncomment the Selected # comment Lines +Uncomment.description=Uncomment the selected # comment lines + # ------- LexicalSortingAction------------ LexicalSortingAction.label=Sort diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileEditor.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileEditor.java index 5110ead8203..e16324298e1 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileEditor.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/MakefileEditor.java @@ -19,6 +19,7 @@ import org.eclipse.cdt.make.internal.ui.text.MakefileColorManager; import org.eclipse.cdt.make.internal.ui.text.makefile.MakefileWordDetector; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.jface.action.IAction; +import org.eclipse.jface.action.IMenuManager; import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.ITextOperationTarget; @@ -33,6 +34,7 @@ import org.eclipse.ui.IWorkbenchPart; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.editors.text.TextEditor; import org.eclipse.ui.texteditor.DefaultRangeIndicator; +import org.eclipse.ui.texteditor.ITextEditorActionConstants; import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds; import org.eclipse.ui.texteditor.TextOperationAction; import org.eclipse.ui.views.contentoutline.IContentOutlinePage; @@ -190,4 +192,14 @@ public class MakefileEditor extends TextEditor implements ISelectionChangedListe } } + /* (non-Javadoc) + * @see org.eclipse.ui.texteditor.AbstractTextEditor#editorContextMenuAboutToShow(org.eclipse.jface.action.IMenuManager) + */ + protected void editorContextMenuAboutToShow(IMenuManager menu) { + super.editorContextMenuAboutToShow(menu); + addAction(menu, ITextEditorActionConstants.GROUP_EDIT, "Comment"); //$NON-NLS-1$ + addAction(menu, ITextEditorActionConstants.GROUP_EDIT, "Uncomment"); //$NON-NLS-1$ + + } + } |