Example usage for org.eclipse.jface.action GroupMarker GroupMarker

List of usage examples for org.eclipse.jface.action GroupMarker GroupMarker

Introduction

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

Prototype

public GroupMarker(String groupName) 

Source Link

Document

Create a new group marker with the given name.

Usage

From source file:bilab.BilabActionBarAdvisor.java

License:Open Source License

private MenuManager createEditMenu() {
    final MenuManager menu = new MenuManager("&Edit", IWorkbenchActionConstants.M_EDIT);
    menu.add(new GroupMarker(IWorkbenchActionConstants.EDIT_START));

    menu.add(undoAction);//from   w  w w.j a v a 2 s  .  c o m
    menu.add(redoAction);
    menu.add(new GroupMarker(IWorkbenchActionConstants.UNDO_EXT));
    menu.add(new Separator());

    menu.add(cutAction);
    menu.add(copyAction);
    menu.add(pasteAction);
    menu.add(new GroupMarker(IWorkbenchActionConstants.CUT_EXT));
    menu.add(new Separator());

    menu.add(deleteAction);
    menu.add(selectAllAction);
    menu.add(new Separator());

    menu.add(findAction);
    menu.add(new GroupMarker(IWorkbenchActionConstants.FIND_EXT));
    menu.add(new Separator());

    menu.add(addBookmarkAction);
    menu.add(addTaskAction);
    menu.add(new GroupMarker(IWorkbenchActionConstants.ADD_EXT));

    menu.add(new GroupMarker(IWorkbenchActionConstants.EDIT_END));
    menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));

    return menu;
}

From source file:bilab.BilabActionBarAdvisor.java

License:Open Source License

private MenuManager createFileMenu() {
    final MenuManager menu = new MenuManager("&File", IWorkbenchActionConstants.M_FILE);

    // setup the pop-out sub-menu for New --> Project/Other
    menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_START));
    {/*from ww w .  j  av a2 s .  co m*/
        // create the new sub-menu
        final String newText = "New";
        final String newId = ActionFactory.NEW.getId();
        final MenuManager newMenu = new MenuManager(newText, newId);

        // some stuff was here in the old model

        newMenu.add(new Separator(newId));
        this.newWizardMenu = new NewWizardMenu(getWindow());
        newMenu.add(this.newWizardMenu);
        newMenu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
        menu.add(newMenu);
    }

    // open file menu
    menu.add(new GroupMarker(IWorkbenchActionConstants.NEW_EXT));
    menu.add(new Separator());

    // Close | Close All
    menu.add(closeAction);
    menu.add(closeAllAction);
    menu.add(new GroupMarker(IWorkbenchActionConstants.CLOSE_EXT));
    menu.add(new Separator());

    // Save | Save As | Save All | Revert
    menu.add(saveAction);
    menu.add(saveAsAction);
    menu.add(saveAllAction);
    menu.add(revertAction);
    menu.add(new Separator());

    // Move | Rename | Refresh
    menu.add(moveAction);
    menu.add(renameAction);
    menu.add(refreshAction);
    menu.add(new GroupMarker(IWorkbenchActionConstants.SAVE_EXT));
    menu.add(new Separator());

    // Print
    menu.add(printAction);
    menu.add(new GroupMarker(IWorkbenchActionConstants.PRINT_EXT));
    menu.add(new Separator());

    menu.add(new GroupMarker(IWorkbenchActionConstants.OPEN_EXT));
    menu.add(new Separator());

    // Import | Export
    menu.add(importResourcesAction);
    menu.add(exportResourcesAction);
    menu.add(new GroupMarker(IWorkbenchActionConstants.IMPORT_EXT));
    menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
    menu.add(new Separator());

    // Properties | Most Recently Used...
    menu.add(propertiesAction);
    menu.add(new GroupMarker(IWorkbenchActionConstants.MRU));
    menu.add(new Separator());

    // Quit
    menu.add(quitAction);
    menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_END));

    return menu;
}

From source file:bilab.BilabActionBarAdvisor.java

License:Open Source License

private MenuManager createHelpMenu() {
    final MenuManager menu = new MenuManager("&Help", IWorkbenchActionConstants.M_HELP);
    addSeparatorOrGroupMarker(menu, "group.intro");

    // See if a welcome or intro page is specified
    if (introAction != null) {
        menu.add(introAction);//  w ww .  j av  a2  s.co  m
    } else if (quickStartAction != null) {
        menu.add(quickStartAction);
    }
    menu.add(new GroupMarker("group.intro.ext"));
    addSeparatorOrGroupMarker(menu, "group.main");
    menu.add(helpContentsAction);

    // See if a tips and tricks page is specified
    if (tipsAndTricksAction != null) {
        menu.add(tipsAndTricksAction);
    }

    // HELP_START should really be the first item, but it was after
    // quickStartAction and tipsAndTricksAction in 2.1.
    menu.add(new GroupMarker(IWorkbenchActionConstants.HELP_START));
    menu.add(new GroupMarker("group.main.ext"));
    addSeparatorOrGroupMarker(menu, "group.tutorials");
    addSeparatorOrGroupMarker(menu, "group.tools");
    addSeparatorOrGroupMarker(menu, "group.updates");
    menu.add(new GroupMarker(IWorkbenchActionConstants.HELP_END));
    addSeparatorOrGroupMarker(menu, IWorkbenchActionConstants.MB_ADDITIONS);

    // about should always be at the bottom
    menu.add(new Separator("group.about"));
    menu.add(aboutAction);
    menu.add(new GroupMarker("group.about.ext"));

    return menu;
}

