List of usage examples for org.eclipse.jface.action IToolBarManager removeAll
void removeAll();
From source file:org.eclipse.incquery.viewers.tooling.ui.views.ViewersSandboxView.java
License:Open Source License
private void fillToolBar(IViewerSandboxTab tab) { if (tab != null) { IToolBarManager mgr = getViewSite().getActionBars().getToolBarManager(); mgr.removeAll(); for (IContributionItem item : getToolbarContributions(tab)) { if (item instanceof MenuManager) { for (IContributionItem _item : ((MenuManager) item).getItems()) { mgr.add(_item);//from w ww. ja v a 2 s . com } } else { mgr.add(item); } } mgr.update(true); IMenuManager mmgr = getViewSite().getActionBars().getMenuManager(); mmgr.removeAll(); for (IContributionItem item : getDropdownMenuContributions(tab)) { mmgr.add(item); } mmgr.updateAll(true); getViewSite().getActionBars().updateActionBars(); } }
From source file:org.eclipse.osee.ats.editor.SMAMembersTab.java
License:Open Source License
private void refreshToolbar() { IToolBarManager toolBarMgr = scrolledForm.getToolBarManager(); toolBarMgr.removeAll(); toolBarMgr.add(new OpenNewAtsWorldEditorSelectedAction(worldComposite)); toolBarMgr.add(getWorldXViewer().getCustomizeAction()); toolBarMgr.add(new Separator()); toolBarMgr.add(new ExpandAllAction(worldComposite.getXViewer())); toolBarMgr.add(new CollapseAllAction(worldComposite.getXViewer())); toolBarMgr.add(new RefreshAction(worldComposite)); scrolledForm.updateToolBar();//from www . jav a 2 s . c o m }
From source file:org.eclipse.osee.ats.editor.SMAWorkFlowTab.java
License:Open Source License
private void refreshToolbar() throws OseeCoreException { IToolBarManager toolBarMgr = managedForm.getForm().getToolBarManager(); toolBarMgr.removeAll(); if (awa.isTeamWorkflow() && (AtsClientService.get().getBranchService() .isCommittedBranchExists(((TeamWorkFlowArtifact) awa)) || AtsClientService.get().getBranchService().isWorkingBranchInWork(((TeamWorkFlowArtifact) awa)))) { toolBarMgr.add(new ShowMergeManagerAction((TeamWorkFlowArtifact) awa)); toolBarMgr.add(new ShowChangeReportAction((TeamWorkFlowArtifact) awa)); }//from w w w .j av a 2 s.c o m toolBarMgr.add(new FavoriteAction(editor)); if (awa.getParentAWA() != null) { toolBarMgr.add(new OpenParentAction(awa)); } toolBarMgr.add(new EmailActionAction(editor)); toolBarMgr.add(new AddNoteAction(awa, editor)); toolBarMgr.add(new OpenInAtsWorldAction(awa)); toolBarMgr.add(new OpenActionViewAction()); if (AtsUtilClient.isAtsAdmin()) { toolBarMgr.add(new OpenInArtifactEditorAction(editor)); } toolBarMgr.add(new OpenVersionArtifactAction(awa)); if (awa instanceof TeamWorkFlowArtifact) { toolBarMgr.add(new OpenTeamDefinitionAction((TeamWorkFlowArtifact) awa)); } toolBarMgr.add(new CopyActionDetailsAction(awa)); toolBarMgr.add(new PrivilegedEditAction(awa, editor)); toolBarMgr.add(new ResourceHistoryAction(awa)); toolBarMgr.add(new ReloadAction(awa)); managedForm.getForm().updateToolBar(); }
From source file:org.eclipse.osee.framework.ui.skynet.artifact.editor.pages.ArtifactFormPage.java
License:Open Source License
private void addToolBar(FormToolkit toolkit, ScrolledForm form, boolean add) { IToolBarManager manager = form.getToolBarManager(); if (add) {//from w w w. jav a 2 s . c o m manager.add(new RefreshAction()); manager.add(new Separator()); getEditor().getActionBarContributor().contributeToToolBar(manager); manager.update(true); } else { manager.removeAll(); } form.reflow(true); }
From source file:org.eclipse.osee.framework.ui.skynet.blam.BlamOverviewPage.java
License:Open Source License
private void addToolBar(FormToolkit toolkit, ScrolledForm form, boolean add) { IToolBarManager manager = form.getToolBarManager(); if (add) {// w w w .j ava2s . c om getEditor().getActionBarContributor().contributeToToolBar(manager); manager.update(true); } else { manager.removeAll(); } form.reflow(true); }
From source file:org.eclipse.osee.framework.ui.skynet.change.view.ChangeReportPage.java
License:Open Source License
private void addToolBar(FormToolkit toolkit, ScrolledForm form, boolean add) { IToolBarManager manager = form.getToolBarManager(); if (add) {/*from ww w. j av a 2s.c o m*/ getEditor().getActionBarContributor().contributeToToolBar(manager); manager.add(changeReportTable.getXViewer().getCustomizeAction()); manager.update(true); } else { manager.removeAll(); } form.reflow(true); }
From source file:org.eclipse.search.ui.text.AbstractTextSearchViewPage.java
License:Open Source License
private void createViewer(Composite parent, int layout) { if ((layout & FLAG_LAYOUT_FLAT) != 0) { TableViewer viewer = createTableViewer(parent); fViewer = viewer;//from w ww. j a v a 2 s . co m configureTableViewer(viewer); } else if ((layout & FLAG_LAYOUT_TREE) != 0) { TreeViewer viewer = createTreeViewer(parent); fViewer = viewer; configureTreeViewer(viewer); fCollapseAllAction.setViewer(viewer); fExpandAllAction.setViewer(viewer); } fCopyToClipboardAction.setViewer(fViewer); fSelectAllAction.setViewer(fViewer); IToolBarManager tbm = getSite().getActionBars().getToolBarManager(); tbm.removeAll(); SearchView.createToolBarGroups(tbm); fillToolbar(tbm); tbm.update(false); new OpenAndLinkWithEditorHelper(fViewer) { protected void activate(ISelection selection) { final int currentMode = OpenStrategy.getOpenMethod(); try { OpenStrategy.setOpenMethod(OpenStrategy.DOUBLE_CLICK); handleOpen(new OpenEvent(fViewer, selection)); } finally { OpenStrategy.setOpenMethod(currentMode); } } protected void linkToEditor(ISelection selection) { // not supported by this part } protected void open(ISelection selection, boolean activate) { handleOpen(new OpenEvent(fViewer, selection)); } }; fViewer.addSelectionChangedListener(new ISelectionChangedListener() { public void selectionChanged(SelectionChangedEvent event) { fCurrentMatchIndex = -1; fRemoveSelectedMatches.setEnabled(canRemoveMatchesWith(event.getSelection())); } }); fViewer.addSelectionChangedListener(fViewerAdapter); Menu menu = fMenu.createContextMenu(fViewer.getControl()); fViewer.getControl().setMenu(menu); updateLayoutActions(); getViewPart().updateLabel(); }
From source file:org.eclipse.team.svn.ui.lock.LocksView.java
License:Open Source License
protected void createActionBars() { //drop-down menu IActionBars actionBars = this.getViewSite().getActionBars(); IMenuManager actionBarsMenu = actionBars.getMenuManager(); this.linkWithEditorDropDownAction = new Action(SVNUIMessages.SVNView_LinkWith_Label, Action.AS_CHECK_BOX) { public void run() { LocksView.this.linkWithEditor(); LocksView.this.linkWithEditorAction.setChecked(LocksView.this.isLinkWithEditorEnabled); }/*from w w w . j a v a 2 s.co m*/ }; this.linkWithEditorDropDownAction.setChecked(this.isLinkWithEditorEnabled); actionBarsMenu.add(this.linkWithEditorDropDownAction); IToolBarManager tbm = actionBars.getToolBarManager(); tbm.removeAll(); Action action = new Action(SVNUIMessages.SVNView_Refresh_Label) { public void run() { LocksView.this.refresh(); } }; action.setImageDescriptor(SVNTeamUIPlugin.instance().getImageDescriptor("icons/common/refresh.gif")); //$NON-NLS-1$ tbm.add(action); tbm.add(this.getLinkWithEditorAction()); tbm.update(true); this.getSite().getPage().addSelectionListener(this.selectionListener); }
From source file:org.eclipse.team.svn.ui.properties.PropertiesView.java
License:Open Source License
public void createPartControl(Composite parent) { super.createPartControl(parent); IPreferenceStore store = SVNTeamUIPlugin.instance().getPreferenceStore(); this.isLinkWithEditorEnabled = SVNTeamPreferences.getPropertiesBoolean(store, SVNTeamPreferences.PROPERTY_LINK_WITH_EDITOR_NAME); this.propertiesComposite = new PropertiesComposite(parent); this.propertiesComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); this.propertiesComposite.setPropertiesView(this); this.refresh(); //drop-down menu IActionBars actionBars = this.getViewSite().getActionBars(); IMenuManager actionBarsMenu = actionBars.getMenuManager(); this.linkWithEditorDropDownAction = new Action(SVNUIMessages.SVNView_LinkWith_Label, Action.AS_CHECK_BOX) { public void run() { PropertiesView.this.linkWithEditor(); PropertiesView.this.linkWithEditorAction.setChecked(PropertiesView.this.isLinkWithEditorEnabled); }/*w ww . j av a 2 s .c om*/ }; this.linkWithEditorDropDownAction.setChecked(this.isLinkWithEditorEnabled); actionBarsMenu.add(this.linkWithEditorDropDownAction); IToolBarManager tbm = actionBars.getToolBarManager(); tbm.removeAll(); Action action = new Action(SVNUIMessages.SVNView_Refresh_Label) { public void run() { PropertiesView.this.refreshAction(); } }; action.setImageDescriptor(SVNTeamUIPlugin.instance().getImageDescriptor("icons/common/refresh.gif")); //$NON-NLS-1$ tbm.add(action); tbm.add(this.getLinkWithEditorAction()); tbm.update(true); this.getSite().getPage().addSelectionListener(this.selectionListener); //Setting context help PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, "org.eclipse.team.svn.help.propertiesViewContext"); //$NON-NLS-1$ }
From source file:org.eclipse.team.svn.ui.properties.RevPropertiesView.java
License:Open Source License
public void createPartControl(Composite parent) { IToolBarManager tbm = this.getViewSite().getActionBars().getToolBarManager(); tbm.removeAll(); Action action = new Action(SVNUIMessages.SVNView_Refresh_Label) { public void run() { RevPropertiesView.this.refreshView(); }// w ww . j av a 2 s. com }; action.setImageDescriptor(SVNTeamUIPlugin.instance().getImageDescriptor("icons/common/refresh.gif")); //$NON-NLS-1$ tbm.add(action); tbm.update(true); this.revPropComposite = new RevisionPropertiesComposite(parent); this.refreshView(); //Setting context help PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, "org.eclipse.team.svn.help.revPropertiesViewContext"); //$NON-NLS-1$ }