List of usage examples for org.eclipse.jface.action IMenuManager removeAll
void removeAll();
From source file:com.android.ide.eclipse.adt.internal.editors.layout.gle2.LayoutCanvas.java
License:Open Source License
/** * Invoked by {@link #createContextMenu()} to create our *static* context menu once. * <p/>// ww w.j av a 2s. c om * The content of the menu itself does not change. However the state of the * various items is controlled by their associated actions. * <p/> * For cut/copy/paste/delete/select-all, we explicitly reuse the actions * created by {@link #setupGlobalActionHandlers()}, so this method must be * invoked after that one. */ private void setupStaticMenuActions(IMenuManager manager) { manager.removeAll(); manager.add(new SelectionManager.SelectionMenu(getGraphicalEditor())); manager.add(new Separator()); manager.add(mCutAction); manager.add(mCopyAction); manager.add(mPasteAction); manager.add(new Separator()); manager.add(mDeleteAction); manager.add(new Separator()); manager.add(new PlayAnimationMenu(this)); manager.add(new ExportScreenshotAction(this)); manager.add(new Separator()); // Group "Show Included In" and "Show In" together manager.add(new ShowWithinMenu(mEditorDelegate)); // Create a "Show In" sub-menu and automatically populate it using standard // actions contributed by the workbench. String showInLabel = IDEWorkbenchMessages.Workbench_showIn; MenuManager showInSubMenu = new MenuManager(showInLabel); showInSubMenu.add(ContributionItemFactory.VIEWS_SHOW_IN .create(mEditorDelegate.getEditor().getSite().getWorkbenchWindow())); manager.add(showInSubMenu); }
From source file:com.android.ide.eclipse.auidt.internal.editors.layout.gle2.LayoutCanvas.java
License:Open Source License
/** * Invoked by {@link #createContextMenu()} to create our *static* context menu once. * <p/>/*from ww w . j av a2 s. c o m*/ * The content of the menu itself does not change. However the state of the * various items is controlled by their associated actions. * <p/> * For cut/copy/paste/delete/select-all, we explicitly reuse the actions * created by {@link #setupGlobalActionHandlers()}, so this method must be * invoked after that one. */ private void setupStaticMenuActions(IMenuManager manager) { manager.removeAll(); manager.add(new SelectionManager.SelectionMenu(mEditorDelegate.getGraphicalEditor())); manager.add(new Separator()); manager.add(mCutAction); manager.add(mCopyAction); manager.add(mPasteAction); manager.add(new Separator()); manager.add(mDeleteAction); manager.add(new Separator()); manager.add(new PlayAnimationMenu(this)); manager.add(new ExportScreenshotAction(this)); manager.add(new Separator()); // Group "Show Included In" and "Show In" together manager.add(new ShowWithinMenu(mEditorDelegate)); // Create a "Show In" sub-menu and automatically populate it using standard // actions contributed by the workbench. String showInLabel = IDEWorkbenchMessages.Workbench_showIn; MenuManager showInSubMenu = new MenuManager(showInLabel); showInSubMenu.add(ContributionItemFactory.VIEWS_SHOW_IN .create(mEditorDelegate.getEditor().getSite().getWorkbenchWindow())); manager.add(showInSubMenu); }
From source file:com.android.ide.eclipse.ddms.views.DeviceView.java
License:Apache License
/** * Place the actions in the ui./* w ww . ja v a2s .co m*/ */ private final void placeActions() { IActionBars actionBars = getViewSite().getActionBars(); // first in the menu IMenuManager menuManager = actionBars.getMenuManager(); menuManager.removeAll(); menuManager.add(mDebugAction); menuManager.add(new Separator()); menuManager.add(mUpdateHeapAction); menuManager.add(mHprofAction); menuManager.add(mGcAction); menuManager.add(new Separator()); menuManager.add(mUpdateThreadAction); menuManager.add(mTracingAction); menuManager.add(new Separator()); menuManager.add(mKillAppAction); menuManager.add(new Separator()); menuManager.add(mCaptureAction); menuManager.add(new Separator()); menuManager.add(mViewUiAutomatorHierarchyAction); menuManager.add(new Separator()); menuManager.add(mSystraceAction); menuManager.add(new Separator()); menuManager.add(mResetAdbAction); for (IClientAction a : DdmsPlugin.getDefault().getClientSpecificActions()) { menuManager.add(a.getAction()); } // and then in the toolbar IToolBarManager toolBarManager = actionBars.getToolBarManager(); toolBarManager.removeAll(); toolBarManager.add(mDebugAction); toolBarManager.add(new Separator()); toolBarManager.add(mUpdateHeapAction); toolBarManager.add(mHprofAction); toolBarManager.add(mGcAction); toolBarManager.add(new Separator()); toolBarManager.add(mUpdateThreadAction); toolBarManager.add(mTracingAction); toolBarManager.add(new Separator()); toolBarManager.add(mKillAppAction); toolBarManager.add(new Separator()); toolBarManager.add(mCaptureAction); toolBarManager.add(new Separator()); toolBarManager.add(mViewUiAutomatorHierarchyAction); toolBarManager.add(new Separator()); toolBarManager.add(mSystraceAction); for (IClientAction a : DdmsPlugin.getDefault().getClientSpecificActions()) { toolBarManager.add(a.getAction()); } }
From source file:com.android.ide.eclipse.hierarchyviewer.views.DeviceSelectorView.java
License:Apache License
private void placeActions(boolean doTreeViewStuff, boolean doPixelPerfectStuff) { IActionBars actionBars = getViewSite().getActionBars(); IMenuManager mm = actionBars.getMenuManager(); mm.removeAll(); mm.add(RefreshWindowsAction.getAction()); IToolBarManager tm = actionBars.getToolBarManager(); tm.removeAll();/*from w w w. ja va2 s . c om*/ tm.add(RefreshWindowsAction.getAction()); if (doTreeViewStuff) { mm.add(LoadViewHierarchyAction.getAction()); tm.add(LoadViewHierarchyAction.getAction()); } if (doPixelPerfectStuff) { mm.add(InspectScreenshotAction.getAction()); tm.add(InspectScreenshotAction.getAction()); } mm.updateAll(true); tm.update(true); actionBars.updateActionBars(); }
From source file:com.android.ide.eclipse.hierarchyviewer.views.LayoutView.java
License:Apache License
public void placeActions() { IActionBars actionBars = getViewSite().getActionBars(); IMenuManager mm = actionBars.getMenuManager(); mm.removeAll(); mm.add(mOnBlackWhiteAction);/*from w w w. ja v a 2 s.c om*/ mm.add(mShowExtrasAction); mm.add(mLoadAllViewsAction); IToolBarManager tm = actionBars.getToolBarManager(); tm.removeAll(); tm.add(mOnBlackWhiteAction); tm.add(mShowExtrasAction); tm.add(mLoadAllViewsAction); }
From source file:com.android.ide.eclipse.hierarchyviewer.views.PixelPerfectLoupeView.java
License:Apache License
private void placeActions() { IActionBars actionBars = getViewSite().getActionBars(); IMenuManager mm = actionBars.getMenuManager(); mm.removeAll(); mm.add(PixelPerfectAutoRefreshAction.getAction()); mm.add(mShowInLoupeAction);//w w w .j a va 2s .c o m IToolBarManager tm = actionBars.getToolBarManager(); tm.removeAll(); tm.add(PixelPerfectAutoRefreshAction.getAction()); tm.add(mShowInLoupeAction); }
From source file:com.android.ide.eclipse.hierarchyviewer.views.PixelPerfectTreeView.java
License:Apache License
private void placeActions() { IActionBars actionBars = getViewSite().getActionBars(); IMenuManager mm = actionBars.getMenuManager(); mm.removeAll(); mm.add(RefreshPixelPerfectTreeAction.getAction()); IToolBarManager tm = actionBars.getToolBarManager(); tm.removeAll();//from ww w. java 2 s . com tm.add(RefreshPixelPerfectTreeAction.getAction()); }
From source file:com.android.ide.eclipse.hierarchyviewer.views.PixelPerfectView.java
License:Apache License
private void placeActions() { IActionBars actionBars = getViewSite().getActionBars(); IMenuManager mm = actionBars.getMenuManager(); mm.removeAll(); mm.add(SavePixelPerfectAction.getAction(getSite().getShell())); mm.add(RefreshPixelPerfectAction.getAction()); mm.add(LoadOverlayAction.getAction(getSite().getShell())); IToolBarManager tm = actionBars.getToolBarManager(); tm.removeAll();/*from w w w . j a va2s. co m*/ tm.add(SavePixelPerfectAction.getAction(getSite().getShell())); tm.add(RefreshPixelPerfectAction.getAction()); tm.add(LoadOverlayAction.getAction(getSite().getShell())); }
From source file:com.android.ide.eclipse.hierarchyviewer.views.TreeViewView.java
License:Apache License
public void placeActions() { IActionBars actionBars = getViewSite().getActionBars(); IMenuManager mm = actionBars.getMenuManager(); mm.removeAll(); mm.add(SaveTreeViewAction.getAction(getSite().getShell())); mm.add(CapturePSDAction.getAction(getSite().getShell())); mm.add(new Separator()); mm.add(RefreshViewAction.getAction()); mm.add(DisplayViewAction.getAction(getSite().getShell())); mm.add(new Separator()); mm.add(InvalidateAction.getAction()); mm.add(RequestLayoutAction.getAction()); mm.add(DumpDisplayListAction.getAction()); mm.add(ProfileNodesAction.getAction()); IToolBarManager tm = actionBars.getToolBarManager(); tm.removeAll();/*from ww w. j a v a2 s.c o m*/ tm.add(SaveTreeViewAction.getAction(getSite().getShell())); tm.add(CapturePSDAction.getAction(getSite().getShell())); tm.add(new Separator()); tm.add(RefreshViewAction.getAction()); tm.add(DisplayViewAction.getAction(getSite().getShell())); tm.add(new Separator()); tm.add(InvalidateAction.getAction()); tm.add(RequestLayoutAction.getAction()); tm.add(DumpDisplayListAction.getAction()); tm.add(ProfileNodesAction.getAction()); }
From source file:com.archimatetool.editor.views.properties.CustomPropertiesView.java
License:Open Source License
@Override public void createPartControl(Composite parent) { super.createPartControl(parent); // Remove the Pin item IMenuManager menuManager = getViewSite().getActionBars().getMenuManager(); menuManager.removeAll(); // for(IContributionItem item : menuManager.getItems()) { // if(item instanceof ActionContributionItem) { // if(((ActionContributionItem)item).getAction() instanceof PinPropertySheetAction) { // menuManager.remove(item); // break; // } // } // }/* w w w. ja v a2 s . c om*/ IToolBarManager toolBarManager = getViewSite().getActionBars().getToolBarManager(); toolBarManager.removeAll(); // for(IContributionItem item : toolBarManager.getItems()) { // if(item instanceof ActionContributionItem) { // if(((ActionContributionItem)item).getAction() instanceof PinPropertySheetAction) { // toolBarManager.remove(item); // break; // } // } // } }