From source file:bilab.BilabActionBarAdvisor.java

License:Open Source License

@Override
protected void fillCoolBar(final ICoolBarManager coolBar) {
    // IToolBarManager toolbar = new ToolBarManager(SWT.FLAT | SWT.RIGHT);
    // coolBar.add(new ToolBarContributionItem(toolbar, "main"));
    // toolbar.add(openViewAction);
    // toolbar.add(messagePopupAction);

    // Set up the context Menu
    final IMenuManager popUpMenu = new MenuManager();
    popUpMenu.add(new ActionContributionItem(lockToolBarAction));
    popUpMenu.add(new ActionContributionItem(editActionSetAction));
    coolBar.setContextMenuManager(popUpMenu);

    coolBar.add(new GroupMarker(IIDEActionConstants.GROUP_FILE));
    { // File Group
        final IToolBarManager fileToolBar = new ToolBarManager(coolBar.getStyle());
        fileToolBar.add(new Separator(IWorkbenchActionConstants.NEW_GROUP));
        fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.NEW_EXT));
        fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.SAVE_GROUP));
        fileToolBar.add(saveAction);//from w w w. j a  v  a  2 s . c o m
        fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.SAVE_EXT));
        fileToolBar.add(printAction);
        fileToolBar.add(new GroupMarker(IWorkbenchActionConstants.PRINT_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(new ToolBarContributionItem(fileToolBar, IWorkbenchActionConstants.TOOLBAR_FILE));
    }

    coolBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));

    coolBar.add(new GroupMarker(IIDEActionConstants.GROUP_NAV));
    { // Navigate group
        final 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));
}

From source file:bilab.BilabActionBarAdvisor.java

License:Open Source License

@Override
protected void fillMenuBar(final IMenuManager menuBar) {
    menuBar.add(createFileMenu());/*from   w w w  .  j  a  v  a2s  .c  o m*/
    menuBar.add(createEditMenu());
    menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    menuBar.add(createWindowMenu());
    menuBar.add(createHelpMenu());
}

From source file:ca.mcgill.sable.soot.ui.SootOutputView.java

License:Open Source License

private void fillContextMenu(IMenuManager mgr) {
    mgr.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    mgr.add(new Separator());
    mgr.add(copyAction);//  w  ww. j  ava2s .c  o m
    mgr.add(selectAllAction);
    mgr.add(new Separator());

}

From source file:ch.elexis.ApplicationActionBarAdvisor.java

License:Open Source License

protected void fillMenuBar(IMenuManager menuBar) {

    fileMenu = new MenuManager(Messages.ApplicationActionBarAdvisor_3, IWorkbenchActionConstants.M_FILE);
    editMenu = new MenuManager(Messages.ApplicationActionBarAdvisor_4, IWorkbenchActionConstants.M_EDIT);
    windowMenu = new MenuManager(Messages.ApplicationActionBarAdvisor_5, IWorkbenchActionConstants.M_WINDOW);
    helpMenu = new MenuManager(Messages.ApplicationActionBarAdvisor_6, IWorkbenchActionConstants.M_HELP);
    menuBar.add(fileMenu);//  w  ww  .  j  a  va  2s .c  om
    menuBar.add(editMenu);
    menuBar.add(windowMenu);
    menuBar.add(helpMenu);

    fileMenu.add(GlobalActions.loginAction);
    fileMenu.add(GlobalActions.changeMandantAction);
    fileMenu.add(GlobalActions.connectWizardAction);
    fileMenu.add(GlobalActions.prefsAction);
    fileMenu.add(new Separator());
    fileMenu.add(GlobalActions.importAction);
    fileMenu.add(new GroupMarker(IMPORTER_GROUP));
    fileMenu.add(new Separator());
    // fileMenu.add(GlobalActions.updateAction);
    fileMenu.add(new GroupMarker(ADDITIONS));
    fileMenu.add(new Separator());
    fileMenu.add(GlobalActions.exitAction);

    editMenu.add(GlobalActions.copyAction);
    editMenu.add(GlobalActions.cutAction);
    editMenu.add(GlobalActions.pasteAction);

    windowMenu.add(GlobalActions.fixLayoutAction);
    GlobalActions.perspectiveMenu = new MenuManager(Messages.ApplicationActionBarAdvisor_7, "openPerspective"); //$NON-NLS-1$
    GlobalActions.perspectiveList = ContributionItemFactory.PERSPECTIVES_SHORTLIST.create(window);
    GlobalActions.perspectiveMenu.add(savePerspectiveAction);
    GlobalActions.perspectiveMenu.add(savePerspectiveAsAction);
    perspectiveMenu.add(resetPerspectiveAction);
    perspectiveMenu.add(savePerspectiveAsDefaultAction);
    perspectiveMenu.add(new Separator());
    GlobalActions.perspectiveMenu.add(GlobalActions.perspectiveList);
    windowMenu.add(GlobalActions.perspectiveMenu);

    GlobalActions.viewMenu = new MenuManager(Messages.ApplicationActionBarAdvisor_9);
    GlobalActions.viewList = ContributionItemFactory.VIEWS_SHORTLIST.create(window);
    GlobalActions.viewMenu.add(GlobalActions.viewList);
    windowMenu.add(GlobalActions.viewMenu);

    /* helpMenu.add(testAction); */
    helpMenu.add(GlobalActions.helpAction);
    helpMenu.add(new Separator("additions"));
    helpMenu.add(new Separator());
    helpMenu.add(GlobalActions.aboutAction);
}

