Java 类org.eclipse.jface.action.ToolBarContributionItem 实例源码

项目:PDFReporter-Studio    文件:CommonToolbarHandler.java   
/**
 * 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);
        }
    }
}
项目:xstreamer    文件:BrowserActionBarAdvisor.java   
@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);
}
项目:PDFReporter-Studio    文件:CommonToolbarHandler.java   
/**
 * 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);
        }
    }
}
项目:translationstudio8    文件:ApplicationWorkbenchWindowAdvisor.java   
/**
 * 删除 RCP 自带的工具栏按钮
 */
public void postWindowCreate() {
    IActionBarConfigurer actionBarConfigurer = getWindowConfigurer().getActionBarConfigurer();
    IContributionItem[] coolItems = actionBarConfigurer.getCoolBarManager().getItems();
    for (int i = 0; i < coolItems.length; i++) {
        if (coolItems[i] instanceof ToolBarContributionItem) {
            ToolBarContributionItem toolbarItem = (ToolBarContributionItem) coolItems[i];
            if (toolbarItem.getId().equals("org.eclipse.ui.WorkingSetActionSet")
                    || toolbarItem.getId().equals("org.eclipse.ui.edit.text.actionSet.annotationNavigation")
                    || toolbarItem.getId().equals("org.eclipse.ui.edit.text.actionSet.navigation")) {
                toolbarItem.getToolBarManager().removeAll();
            }
        }
    }
    actionBarConfigurer.getCoolBarManager().update(true);

    addAutoPluginMenu();

}
项目:tmxeditor8    文件:ApplicationWorkbenchWindowAdvisor.java   
/**
 * 删除 RCP 自带的工具栏按钮
 */
public void postWindowCreate() {
    IActionBarConfigurer actionBarConfigurer = getWindowConfigurer().getActionBarConfigurer();
    IContributionItem[] coolItems = actionBarConfigurer.getCoolBarManager().getItems();
    for (int i = 0; i < coolItems.length; i++) {
        if (coolItems[i] instanceof ToolBarContributionItem) {
            ToolBarContributionItem toolbarItem = (ToolBarContributionItem) coolItems[i];
            if (toolbarItem.getId().equals("org.eclipse.ui.WorkingSetActionSet")
                    || toolbarItem.getId().equals("org.eclipse.ui.edit.text.actionSet.annotationNavigation")
                    || toolbarItem.getId().equals("org.eclipse.ui.edit.text.actionSet.navigation")) {
                toolbarItem.getToolBarManager().removeAll();
            }
        }
    }
    actionBarConfigurer.getCoolBarManager().update(true);

    addAutoPluginMenu();

}
项目:logan    文件:LoganActionBarAdvisor.java   
@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));
}
项目:neoscada    文件:ApplicationActionBarAdvisor.java   
@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 ) );
}
项目:Hydrograph    文件:WorkbenchWidgetsUtils.java   
/**
 * Returns tool-bar instance of given id
 * @param toolBarId
 *      toolBar -  Id
 * @return
 *      toolBar with given toolBar-id 
 */ 
public ToolBarContributionItem getToolBarMangerOrMenuManagerFromCoolBar(String toolBarId) {
    IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    IContributionItem[] contributionItems = ((WorkbenchWindow) workbenchWindow).getActionBars().getCoolBarManager()
            .getItems();
    for (IContributionItem contributionItem : contributionItems) {
        if (contributionItem instanceof ToolBarContributionItem
                && StringUtils.equals(contributionItem.getId(), toolBarId)) {
            return (ToolBarContributionItem) contributionItem;
        }
    }
    return null;
}
项目:Hydrograph    文件:WorkbenchWidgetsUtils.java   
/**
 * Returns tool-item of tool-bar
 * 
 * @param toolBarId
 * @param toolItemId
 * @return
 *      ToolItem of given id.
 */
