Example usage for org.eclipse.jface.action IToolBarManager add

List of usage examples for org.eclipse.jface.action IToolBarManager add

Introduction

In this page you can find the example usage for org.eclipse.jface.action IToolBarManager add.

Prototype

void add(IAction action);

Source Link

Document

Adds an action as a contribution item to this manager.

Usage

From source file:com.google.dart.tools.deploy.ApplicationActionBarAdvisor.java

License:Open Source License

/**
 * Fills the coolbar with the workbench actions.
 *///from   w  w w  .j  a  v  a  2  s  . c  om
@Override
protected void fillCoolBar(ICoolBarManager coolBar) {

    IActionBarConfigurer2 actionBarConfigurer = (IActionBarConfigurer2) getActionBarConfigurer();

    //    {
    //      // Set up the context Menu
    //      coolbarPopupMenuManager = new MenuManager();
    //      coolbarPopupMenuManager.add(new ActionContributionItem(lockToolBarAction));
    //      coolBar.setContextMenuManager(coolbarPopupMenuManager);
    //      IMenuService menuService = (IMenuService) window.getService(IMenuService.class);
    //      menuService.populateContributionManager(coolbarPopupMenuManager,
    //          "popup:windowCoolbarContextMenu"); //$NON-NLS-1$
    //    }

    coolBar.add(new GroupMarker(IIDEActionConstants.GROUP_FILE));
    { // File Group
        IToolBarManager fileToolBar = actionBarConfigurer.createToolBarManager();
        fileToolBar.add(newApplicationWizardAction);
        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.GROUP_APP));
        fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.SAVE_EXT));
        fileToolBar.add(new Separator(IWorkbenchActionConstants.BUILD_GROUP));
        fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.BUILD_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(IIDEActionConstants.GROUP_NAV));
    { // Navigate group
        IToolBarManager navToolBar = actionBarConfigurer.createToolBarManager();
        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(actionFactory.getPinEditorItem());

        // Add to the cool bar manager
        coolBar.add(actionBarConfigurer.createToolBarContributionItem(navToolBar,
                IWorkbenchActionConstants.TOOLBAR_NAVIGATE));
    }

    //   coolBar.add(new GroupMarker(IWorkbenchActionConstants.GROUP_EDITOR));

    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));

        helpToolBar.add(dartRunAction);

        // Add to the cool bar manager
        coolBar.add(actionBarConfigurer.createToolBarContributionItem(helpToolBar,
                IWorkbenchActionConstants.TOOLBAR_HELP));
    }
}

From source file:com.google.dart.tools.internal.search.ui.SearchMatchPage.java

License:Open Source License

@Override
public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager,
        IStatusLineManager statusLineManager) {
    toolBarManager.add(filterProjectAction);
    toolBarManager.add(filterSdkAction);
    toolBarManager.add(filterPotentialAction);
    toolBarManager.add(new Separator());
    toolBarManager.add(nextAction);//from  w  w  w.  j  a v a 2s  .  c o  m
    toolBarManager.add(prevAction);
    toolBarManager.add(new Separator());
    toolBarManager.add(removeAction);
    toolBarManager.add(removeAllAction);
    toolBarManager.add(new Separator());
    toolBarManager.add(expandAllAction);
    toolBarManager.add(collapseAllAction);
    toolBarManager.add(new Separator());
    toolBarManager.add(refreshAction);
}

From source file:com.google.dart.tools.internal.search.ui.TextSearchPage.java

License:Open Source License

@Override
public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager,
        IStatusLineManager statusLineManager) {
    toolBarManager.add(new Separator());
    toolBarManager.add(removeAction);/*from  w ww. ja  v  a 2  s .c  o  m*/
    toolBarManager.add(removeAllAction);
    toolBarManager.add(new Separator());
    toolBarManager.add(refreshAction);
}

From source file:com.google.dart.tools.search.internal.ui.SearchMatchPage.java

License:Open Source License

@Override
public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager,
        IStatusLineManager statusLineManager) {
    toolBarManager.add(nextAction);
    toolBarManager.add(prevAction);//from  w  w w .  j av a  2s.  c o  m
    toolBarManager.add(new Separator());
    toolBarManager.add(removeAction);
    toolBarManager.add(removeAllAction);
    toolBarManager.add(new Separator());
    toolBarManager.add(expandAllAction);
    toolBarManager.add(collapseAllAction);
    toolBarManager.add(new Separator());
    toolBarManager.add(refreshAction);
}

From source file:com.google.dart.tools.search2.internal.ui.SearchView.java

License:Open Source License

/**
 * Creates the groups and separators for the search view's tool bar
 * /*from  ww w.j a v a 2  s . co m*/
 * @param toolbar the toolbar
 */
