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:edu.toronto.cs.se.modelepedia.statemachine_mavo.diagram.part.StateMachine_MAVODiagramActionBarContributor.java

License:Open Source License

/**
* @generated//from w  ww  .ja  va2s .  c o m
*/
public void init(IActionBars bars, IWorkbenchPage page) {
    super.init(bars, page);
    // print preview
    IMenuManager fileMenu = bars.getMenuManager().findMenuUsingPath(IWorkbenchActionConstants.M_FILE);
    assert fileMenu != null;
    IAction printPreviewAction = new RenderedPrintPreviewAction(new EnhancedPrintActionHelper());
    fileMenu.insertBefore("print", printPreviewAction); //$NON-NLS-1$
    IMenuManager editMenu = bars.getMenuManager().findMenuUsingPath(IWorkbenchActionConstants.M_EDIT);
    assert editMenu != null;
    if (editMenu.find("validationGroup") == null) { //$NON-NLS-1$
        editMenu.add(new GroupMarker("validationGroup")); //$NON-NLS-1$
    }
    IAction validateAction = new edu.toronto.cs.se.modelepedia.statemachine_mavo.diagram.part.ValidateAction(
            page);
    editMenu.appendToGroup("validationGroup", validateAction); //$NON-NLS-1$
}

From source file:es.cv.gvcase.ide.navigator.actions.resource.OpenFileActionProvider.java

License:Open Source License

private void addOpenWithMenu(IMenuManager aMenu) {
    IStructuredSelection ss = (IStructuredSelection) getContext().getSelection();

    if (ss == null || ss.size() != 1) {
        return;//from w  w w. ja v  a2  s  .  com
    }

    Object o = ss.getFirstElement();

    // first try IResource
    IAdaptable openable = (IAdaptable) AdaptabilityUtility.getAdapter(o, IResource.class);
    // otherwise try ResourceMapping
    if (openable == null) {
        openable = (IAdaptable) AdaptabilityUtility.getAdapter(o, ResourceMapping.class);
    } else if (((IResource) openable).getType() != IResource.FILE) {
        openable = null;
    }

    if (openable != null) {
        // Create a menu flyout.
        IMenuManager submenu = new MenuManager("Open With", ICommonMenuConstants.GROUP_OPEN_WITH);
        submenu.add(new GroupMarker(ICommonMenuConstants.GROUP_TOP));
        // use our OpenWithMenu in order to check Broken References
        submenu.add(new OpenWithMenu(viewSite.getPage(), openable));
        submenu.add(new GroupMarker(ICommonMenuConstants.GROUP_ADDITIONS));

        // Add the submenu.
        if (submenu.getItems().length > 2 && submenu.isEnabled()) {
            aMenu.appendToGroup(ICommonMenuConstants.GROUP_OPEN_WITH, submenu);
        }
    }
}

From source file:eu.aniketos.wp1.ststool.diagram.application.DiagramEditorActionBarAdvisor.java

License:Open Source License

/**
 * Add the eclipse menu entry//  w  w w  . j av a 2s  . com
 * 
 * @generated NOT
 */
@Override
protected void fillMenuBar(IMenuManager menu) {
    //menu:org.eclipse.ui.main.menu
    //toolbar:org.eclipse.ui.main.toolbar
    {
        //file
        IMenuManager menuX = new MenuManager(Messages.ApplicationMenuName_File,
                IWorkbenchActionConstants.M_FILE);

        //new
        menuX.add(new GroupMarker("new"));
        //open
        menuX.add(new Separator("open"));
        //import
        menuX.add(new Separator("import"));

        menuX.add(new Separator());

        //save
        menuX.add(getAction(ActionFactory.SAVE.getId()));

        //saveAs
        menuX.add(getAction(ActionFactory.SAVE_AS.getId()));

        //saveAll
        menuX.add(getAction(ActionFactory.SAVE_ALL.getId()));

        menuX.add(new Separator());

        //close
        menuX.add(getAction(ActionFactory.CLOSE.getId()));

        //closeAll
        menuX.add(getAction(ActionFactory.CLOSE_ALL.getId()));

        menuX.add(new Separator());

        //additions
        menuX.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));

        //ExportAdditions
        menuX.add(new GroupMarker("ExportAdditions"));

        menuX.add(new Separator());

        //quit
        menuX.add(getAction(ActionFactory.QUIT.getId()));

        //fileEnd
        menuX.add(new GroupMarker(IWorkbenchActionConstants.FILE_END));
        menu.add(menuX);
    }

    //additions
    menu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));

    {
        //window
        IMenuManager menuX = new MenuManager(Messages.ApplicationMenuName_Window,
                IWorkbenchActionConstants.M_WINDOW);

        //org.eclipse.ui.window.resetPerspective
        menuX.add(resetPerspective);
        menuX.add(new Separator());
        //org.eclipse.ui.window.preferences
        menuX.add(preferencesAction);
        //additions
        menuX.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
        menu.add(menuX);
    }

    {
        //help
        IMenuManager menuX = new MenuManager(Messages.ApplicationMenuName_Help,
                IWorkbenchActionConstants.M_HELP);

        //org.eclipse.ui.help.quickStartAction
        if (introAction != null)
            menuX.add(introAction);

        //helpStart
        menuX.add(new GroupMarker(IWorkbenchActionConstants.HELP_START));
        menuX.add(helpContentsActon);
        //help
        menuX.add(new GroupMarker(IWorkbenchActionConstants.HELP_END));

        //menuX.add(helpAction);
        menuX.add(new Separator());
        menuX.add(aboutAction);

        //additions
        menuX.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
        menu.add(menuX);
    }
}

