1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Provide the action "show selected element"

This commit is contained in:
Alain Magloire 2004-03-29 02:34:48 +00:00
parent 99f00cebcd
commit 58513148c2
3 changed files with 18 additions and 0 deletions

View file

@ -96,6 +96,8 @@ public class MakefileEditorActionContributor extends BasicTextEditorActionContri
editMenu.add(fOpenDeclarationAction);
}
bars.setGlobalActionHandler(ITextEditorActionDefinitionIds.TOGGLE_SHOW_SELECTED_ELEMENT_ONLY, fTogglePresentation);
IToolBarManager toolBarManager = bars.getToolBarManager();
if (toolBarManager != null) {
toolBarManager.add(new Separator());

View file

@ -1,3 +1,9 @@
2004-03-28 Alain Magloire
Provide a global hook for the action "Show Selected element"
* src/org/eclipse/cdt/internal/ui/editor/CEditorActionContributor.java
2004-03-26 Alain Magloire
Keep the order of the sourceroots when sorting the CElements.

View file

@ -17,10 +17,12 @@ import org.eclipse.jface.text.ITextOperationTarget;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.editors.text.TextEditorActionContributor;
import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
import org.eclipse.ui.texteditor.RetargetTextEditorAction;
import org.eclipse.ui.texteditor.TextEditorAction;
@ -155,6 +157,14 @@ public class CEditorActionContributor extends TextEditorActionContributor {
}
}
/**
* @see org.eclipse.ui.part.EditorActionBarContributor#init(IActionBars)
*/
public void init(IActionBars bars) {
super.init(bars);
bars.setGlobalActionHandler(ITextEditorActionDefinitionIds.TOGGLE_SHOW_SELECTED_ELEMENT_ONLY, fTogglePresentation);
}
/**
* @see EditorActionBarContributor#contributeToToolBar(IToolBarManager)
*/