From source file:ch.elexis.core.application.advisors.ApplicationActionBarAdvisor.java

License:Open Source License

protected void fillMenuBar(IMenuManager menuBar) {

    fileMenu = new MenuManager(Messages.ApplicationActionBarAdvisor_3, IWorkbenchActionConstants.M_FILE);
    editMenu = new MenuManager(Messages.ApplicationActionBarAdvisor_4, IWorkbenchActionConstants.M_EDIT);
    windowMenu = new MenuManager(Messages.ApplicationActionBarAdvisor_5, IWorkbenchActionConstants.M_WINDOW);
    helpMenu = new MenuManager(Messages.ApplicationActionBarAdvisor_6, IWorkbenchActionConstants.M_HELP);
    menuBar.add(fileMenu);// w  w w  . j  av a  2  s .  c o  m
    menuBar.add(editMenu);
    menuBar.add(windowMenu);
    menuBar.add(helpMenu);

    fileMenu.add(GlobalActions.loginAction);
    fileMenu.add(GlobalActions.changeMandantAction);
    fileMenu.add(GlobalActions.connectWizardAction);
    fileMenu.add(GlobalActions.prefsAction);
    fileMenu.add(new Separator());
    fileMenu.add(GlobalActions.importAction);
    fileMenu.add(new GroupMarker(IMPORTER_GROUP));
    fileMenu.add(new Separator());
    // fileMenu.add(GlobalActions.updateAction);
    fileMenu.add(new GroupMarker(ADDITIONS));
    fileMenu.add(new Separator());
    fileMenu.add(GlobalActions.exitAction);

    editMenu.add(GlobalActions.copyAction);
    editMenu.add(GlobalActions.cutAction);
    editMenu.add(GlobalActions.pasteAction);

    GlobalActions.perspectiveMenu = new MenuManager(Messages.ApplicationActionBarAdvisor_7, "openPerspective"); //$NON-NLS-1$
    perspectiveMenu.add(resetPerspectiveAction);
    windowMenu.add(perspectiveMenu);

    GlobalActions.viewMenu = new MenuManager(Messages.ApplicationActionBarAdvisor_9);
    GlobalActions.viewList = ContributionItemFactory.VIEWS_SHORTLIST.create(window);
    GlobalActions.viewMenu.add(GlobalActions.viewList);
    windowMenu.add(GlobalActions.viewMenu);

    /* helpMenu.add(testAction); */
    helpMenu.add(GlobalActions.helpAction);
    helpMenu.add(new Separator("additions"));
    helpMenu.add(new Separator());
    helpMenu.add(GlobalActions.aboutAction);
}

From source file:ch.elexis.core.ui.util.ListDisplay.java

License:Open Source License

protected void fillContextMenu(IMenuManager manager, IAction... actions) {
    manager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    for (IAction ac : actions) {
        if (ac == null) {
            manager.add(new Separator());
        } else {/* w ww .jav  a  2s.c om*/
            if (ac instanceof RestrictedAction) {
                ((RestrictedAction) ac).reflectRight();
            }
            manager.add(ac);
        }
    }
}

From source file:ch.elexis.core.ui.util.ViewMenus.java

License:Open Source License

private void fillContextMenu(IMenuManager manager, List<IContributionItem> contributionItems) {
    manager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    for (IContributionItem contributionItem : contributionItems) {
        if (contributionItem == null) {
            manager.add(new Separator());
            continue;
        } else if (contributionItem instanceof ActionContributionItem) {
            ActionContributionItem ac = (ActionContributionItem) contributionItem;
            if (ac.getAction() instanceof RestrictedAction) {
                ((RestrictedAction) ac.getAction()).reflectRight();
            }/*from w ww .  j  a v a  2  s . com*/
        }
        contributionItem.update();
        manager.add(contributionItem);
    }
}