From source file:eu.aniketos.wp1.ststool.diagram.application.DiagramEditorActionBarAdvisor.java

License:Open Source License

protected void myFillCoolBar(ICoolBarManager toolBar) {
    {// w w w .j  av  a  2  s  .  c  o  m
        IToolBarManager toolBarX = new ToolBarManager();

        toolBarX.add(new GroupMarker("new"));
        toolBarX.add(new GroupMarker("open"));
        toolBarX.add(getAction(ActionFactory.SAVE.getId()));
        toolBarX.add(new Separator("exoprt"));
        toolBarX.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
        toolBar.add(new ToolBarContributionItem(toolBarX, "file"));
    }

    {
        IToolBarManager toolBarX = new ToolBarManager();
        toolBarX.add(new GroupMarker("views"));
        toolBar.add(new ToolBarContributionItem(toolBarX, "view"));
    }

    toolBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
}

From source file:eu.celar.ui.views.AuthTokenView.java

License:Open Source License

/**
 * Fill the context menu belonging to the token table.
 * // ww  w . ja v a 2  s . c o  m
 * @param mgr The manager that takes responsible for the context menu.
 */
protected void fillContextMenu(final IMenuManager mgr) {
    if (this.newAction.isEnabled())
        mgr.add(this.newAction);
    if (this.deleteAction.isEnabled() || this.activateAction.isEnabled() || this.deactivateAction.isEnabled()
            || this.infoAction.isEnabled() || this.refreshAction.isEnabled()) {
        mgr.add(new Separator());
        if (this.deleteAction.isEnabled())
            mgr.add(this.deleteAction);
        if (this.activateAction.isEnabled())
            mgr.add(this.activateAction);
        if (this.deactivateAction.isEnabled())
            mgr.add(this.deactivateAction);
        if (this.infoAction.isEnabled())
            mgr.add(this.infoAction);
        if (this.deleteAction.isEnabled() || this.activateAction.isEnabled()
                || this.deactivateAction.isEnabled() || this.infoAction.isEnabled()) {
            mgr.add(new Separator());
        }
        if (this.refreshAction.isEnabled())
            mgr.add(this.refreshAction);
    }
    mgr.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
}

From source file:eu.esdihumboldt.hale.ui.application.ApplicationActionBarAdvisor.java

License:Open Source License

/**
 * @see ActionBarAdvisor#fillMenuBar(IMenuManager)
 *//*from   w w  w.  j ava2s .  co  m*/
@Override
protected void fillMenuBar(IMenuManager menuBar) {
    menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));

    // edit menu
    IMenuManager menu = new MenuManager("Edit", IWorkbenchActionConstants.M_EDIT);
    menu.add(new GroupMarker(IWorkbenchActionConstants.EDIT_START));

    menu.add(undoAction);
    menu.add(redoAction);
    menu.add(new GroupMarker(IWorkbenchActionConstants.UNDO_EXT));
    menu.add(new Separator());

    menuBar.add(menu);

    // window menu
    IMenuManager windowMenu = new MenuManager(Messages.ApplicationWorkbenchWindowAdvisor_1,
            IWorkbenchActionConstants.M_WINDOW); //$NON-NLS-1$
    IMenuManager viewMenu = new MenuManager(Messages.ApplicationWorkbenchWindowAdvisor_3, "view"); //$NON-NLS-1$
    windowMenu.add(viewMenu);
    viewMenu.add(viewsShortList);

    windowMenu.add(savePerspectiveAction);

    menuBar.add(windowMenu);

    // help menu
    IMenuManager helpMenu = new MenuManager(Messages.ApplicationWorkbenchWindowAdvisor_2,
            IWorkbenchActionConstants.M_HELP); //$NON-NLS-1$ //$NON-NLS-2$
    helpMenu.add(introAction);

    menuBar.add(helpMenu);
}

From source file:eu.esdihumboldt.hale.ui.application.ApplicationActionBarAdvisor.java

License:Open Source License

/**
 * @see org.eclipse.ui.application.ActionBarAdvisor#fillCoolBar(org.eclipse.jface.action.ICoolBarManager)
 *///from  w w  w  .  j  a  va 2 s . com