public ToolItem getToolItemFromToolBarManger(String toolBarId, String toolItemId) {
    ToolBarContributionItem toolBarContributionItem = getToolBarMangerOrMenuManagerFromCoolBar(toolBarId);
    if (toolBarContributionItem != null && toolBarContributionItem.getToolBarManager() != null) {
        for (IContributionItem contributionItem : toolBarContributionItem.getToolBarManager().getItems()) {
            if (contributionItem instanceof HandledContributionItem
                    && StringUtils.equals(toolItemId, contributionItem.getId())) {
                ToolItem item = (ToolItem) ((HandledContributionItem) contributionItem).getWidget();
                return item;
            }
        }
    }
    return null;
}
项目:Hydrograph    文件:ApplicationActionBarAdvisor.java   
@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));

  }
项目:yamcs-studio    文件:YamcsStudioActionBarAdvisor.java   
@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));
}
项目:PDFReporter-Studio    文件:CommonToolbarHandler.java   
/**
 * Check if a control for the toolbar is already inside the passed toolbar. The presence is verified
 * using the element id
 * 
 * @param toolbar toolbar where the element is searched
 * @param itemToCheck the searched element
 * @return true if an element with the same id of itemToCheck is already present in toolbar, otherwise false
 */
private static boolean isElementPresentInToolbar(ToolBarContributionItem toolbar, CommonToolbarHandler itemToCheck){
    for(IContributionItem item : toolbar.getToolBarManager().getItems()){
        if (item.getId().equals(itemToCheck.getId())) {
            if (!item.getClass().equals(itemToCheck.getClass())){
                toolbar.getToolBarManager().remove(item);
                item.dispose();
                return false;
            }
            return true;
        }
    }
    return false;
}
项目:PDFReporter-Studio    文件:CommonToolbarHandler.java   
/**
 * 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);
        }
    }
}
项目:OpenSPIFe    文件:EnsembleActionBarAdvisor.java   
/**
 * 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"));
}
项目:OpenSPIFe    文件:EnsembleActionBarAdvisor.java   
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);
}
项目:OpenSPIFe    文件:EnsembleActionBarAdvisor.java   
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);
}
项目:OpenSPIFe    文件:EnsembleWorkbenchWindowAdvisor.java   
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);
    }
}
项目:tmxeditor8    文件:ApplicationActionBarAdvisor.java   
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;
    }
项目:VisualCenter    文件:ApplicationActionBarAdvisor.java   
@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"));
}
项目:olca-app    文件:RcpActionBarAdvisor.java   
@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);
}
项目:afbb-bibo    文件:ApplicationActionBarAdvisor.java   
@Override
protected void fillCoolBar(final ICoolBarManager coolBar) {
    final IToolBarManager toolbar = new ToolBarManager(SWT.FLAT | SWT.RIGHT);
    coolBar.add(new ToolBarContributionItem(toolbar, ID_COOLBAR));
}
项目:mytourbook    文件:ApplicationActionBarAdvisor.java   
@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);
}
项目:translationstudio8    文件:ApplicationActionBarAdvisor.java   
private IToolBarManager createToolItem(ICoolBarManager coolBar) {
    IToolBarManager toolBar = new ToolBarManager(coolBar.getStyle());
    coolBar.add(new ToolBarContributionItem(toolBar, "findreplace"));
    toolBar.add(findAction);
    return toolBar;
}
项目:EclipseBrandingExample    文件:ApplicationActionBarAdvisor.java   
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);
}
项目:tmxeditor8    文件:ApplicationActionBarAdvisor.java   
private IToolBarManager createToolItem(ICoolBarManager coolBar) {
    IToolBarManager toolBar = new ToolBarManager(coolBar.getStyle());
    coolBar.add(new ToolBarContributionItem(toolBar, "findreplace"));
    toolBar.add(findAction);
    return toolBar;
}
项目:birt    文件:DesignerActionBarAdvisor.java   
/**
     * 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 ) );
        }

    }
项目:freeVM    文件:ApplicationActionBarAdvisor.java   
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);
}
项目:hestia-engine-dev    文件:ApplicationActionBarAdvisor.java   
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);
}
项目:redmine.rap    文件:ApplicationActionBarAdvisor.java   
@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);




    }