public static void createToolBarGroups(IToolBarManager toolbar) {
    toolbar.add(new Separator(IContextMenuConstants.GROUP_NEW));
    toolbar.add(new GroupMarker(IContextMenuConstants.GROUP_SHOW));
    toolbar.add(new GroupMarker(IContextMenuConstants.GROUP_OPEN));
    toolbar.add(new Separator(IContextMenuConstants.GROUP_BUILD));
    toolbar.add(new Separator(IContextMenuConstants.GROUP_REORGANIZE));
    toolbar.add(new Separator(IContextMenuConstants.GROUP_EDIT));
    toolbar.add(new GroupMarker(IContextMenuConstants.GROUP_REMOVE_MATCHES));
    toolbar.add(new GroupMarker(IContextMenuConstants.GROUP_GENERATE));
    toolbar.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
    toolbar.add(new Separator(IContextMenuConstants.GROUP_VIEWER_SETUP));
    toolbar.add(new Separator(IContextMenuConstants.GROUP_PROPERTIES));
    toolbar.add(new Separator(IContextMenuConstants.GROUP_SEARCH));
}

From source file:com.google.dart.tools.ui.actions.MemberFilterActionGroup.java

License:Open Source License

/**
 * Adds the filter actions to the given tool bar
 * /*from   w  ww .j a va  2s.co  m*/
 * @param tbm the tool bar to which the actions are added
 */
public void contributeToToolBar(IToolBarManager tbm) {
    if (fInViewMenu) {
        return;
    }
    for (int i = 0; i < fFilterActions.length; i++) {
        tbm.add(fFilterActions[i]);
    }
}

From source file:com.google.dart.tools.ui.callhierarchy.CallHierarchyViewPart.java

License:Open Source License

private void fillActionBars() {
    IActionBars actionBars = getActionBars();
    actionBars.setGlobalActionHandler(ActionFactory.REFRESH.getId(), refreshSingleElementAction);
    actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), removeFromViewAction);

    IToolBarManager toolBar = actionBars.getToolBarManager();
    actionGroups.fillActionBars(actionBars);

    toolBar.add(refreshViewAction);
    toolBar.add(cancelSearchAction);//ww w . ja v  a2  s.  c o  m
    for (int i = 0; i < toggleCallModeActions.length; i++) {
        toolBar.add(toggleCallModeActions[i]);
    }
    toolBar.add(historyDropDownAction);
    toolBar.add(pinViewAction);
}

From source file:com.google.dart.tools.ui.console.DartConsoleView.java

License:Open Source License

@Override
public void createPartControl(Composite parent) {
    this.parent = parent;

    IToolBarManager toolbar = getViewSite().getActionBars().getToolBarManager();
    clearAction = new ClearAction();
    toolbar.add(clearAction);
    toolbar.add(new Separator());
    terminateAction = new TerminateAction();
    toolbar.add(terminateAction);/*from  w w  w.ja  va2  s  . com*/
    toolbar.add(new Separator("outputGroup"));
    getViewSite().getActionBars().updateActionBars();

    display = Display.getCurrent();

    JFaceResources.getFontRegistry().addListener(fontPropertyChangeListener);
}

From source file:com.google.dart.tools.ui.internal.appsview.AppsView.java

License:Open Source License

protected void fillInToolbar(IToolBarManager toolbar) {
    // Link with Editor
    linkWithEditorAction = new LinkAppsViewWithEditorAction(getViewSite().getPage(), treeViewer);

    if (memento != null && memento.getBoolean(LINK_WITH_EDITOR_ID) != null) {
        linkWithEditorAction.setLinkWithEditor(memento.getBoolean(LINK_WITH_EDITOR_ID).booleanValue());
    } else {/*from  w ww  . j  av  a2s. co  m*/
        linkWithEditorAction.setLinkWithEditor(true);
    }

    // Collapse All
    toolbar.add(new CollapseAllAction(treeViewer));
    toolbar.add(linkWithEditorAction);
}

From source file:com.google.dart.tools.ui.internal.filesview.FilesView.java

License:Open Source License

protected void fillInToolbar(IToolBarManager toolbar) {
    // Link with Editor

    linkWithEditorAction = new LinkWithEditorAction(getViewSite().getPage(), treeViewer);

    if (memento != null && memento.getBoolean(LINK_WITH_EDITOR_ID) != null) {
        linkWithEditorAction.setLinkWithEditor(memento.getBoolean(LINK_WITH_EDITOR_ID).booleanValue());
    } else {//  w  w  w  . j  a  v a  2 s.  c  om
        linkWithEditorAction.setLinkWithEditor(true);
    }

    // Collapse All

    toolbar.add(new CollapseAllAction(treeViewer));
    toolbar.add(linkWithEditorAction);
}