@Override
protected void fillCoolBar(ICoolBarManager coolBar) {
    IActionBarConfigurer2 actionBarConfigurer = (IActionBarConfigurer2) getActionBarConfigurer();
    coolBar.add(new GroupMarker(IWorkbenchActionConstants.GROUP_FILE));
    { // 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(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("group.nav"));
    { // Navigate group
        IToolBarManager navToolBar = actionBarConfigurer.createToolBarManager();
        navToolBar.add(new Separator(IWorkbenchActionConstants.HISTORY_GROUP));
        navToolBar.add(new Separator(IWorkbenchActionConstants.GROUP_APP));
        navToolBar.add(new Separator(IWorkbenchActionConstants.PIN_GROUP));

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

From source file:eu.geclipse.batch.ui.views.BatchJobView.java

License:Open Source License

/**
 * Fill the context menu belonging to the token table.
 * /*from w ww .  j  a v  a 2s. com*/
 * @param mgr The manager that takes responsible for the context menu.
 */
protected void fillContextMenu(final IMenuManager mgr) {
    if (this.deleteAction.isEnabled())
        mgr.add(this.deleteAction);

    if (this.moveAction.isEnabled())
        mgr.add(this.moveAction);

    if (this.holdAction.isEnabled())
        mgr.add(this.holdAction);

    if (this.releaseAction.isEnabled())
        mgr.add(this.releaseAction);

    if (this.reRunAction.isEnabled())
        mgr.add(this.reRunAction);

    if (this.refreshAction.isEnabled()) {
        mgr.add(new Separator());
        mgr.add(this.refreshAction);
    }

    mgr.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
}

From source file:eu.geclipse.jsdl.ui.internal.pages.sections.SweepOrderSection.java

License:Open Source License

private MenuManager createMenu() {
    MenuManager mManager = new MenuManager();
    mManager.setRemoveAllWhenShown(true);
    mManager.addMenuListener(new IMenuListener() {

        public void menuAboutToShow(final IMenuManager mManager) {
            boolean enable = false;
            if (!SweepOrderSection.this.viewer.getSelection().isEmpty()) {
                enable = true;/*from   w w w .  j  av  a  2  s .  c  o  m*/
            }
            // Adds a separator
            mManager.add(new Separator("Zero")); //$NON-NLS-1$
            // Adds a GroupMarker
            GroupMarker marker = new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS);
            mManager.add(marker);
            mManager.add(createNewAction());
            Action action = createIndependentSweepAction();
            action.setEnabled(enable);
            mManager.add(new Separator("First")); //$NON-NLS-1$
            mManager.appendToGroup("First", action); //$NON-NLS-1$
            action = createChangesWithSweepAction();
            action.setEnabled(enable);
            mManager.appendToGroup("First", action); //$NON-NLS-1$
            action = createChangesForEachAction();
            action.setEnabled(enable);
            mManager.appendToGroup("First", action); //$NON-NLS-1$
            mManager.add(new Separator("Second")); //$NON-NLS-1$
            action = createDeleteAction();
            action.setEnabled(enable);
            mManager.appendToGroup("Second", action); //$NON-NLS-1$
        }
    });
    Menu contextMenu = mManager.createContextMenu(this.viewer.getTree());
    this.viewer.getTree().setMenu(mManager.getMenu());
    return mManager;
}

From source file:eu.geclipse.ui.views.GridModelViewPart.java

License:Open Source License

/**
 * Create the standard menu groups in the specified context
 * menu. Subclasses may overwrite this method in order to add
 * new groups or to completely change the groups.
 *  /*from   w ww . ja va2 s.c  o  m*/
 * @param menu The menu manager in which to create the groups.
 */
protected void createContextMenuGroups(final IMenuManager menu) {
    menu.add(new Separator(ICommonMenuConstants.GROUP_NEW));
    menu.add(new GroupMarker(ICommonMenuConstants.GROUP_GOTO));
    menu.add(new GroupMarker(ICommonMenuConstants.GROUP_OPEN));
    menu.add(new GroupMarker(ICommonMenuConstants.GROUP_OPEN_WITH));
    menu.add(new Separator(ICommonMenuConstants.GROUP_EDIT));
    menu.add(new GroupMarker(ICommonMenuConstants.GROUP_SHOW));
    menu.add(new GroupMarker(ICommonMenuConstants.GROUP_REORGANIZE));
    menu.add(new GroupMarker(ICommonMenuConstants.GROUP_PORT));
    menu.add(new Separator(ICommonMenuConstants.GROUP_GENERATE));
    menu.add(new Separator(ICommonMenuConstants.GROUP_SEARCH));
    menu.add(new Separator(ICommonMenuConstants.GROUP_BUILD));
    menu.add(new Separator(ICommonMenuConstants.GROUP_ADDITIONS));
    menu.add(new Separator(ICommonMenuConstants.GROUP_PROPERTIES));
}