/** * Remove a list of controls from a subtoolbar inside the manager. the removed controls are disposed, the toolbar * is not removed * * @param cbm The toolbar manager * @param toolbarId the toolbar id where the controls should be * @param itemsToRemove the list of control to remove */ public static void removeToolbarContribution(ICoolBarManager cbm, String toolbarId, List<IContributionItem> itemsToRemove){ IContributionItem ictb = findToolbar(cbm, toolbarId); if (ictb instanceof ToolBarContributionItem) { HashSet<String> itemsToRemoveIds = new HashSet<String>(); for(IContributionItem itemToRemove : itemsToRemove){ itemsToRemoveIds.add(itemToRemove.getId()); } IToolBarManager tbmanager = ((ToolBarContributionItem) ictb).getToolBarManager(); if (tbmanager != null){ for (IContributionItem ci : tbmanager.getItems()) { if (itemsToRemove.isEmpty()) break; if (itemsToRemoveIds.contains(ci.getId())){ tbmanager.remove(ci); ci.dispose(); itemsToRemoveIds.remove(ci.getId()); } } tbmanager.update(true); } } }
@Override protected void fillCoolBar(ICoolBarManager coolBar) { IToolBarManager toolBar = new ToolBarManager(SWT.FLAT | SWT.RIGHT); coolBar.add(new ToolBarContributionItem(toolBar, "standard")); //$NON-NLS-1$ // For the Back and Forward actions, force their text to be shown on the toolbar, // not just their image. For the remaining actions, the ActionContributionItem // is created implicitly with the default presentation mode. ActionContributionItem backCI = new ActionContributionItem(backAction); backCI.setMode(ActionContributionItem.MODE_FORCE_TEXT); toolBar.add(backCI); ActionContributionItem forwardCI = new ActionContributionItem(forwardAction); forwardCI.setMode(ActionContributionItem.MODE_FORCE_TEXT); toolBar.add(forwardCI); toolBar.add(stopAction); toolBar.add(refreshAction); }
/** * Update the pin action's tool bar */ void updatePinActionToolbar() { ICoolBarManager coolBarManager = getActionBarConfigurer() .getCoolBarManager(); IContributionItem cbItem = coolBarManager .find(IWorkbenchActionConstants.TOOLBAR_NAVIGATE); if (!(cbItem instanceof IToolBarContributionItem)) { // This should not happen IDEWorkbenchPlugin .log("Navigation toolbar contribution item is missing"); //$NON-NLS-1$ return; } IToolBarContributionItem toolBarItem = (IToolBarContributionItem) cbItem; IToolBarManager toolBarManager = toolBarItem.getToolBarManager(); if (toolBarManager == null) { // error if this happens, navigation toolbar assumed to always exist IDEWorkbenchPlugin.log("Navigate toolbar is missing"); //$NON-NLS-1$ return; } toolBarManager.update(false); toolBarItem.update(ICoolBarManager.SIZE); }
/** * Add a list of controls to a toolbar * * @param cbm2 the toolbar manager * @param toolBarID the toolbar id where the control will be added * @param elementsToAdd the list of the element to add * @param part the current editor part, that will be stored inside the elements */ private static void addContributionsToCoolbar(ICoolBarManager cbm2, String toolBarID, List<CommonToolbarHandler> elementsToAdd) { //Get toolbar will build a bar with the reuqested if if it isn't already present IContributionItem item = getToolbarContributionItem(cbm2, toolBarID); if (item != null) { ToolBarContributionItem tbitem = (ToolBarContributionItem) item; IToolBarManager tbmanager = tbitem.getToolBarManager(); if (tbitem.getToolBarManager() !=null){ for(CommonToolbarHandler elementToAdd : elementsToAdd){ String id = elementToAdd.getId(); if (id != null && !isElementPresentInToolbar(tbitem, elementToAdd)){ tbmanager.add(elementToAdd); } } tbmanager.update(true); } } }
/** * Update the pin action's tool bar */ void updatePinActionToolbar() { ICoolBarManager coolBarManager = getActionBarConfigurer().getCoolBarManager(); IContributionItem cbItem = coolBarManager.find(IWorkbenchActionConstants.TOOLBAR_NAVIGATE); if (!(cbItem instanceof IToolBarContributionItem)) { // This should not happen IDEWorkbenchPlugin.log("Navigation toolbar contribution item is missing"); //$NON-NLS-1$ return; } IToolBarContributionItem toolBarItem = (IToolBarContributionItem) cbItem; IToolBarManager toolBarManager = toolBarItem.getToolBarManager(); if (toolBarManager == null) { // error if this happens, navigation toolbar assumed to always exist IDEWorkbenchPlugin.log("Navigate toolbar is missing"); //$NON-NLS-1$ return; } toolBarManager.update(false); toolBarItem.update(ICoolBarManager.SIZE); }
@Override protected void fillCoolBar(ICoolBarManager cbManager) { cbManager.add(new GroupMarker("group.file")); //$NON-NLS-1$ { // File Group IToolBarManager fileToolBar = new ToolBarManager(cbManager.getStyle()); fileToolBar.add(new Separator(IWorkbenchActionConstants.NEW_GROUP)); fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.OPEN_EXT)); fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.SAVE_GROUP)); fileToolBar.add(getAction(ActionFactory.SAVE.getId())); // Add to the cool bar manager cbManager.add(new ToolBarContributionItem(fileToolBar, IWorkbenchActionConstants.TOOLBAR_FILE)); } cbManager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); cbManager.add(new GroupMarker(IWorkbenchActionConstants.GROUP_EDITOR)); }
@Override protected void fillCoolBar ( final ICoolBarManager coolBar ) { final IToolBarManager toolbar = new ToolBarManager ( SWT.FLAT | SWT.RIGHT ); coolBar.add ( new ToolBarContributionItem ( toolbar, "main" ) ); toolbar.add ( getAction ( ActionFactory.NEW_WIZARD_DROP_DOWN.getId () ) ); coolBar.add ( new GroupMarker ( IWorkbenchActionConstants.MB_ADDITIONS ) ); }
@Override protected void fillCoolBar(ICoolBarManager coolBar) { super.fillCoolBar(coolBar); IToolBarManager toolbar = new ToolBarManager(SWT.FLAT | SWT.LEFT); coolBar.add(new ToolBarContributionItem(toolbar, HYDROGRAPH_UI_GRAPH_TOOLBAR_ID)); }
@Override protected void fillCoolBar(ICoolBarManager coolbar) { ///coolbar.setLockLayout(true); // Specific to Yamcs Studio IToolBarManager studioBar = new ToolBarManager(); studioBar.add(new CoolItemGroupMarker(COOL_GROUP_PROCESSOR_INFO)); studioBar.add(new CoolItemGroupMarker(COOL_GROUP_BOOKMARK_SHORTCUTS)); studioBar.add(new CoolItemGroupMarker(COOL_GROUP_PROCESSOR_CONTROLS)); studioBar.add(new CoolItemGroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); coolbar.add(new ToolBarContributionItem(studioBar, "studiocoolbar")); // 'File' section of the cool bar IToolBarManager fileBar = new ToolBarManager(); // File 'new' and 'save' actions fileBar.add(ActionFactory.NEW.create(window)); fileBar.add(save); fileBar.add(saveAll); fileBar.add(new CoolItemGroupMarker(IWorkbenchActionConstants.FILE_END)); coolbar.add(new ToolBarContributionItem(fileBar, IWorkbenchActionConstants.M_FILE)); // 'User' section of the cool bar final IToolBarManager user_bar = new ToolBarManager(); coolbar.add(new ToolBarContributionItem(user_bar, TOOLBAR_USER)); // Explicitly add "additions" and "editor" to work around https://bugs.eclipse.org/bugs/show_bug.cgi?id=422651 // After a restart, merging of persisted model, PerspectiveSpacer, contributions resulted in re-arranged toolbar with E4. coolbar.add(new CoolItemGroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); coolbar.add(new CoolItemGroupMarker(IWorkbenchActionConstants.GROUP_EDITOR)); }
@Override protected void fillCoolBar(ICoolBarManager coolBar) { IToolBarManager toolbar = new ToolBarManager(coolBar.getStyle()); toolbar.add(saveAction); toolbar.add(ContributionItemFactory.NEW_WIZARD_SHORTLIST .create(getActionBarConfigurer().getWindowConfigurer().getWindow())); coolBar.add(toolbar); // allow contributions here with id "additions" (MB_ADDITIONS) coolBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); }
/** Remove toolbar and menu entries unrelated to the display builder * @param page {@link IWorkbenchPage} */ public static void hideUnrelatedUI(final IWorkbenchPage page) { // Hide BOY "Top Files" tool bar drop-down page.hideActionSet("org.csstudio.opibuilder.actionSet"); // Hide "Search" (git, file) from tool bar page.hideActionSet("org.eclipse.search.searchActionSet"); if (! (page.getWorkbenchWindow() instanceof WorkbenchWindow)) return; final WorkbenchWindow window = (WorkbenchWindow)page.getWorkbenchWindow(); final ICoolBarManager toolbar = window.getCoolBarManager2(); for (IContributionItem item : toolbar.getItems()) { // System.out.println(item.getId()); if (remove_from_toolbar.contains(item.getId())) { // Result of trial-and-error: // * item.setVisible(false) has no effect // * toolbar.remove(item) results in // Error disposing widget for : org.eclipse.e4.ui.model.application.ui.menu.impl.ToolBarImpl // java.lang.NullPointerException // at org.eclipse.e4.ui.workbench.renderers.swt.ToolBarManagerRenderer.cleanUpCopy(ToolBarManagerRenderer.java:554) // at org.eclipse.e4.ui.workbench.renderers.swt.ToolBarManagerRenderer.cleanUp(ToolBarManagerRenderer.java:534) // at org.eclipse.e4.ui.workbench.renderers.swt.ToolBarManagerRenderer$4.widgetDisposed(ToolBarManagerRenderer.java:423 // * disposing the item without removing it from the toolbar "works" ?! item.dispose(); } } toolbar.update(true); patchMenu(window); }
/** * Method to call when the selection changes. It will update the current selection and * refresh the toolbar removing the necessary control and adding the missing one. * The method is visible is used to know if a control should be visible or not * * @param activeEditor the active editor where the selection is done * @param selection the new selection * @param bars the current action bars, where the new controls will be placed */ public static void updateSelection(final IEditorPart activeEditor, final IActionBars bars){ //Executed inside a thread to have more responsive ui UIUtils.getDisplay().asyncExec(new Runnable() { @Override public void run() { if (bars instanceof IActionBars2 && ((IActionBars2) bars).getCoolBarManager() instanceof SubCoolBarManager) { ICoolBarManager cbm = (ICoolBarManager) ((SubCoolBarManager) ((IActionBars2) bars).getCoolBarManager()).getParent(); for(ToolItemsSet toolbar : JaspersoftStudioPlugin.getToolItemsManager().getSets()){ //if no item of a toolbar contribution is visible then all the toolbar is removed boolean isToolbarVisible = false; List<CommonToolbarHandler> visibleControls = new ArrayList<CommonToolbarHandler>(); List<IContributionItem> notVisibleControls = new ArrayList<IContributionItem>(); for(IConfigurationElement control : toolbar.getControlsConfiguration()){ CommonToolbarHandler citem = createContributionItem(control); citem.setWorkbenchPart(activeEditor); if (citem.isVisible()){ visibleControls.add(citem); isToolbarVisible = true; } else { notVisibleControls.add(citem); } } if (!isToolbarVisible){ removeToolbar(cbm, toolbar.getId()); } else { removeToolbarContribution(cbm, toolbar.getId(), notVisibleControls); addContributionsToCoolbar(cbm, toolbar.getId(), visibleControls); } } cbm.update(true); bars.updateActionBars(); } } }); }
/** * Search a toolbar with a specified id inside the manager * * @param cbm2 the toolbar manager * @param tbarid the id of the searched toolbar * @return the toolbar if it is found inside the manager, otherwise null */ public static IContributionItem findToolbar(ICoolBarManager cbm2, String tbarid) { for (IContributionItem ci : cbm2.getItems()) { if (ci.getId().equals(tbarid)) return ci; } return null; }
/** * Remove a toolbar from the manager. It dosen't do nothing if the toolbar is not in the manager. * If the toolbar is found before to be removed all the controls inside are disposed. The parent * toolbar of the item is not removed to have it's position preserved if other elements will * be added to it with a following selection. However since it's empty it isn't visible. * This method it is equivalent to removeToolbarContribution with all the content of the toolbar * inside the items to remove list. But since this need to done less control it has better performance * and it is preferred when we just want to remove all the content of the toolbar * * @param cbm2 the toolbar manager * @param tbarid the id of the toolbar to remove */ public static void removeToolbar(ICoolBarManager cbm2, String tbarid) { IContributionItem ictb = findToolbar(cbm2, tbarid); if (ictb instanceof ToolBarContributionItem) { IToolBarManager tbmanager = ((ToolBarContributionItem) ictb).getToolBarManager(); if (tbmanager != null){ //the controls inside the toolbar are disposed for (IContributionItem ci : tbmanager.getItems()) { tbmanager.remove(ci); ci.dispose(); } tbmanager.update(true); } } }
/** * Adds the tool bar below the application menu and contains the undo, redo, and save buttons. */ @Override protected void fillCoolBar(ICoolBarManager coolBar) { ToolBarContributionItem toolBar = createFileToolbar(coolBar); if (toolBar != null) coolBar.add(toolBar); toolBar = createEditToolbar(coolBar); if (toolBar != null) coolBar.add(toolBar); coolBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); coolBar.add(new GroupMarker("testStart")); coolBar.add(new GroupMarker("testEnd")); }
protected ToolBarContributionItem createFileToolbar(ICoolBarManager coolBar) { IToolBarManager toolBar = new ToolBarManager(coolBar.getStyle()); toolBar.add(new GroupMarker(IWorkbenchActionConstants.FILE_START)); toolBar.add(new GroupMarker(IWorkbenchActionConstants.NEW_EXT)); toolBar.add(new GroupMarker(IWorkbenchActionConstants.OPEN_EXT)); toolBar.add(getGlobalAction(ActionFactory.SAVE)); toolBar.add(new GroupMarker(IWorkbenchActionConstants.SAVE_EXT)); toolBar.add(new GroupMarker(IWorkbenchActionConstants.IMPORT_EXT)); toolBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); toolBar.add(new GroupMarker(IWorkbenchActionConstants.FILE_END)); return new ToolBarContributionItem(toolBar, IWorkbenchActionConstants.M_FILE); }
protected ToolBarContributionItem createEditToolbar(ICoolBarManager coolBar) { IToolBarManager toolBar = new ToolBarManager(coolBar.getStyle()); toolBar.add(new GroupMarker(IWorkbenchActionConstants.EDIT_START)); toolBar.add(getGlobalAction(ActionFactory.UNDO)); toolBar.add(getGlobalAction(ActionFactory.REDO)); toolBar.add(new GroupMarker(IWorkbenchActionConstants.UNDO_EXT)); toolBar.add(new GroupMarker(IWorkbenchActionConstants.CUT_EXT)); toolBar.add(new GroupMarker(IWorkbenchActionConstants.ADD_EXT)); toolBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); toolBar.add(new GroupMarker(IWorkbenchActionConstants.EDIT_END)); return new ToolBarContributionItem(toolBar, IWorkbenchActionConstants.M_EDIT); }
protected void cleanupMenusAndCoolBar() { IContributionItem[] mItems, mSubItems; IMenuManager mm = getWindowConfigurer().getActionBarConfigurer().getMenuManager(); mItems = mm.getItems(); for (int i = 0; i < mItems.length; i++) { if (mItems[i] instanceof MenuManager) { mSubItems = ((MenuManager) mItems[i]).getItems(); for (int j = 0; j < mSubItems.length; j++) { if (getItemsToRemove().keySet().contains(mItems[i].getId())) { for (String fileItemToRemove : getItemsToRemove().get(mItems[i].getId())) ((MenuManager)mItems[i]).remove(fileItemToRemove); } } } } if (getItemsToRemove().keySet().contains("file")) { ICoolBarManager cbm = getWindowConfigurer().getActionBarConfigurer().getCoolBarManager(); for (String itemToRemove : getItemsToRemove().get("file")) { for (IContributionItem item : cbm.getItems()) { if (item instanceof ToolBarContributionItem) ((ToolBarContributionItem)item).getToolBarManager().remove(itemToRemove); else cbm.remove(itemToRemove); } } cbm.update(true); } }
protected void fillCoolBar(ICoolBarManager coolBar) { /* coolBar.setLockLayout(false); IToolBarManager toolbar = new ToolBarManager(SWT.FLAT | SWT.RIGHT); coolBar.add(new ToolBarContributionItem(toolbar, "eu.cloudscaleproject.env.product.toolbar.toolchain")); coolBar.update(true); */ }
private IToolBarManager createToolItem(ICoolBarManager coolBar) { IToolBarManager toolBar = new ToolBarManager(coolBar.getStyle()); coolBar.add(new ToolBarContributionItem(toolBar, "findreplace")); //没有设计 24 的图标,所以屏蔽工具栏 // toolBar.add(cutAction); // toolBar.add(copyAction); // toolBar.add(pasteAction); // toolBar.add(findAction); return toolBar; }
protected void fillCoolBar(ICoolBarManager coolBar) { IToolBarManager firstCoolBar = new ToolBarManager(coolBar.getStyle()); coolBar.add(firstCoolBar); firstCoolBar.add(this.newBTAction); firstCoolBar.add(this.saveBTAction); firstCoolBar.add(this.saveBTAsAction); firstCoolBar.add(this.exportAsCppAction); firstCoolBar.add(this.openBTAction); firstCoolBar.add(this.loadMMPMDomainAction); coolBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); }
@Override protected void fillCoolBar(ICoolBarManager coolBar){ IToolBarManager toolBar=new ToolBarManager(SWT.FLAT|SWT.LEFT); toolBar.add(this.newProjectAction); toolBar.add(this.importProjectAction); toolBar.add(this.hostManagerAction); toolBar.add(this.saveAction); toolBar.add(this.saveAllAction); coolBar.add(new ToolBarContributionItem(toolBar,"coolbar.main")); }
@Override protected void fillCoolBar(ICoolBarManager coolBar) { IToolBarManager toolbar = new ToolBarManager(SWT.FLAT | SWT.LEFT); coolBar.add(new ToolBarContributionItem(toolbar, "main")); toolbar.add(new HomeAction()); toolbar.add(saveAction); toolbar.add(saveAsAction); toolbar.add(saveAllAction); coolBar.add(toolbar); }
@Override protected void fillCoolBar(final ICoolBarManager coolBar) { final IToolBarManager toolbar = new ToolBarManager(SWT.FLAT | SWT.RIGHT); coolBar.add(new ToolBarContributionItem(toolbar, ID_COOLBAR)); }
/** * Fills the coolbar with the workbench actions. */ protected void fillCoolBar(ICoolBarManager coolBar) { IActionBarConfigurer2 actionBarConfigurer = (IActionBarConfigurer2) getActionBarConfigurer(); // Set up the context Menu coolbarPopupMenuManager = new MenuManager(); coolBar.setContextMenuManager(coolbarPopupMenuManager); IMenuService menuService = (IMenuService) window.getService(IMenuService.class); menuService.populateContributionManager(coolbarPopupMenuManager, "popup:windowCoolbarContextMenu"); //$NON-NLS-1$ // File Group IToolBarManager fileToolBar = actionBarConfigurer.createToolBarManager(); fileToolBar.add(new Separator(IWorkbenchActionConstants.NEW_GROUP)); fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.NEW_EXT)); fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.SAVE_GROUP)); fileToolBar.add(saveAction); fileToolBar.add(saveAllAction); fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.SAVE_EXT)); fileToolBar.add(getPrintItem()); fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.PRINT_EXT)); fileToolBar.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); // Add to the cool bar manager coolBar.add(actionBarConfigurer.createToolBarContributionItem(fileToolBar, IWorkbenchActionConstants.TOOLBAR_FILE)); coolBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); coolBar.add(new GroupMarker(IWorkbenchActionConstants.GROUP_HELP)); // Help group IToolBarManager helpToolBar = actionBarConfigurer.createToolBarManager(); helpToolBar.add(new Separator(IWorkbenchActionConstants.GROUP_HELP)); // helpToolBar.add(searchComboItem); // Add the group for applications to contribute helpToolBar.add(new GroupMarker(IWorkbenchActionConstants.GROUP_APP)); // Add to the cool bar manager coolBar.add(actionBarConfigurer.createToolBarContributionItem(helpToolBar, IWorkbenchActionConstants.TOOLBAR_HELP)); }
@Override protected void fillCoolBar(final ICoolBarManager coolBar) { { /* * Toolbar: People */ final IToolBarManager tbMgr_People = new ToolBarManager(SWT.FLAT | SWT.RIGHT); tbMgr_People.add(_personContribItem); final ToolBarContributionItem tbItemPeople = new ToolBarContributionItem(tbMgr_People, "people"); //$NON-NLS-1$ coolBar.add(tbItemPeople); } { /* * Toolbar: Tour type */ final IToolBarManager tbMgr_TourType = new ToolBarManager(SWT.FLAT | SWT.RIGHT); final ToolBarContributionItem tbItemTourType = new ToolBarContributionItem(tbMgr_TourType, "tourtype"); //$NON-NLS-1$ coolBar.add(tbItemTourType); tbMgr_TourType.add(_tourTypeContribItem); } { /* * Toolbar: Tour filter */ final IToolBarManager tbMgr_TourFilter = new ToolBarManager(SWT.FLAT | SWT.RIGHT); final ToolBarContributionItem tbItemTourFilter = new ToolBarContributionItem( tbMgr_TourFilter, "mc_tb_AppFilter"); //$NON-NLS-1$ coolBar.add(tbItemTourFilter); tbMgr_TourFilter.add(_actionTourFilter); TourFilterManager.setTourFilterAction(_actionTourFilter); } { /* * Toolbar: Measurement */ final boolean isShowMeasurement = TourbookPlugin .getDefault() .getPreferenceStore() .getBoolean(ITourbookPreferences.MEASUREMENT_SYSTEM_SHOW_IN_UI); if (isShowMeasurement) { final IToolBarManager tbMgr_System = new ToolBarManager(SWT.FLAT | SWT.RIGHT); tbMgr_System.add(_measurementContribItem); final ToolBarContributionItem tbItemMeasurement = new ToolBarContributionItem( tbMgr_System, "measurementSystem"); //$NON-NLS-1$ coolBar.add(tbItemMeasurement); } } // this must be set after the coolbar is created, otherwise it stops populating the coolbar TourTypeFilterManager.setToolBarContribItem(_tourTypeContribItem); }
private IToolBarManager createToolItem(ICoolBarManager coolBar) { IToolBarManager toolBar = new ToolBarManager(coolBar.getStyle()); coolBar.add(new ToolBarContributionItem(toolBar, "findreplace")); toolBar.add(findAction); return toolBar; }
protected void fillCoolBar(ICoolBarManager coolBar) { IToolBarManager toolbar = new ToolBarManager(SWT.FLAT | SWT.RIGHT); coolBar.add(new ToolBarContributionItem(toolbar, "main")); toolbar.add(openViewAction); toolbar.add(messagePopupAction); }
/** * Fills the coolbar with the workbench actions. */ protected void fillCoolBar( ICoolBarManager coolBar ) { { // Set up the context Menu IMenuManager popUpMenu = new MenuManager( ); popUpMenu.add( new ActionContributionItem( lockToolBarAction ) ); coolBar.setContextMenuManager( popUpMenu ); } coolBar.add( new GroupMarker( IWorkbenchActionConstants.GROUP_FILE ) ); { // File Group IToolBarManager fileToolBar = new ToolBarManager( coolBar.getStyle( ) ); fileToolBar.add(new NewWizardDropDownAction( window)); // fileToolBar.add( newReportAction ); // fileToolBar.add( newLibraryAction ); // fileToolBar.add( newReportTemplateAction ); fileToolBar.add( new GroupMarker( IWorkbenchActionConstants.NEW_EXT ) ); fileToolBar.add( new GroupMarker( IWorkbenchActionConstants.SAVE_GROUP ) ); fileToolBar.add( saveAction ); fileToolBar.add( new GroupMarker( IWorkbenchActionConstants.SAVE_EXT ) ); fileToolBar.add( new Separator( IWorkbenchActionConstants.MB_ADDITIONS ) ); // Add to the cool bar manager coolBar.add( new ToolBarContributionItem( fileToolBar, IWorkbenchActionConstants.TOOLBAR_FILE ) ); } coolBar.add( new GroupMarker( IWorkbenchActionConstants.MB_ADDITIONS ) ); // coolBar.add( new GroupMarker( IWorkbenchConstants.GROUP_NAV ) ); { // Navigate group IToolBarManager navToolBar = new ToolBarManager( coolBar.getStyle( ) ); navToolBar.add( new Separator( IWorkbenchActionConstants.HISTORY_GROUP ) ); navToolBar.add( new GroupMarker( IWorkbenchActionConstants.GROUP_APP ) ); navToolBar.add( backwardHistoryAction ); navToolBar.add( forwardHistoryAction ); navToolBar.add( new Separator( IWorkbenchActionConstants.PIN_GROUP ) ); navToolBar.add( pinEditorContributionItem ); // Add to the cool bar manager coolBar.add( new ToolBarContributionItem( navToolBar, IWorkbenchActionConstants.TOOLBAR_NAVIGATE ) ); } coolBar.add( new GroupMarker( IWorkbenchActionConstants.GROUP_EDITOR ) ); coolBar.add( new GroupMarker( IWorkbenchActionConstants.GROUP_HELP ) ); { // Help group IToolBarManager helpToolBar = new ToolBarManager( coolBar.getStyle( ) ); helpToolBar.add( new Separator( IWorkbenchActionConstants.GROUP_HELP ) ); // Add the group for applications to contribute helpToolBar.add( new GroupMarker( IWorkbenchActionConstants.GROUP_APP ) ); // Add to the cool bar manager coolBar.add( new ToolBarContributionItem( helpToolBar, IWorkbenchActionConstants.TOOLBAR_HELP ) ); } }
protected void fillCoolBar(ICoolBarManager coolBar) { IToolBarManager toolbar = new ToolBarManager(SWT.FLAT | SWT.RIGHT); coolBar.add(new ToolBarContributionItem(toolbar, "main")); //toolbar.add(openViewAction); //toolbar.add(messagePopupAction); }
protected void fillCoolBar(ICoolBarManager coolBar) { IToolBarManager toolbar = new ToolBarManager(SWT.FLAT | SWT.RIGHT); coolBar.add(new ToolBarContributionItem(toolbar, "main")); //$NON-NLS-1$ toolbar.add(newConnectionAction); }
@Override protected void fillCoolBar(final ICoolBarManager coolBar) { // IToolBarManager iconsToolBar = new ToolBarManager(SWT.FLAT | SWT.RIGHT); IToolBarManager searchToolBar = new ToolBarManager(SWT.FLAT | SWT.RIGHT); coolBar.add(new ToolBarContributionItem(iconsToolBar, ICONS_TOOLBAR_ID)); // coolBar.add(new ToolBarContributionItem(searchToolBar, SEARCH_TOOLBAR_ID)); // Add actions iconsToolBar.add(dummy1Action); iconsToolBar.add(dummy2Action); iconsToolBar.add(dummy3Action); /* Action dummy4Action = new Action() { }; dummy4Action.setId("org.eclipse.ui.file.save"); iconsToolBar.add(dummy4Action); */ // Add search feature searchToolBar.add(new SearchContribution()); coolBar.add(searchToolBar); }
/** * Returns a new cool bar manager for the window. * <p> * By default this method calls <code>createCoolBarManager</code>. * Subclasses may override this method to provide an alternative * implementation for the cool bar manager. * </p> * * @param style * swt style bits used to create the Coolbar * * @return a cool bar manager * @since 3.2 * @see #createCoolBarManager(int) */ protected ICoolBarManager createCoolBarManager2(int style) { return createCoolBarManager(style); }
/** * Returns the cool bar manager for this window. * * @return the cool bar manager, or <code>null</code> if this window does * not have a cool bar * @see #addCoolBar(int) * @since 3.2 */ public ICoolBarManager getCoolBarManager2() { return coolBarManager; }
/** * Contributes to the given cool bar. * <p> * The <code>EditorActionBarContributor</code> implementation of this method * does nothing. Subclasses may reimplement to add to the cool bar portion * of this contribution. There can only be contributions from a cool bar or * a tool bar. * </p> * * @param coolBarManager * the manager that controls the workbench cool bar. * * @since 3.0 */ public void contributeToCoolBar(ICoolBarManager coolBarManager) { }
/** * Returns the cool bar manager. * <p> * Note: Clients who add or remove items from the returned cool bar manager * are responsible for calling <code>updateActionBars</code> so that the * changes can be propagated throughout the workbench. * </p> * * @return the cool bar manager. */ public ICoolBarManager getCoolBarManager();
/** * Returns a new cool bar manager for the window. * <p> * By default this method calls <code>createCoolBarManager</code>. Subclasses * may override this method to provide an alternative implementation for the * cool bar manager. * </p> * * @param style swt style bits used to create the Coolbar * * @return a cool bar manager * @since 3.2 * @see #createCoolBarManager(int) */ protected ICoolBarManager createCoolBarManager2(int style) { return createCoolBarManager(style); }
/** * Returns the cool bar manager for this window. * * @return the cool bar manager, or <code>null</code> if * this window does not have a cool bar * @see #addCoolBar(int) * @since 3.2 */ public ICoolBarManager getCoolBarManager2() { return coolBarManager; }
protected void fillCoolBar(ICoolBarManager coolBar) { }