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:org.eclipse.osee.ats.world.WorldXViewer.java

License:Open Source License

@Override
public void updateMenuActionsForTable() {
    MenuManager mm = getMenuManager();// w  ww  . j  a  va 2 s . c om

    // OPEN MENU BLOCK
    OpenContributionItem contrib = new OpenContributionItem(getClass().getSimpleName() + ".open");
    contrib.fill(mm.getMenu(), -1);
    mm.insertBefore(XViewer.MENU_GROUP_PRE, contrib);
    mm.insertBefore(XViewer.MENU_GROUP_PRE, new Separator());

    mm.insertBefore(XViewer.MENU_GROUP_PRE, new GroupMarker(MENU_GROUP_ATS_WORLD_EDIT));

    updateEditMenuActions();

    if (AtsUtilClient.isAtsAdmin()) {
        mm.insertBefore(XViewer.MENU_GROUP_PRE, new Separator());
        mm.insertBefore(XViewer.MENU_GROUP_PRE, deletePurgeAtsObjectAction);
        deletePurgeAtsObjectAction.setEnabled(getSelectedAtsArtifacts().size() > 0);
    }

    mm.insertBefore(XViewer.MENU_GROUP_PRE, deleteTasksAction);
    deleteTasksAction.updateEnablement(getSelectedArtifacts());

    mm.insertBefore(XViewer.MENU_GROUP_PRE, new GroupMarker(MENU_GROUP_ATS_WORLD_OPEN));
    mm.insertBefore(XViewer.MENU_GROUP_PRE, new Separator());

    // OTHER MENU BLOCK
    mm.insertBefore(XViewer.MENU_GROUP_PRE, favoritesAction);
    favoritesAction.updateEnablement();

    mm.insertBefore(XViewer.MENU_GROUP_PRE, subscribedAction);
    subscribedAction.updateEnablement();

    mm.insertBefore(XViewer.MENU_GROUP_PRE, emailAction);
    emailAction.setEnabled(getSelectedSMAArtifacts().size() == 1);

    mm.insertBefore(XViewer.MENU_GROUP_PRE, resetActionArtifactAction);
    resetActionArtifactAction.setEnabled(getSelectedActionArtifacts().size() > 0);

    mm.insertBefore(XViewer.MENU_GROUP_PRE, new GroupMarker(MENU_GROUP_ATS_WORLD_OTHER));
    mm.insertBefore(XViewer.MENU_GROUP_PRE, new Separator());

    for (IMenuActionProvider provider : menuActionProviders) {
        provider.updateMenuActionsForTable();
    }
}

From source file:org.eclipse.paho.mqtt.ui.ApplicationActionBarAdvisor.java

License:Open Source License

protected void fillMenuBar(IMenuManager menuBar) {
    MenuManager fileMenu = new MenuManager("&" + Messages.LABEL_FILE, IWorkbenchActionConstants.M_FILE); //$NON-NLS-1$
    MenuManager helpMenu = new MenuManager("&" + Messages.LABEL_HELP, IWorkbenchActionConstants.M_HELP); //$NON-NLS-1$

    menuBar.add(fileMenu);/*from w w  w  .jav  a  2 s.  co m*/
    // Add a group marker indicating where action set menus will appear.
    menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    menuBar.add(helpMenu);

    // File
    fileMenu.add(newConnectionAction);
    fileMenu.add(new Separator());
    fileMenu.add(exitAction);

    // Help
    helpMenu.add(aboutAction);
}

From source file:org.eclipse.papyrus.infra.table.common.internal.NatTableEditor.java

License:Open Source License

/**
 * /*from  w  w  w. ja v a  2 s . c  o  m*/
 * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
 * 
 * @param parent
 */
@Override
public void createPartControl(final Composite parent) {
    this.menuMgr = new MenuManager("#PopUp", NatTableEditor.ID); //$NON-NLS-1$
    this.menuMgr.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    this.menuMgr.setRemoveAllWhenShown(true);

    final Composite editorComposite = createCompositeCompositeWthTableBorder(parent);
    //      createFirstLine(editorComposite);
    //      createDescription(editorComposite);

    // the composite owning the table
    final Composite tableComposite = new Composite(editorComposite, SWT.NONE);
    GridLayout tableCompositeGridLayout = new GridLayout(1, true);
    tableComposite.setLayout(tableCompositeGridLayout);

    final GridData compositeTableGridLayout = new GridData();
    compositeTableGridLayout.grabExcessHorizontalSpace = true;
    compositeTableGridLayout.grabExcessVerticalSpace = true;
    compositeTableGridLayout.horizontalAlignment = SWT.FILL;
    compositeTableGridLayout.verticalAlignment = SWT.FILL;
    tableComposite.setLayoutData(compositeTableGridLayout);

    this.natTableWidget = createNattableWidget(tableComposite, this,
            this.tableEditorInput.getPapyrusTableInstance().getTable(), this.menuMgr);

    getSite().setSelectionProvider(this);
    getSite().registerContextMenu(this.menuMgr, this.natTableWidget);
}

From source file:org.eclipse.papyrus.table.common.internal.NatTableEditor.java

License:Open Source License

/**
 * //from   w  w  w .  j  av  a2  s. com
 * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
 * 
 * @param parent
 */
@Override
public void createPartControl(final Composite parent) {
    this.menuMgr = new MenuManager("#PopUp", NatTableEditor.ID); //$NON-NLS-1$
    this.menuMgr.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    this.menuMgr.setRemoveAllWhenShown(true);

    final Composite editorComposite = createCompositeCompositeWthTableBorder(parent);
    createFirstLine(editorComposite);
    createDescription(editorComposite);

    // the composite owning the table
    final Composite tableComposite = new Composite(editorComposite, SWT.NONE);
    GridLayout tableCompositeGridLayout = new GridLayout(1, true);
    tableComposite.setLayout(tableCompositeGridLayout);

    final GridData compositeTableGridLayout = new GridData();
    compositeTableGridLayout.grabExcessHorizontalSpace = true;
    compositeTableGridLayout.grabExcessVerticalSpace = true;
    compositeTableGridLayout.horizontalAlignment = SWT.FILL;
    compositeTableGridLayout.verticalAlignment = SWT.FILL;
    tableComposite.setLayoutData(compositeTableGridLayout);

    this.natTableWidget = createNattableWidget(tableComposite, this,
            this.tableEditorInput.getPapyrusTableInstance().getTable(), this.menuMgr);

    getSite().setSelectionProvider(this);
    getSite().registerContextMenu(this.menuMgr, this.natTableWidget);
}

From source file:org.eclipse.pde.internal.ui.editor.feature.RequiresSection.java

License:Open Source License

@Override
protected void fillContextMenu(IMenuManager manager) {
    IStructuredSelection selection = (StructuredSelection) fPluginViewer.getSelection();
    if (!selection.isEmpty()) {
        manager.add(fOpenAction);/*from w w w.  j  a  va2s .  c  o  m*/
        manager.add(fDeleteAction);
        manager.add(new Separator());
    }
    getPage().getPDEEditor().getContributor().contextMenuAboutToShow(manager);
    manager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
}

From source file:org.eclipse.pde.internal.ui.editor.plugin.RequiresSection.java

License:Open Source License

@Override
protected void fillContextMenu(IMenuManager manager) {
    ISelection selection = fImportViewer.getSelection();
    manager.add(fAddAction);/*  w w  w .  j  a  va2s  .co  m*/
    if (!selection.isEmpty()) {
        manager.add(fOpenAction);
    }
    manager.add(new Separator());
    getPage().contextMenuAboutToShow(manager);

    if (!selection.isEmpty())
        manager.add(fRemoveAction);
    getPage().getPDEEditor().getContributor().contextMenuAboutToShow(manager);
    manager.add(new Separator());

    PluginSearchActionGroup actionGroup = new PluginSearchActionGroup();
    actionGroup.setContext(new ActionContext(selection));
    actionGroup.fillContextMenu(manager);
    if (((IModel) getPage().getModel()).getUnderlyingResource() != null) {
        manager.add(new UnusedDependenciesAction((IPluginModelBase) getPage().getModel(), false));
    }
    if (fPropertiesAction != null && !fImportViewer.getSelection().isEmpty()) {
        manager.add(new Separator());
        manager.add(fPropertiesAction);
    }
    manager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
}

From source file:org.eclipse.php.composer.ui.console.TerminalConsolePage.java

License:Open Source License

@Override
public void init(IPageSite pageSite) {
    super.init(pageSite);
    IToolBarManager toolBarManager = pageSite.getActionBars().getToolBarManager();
    toolBarManager.insertBefore(IConsoleConstants.OUTPUT_GROUP, new GroupMarker(TOOLBAR_GROUP_ID));
    toolBarManager.appendToGroup(TOOLBAR_GROUP_ID, stopAction);
    toolBarManager.appendToGroup(TOOLBAR_GROUP_ID, removeInactiveAction);
}

From source file:org.eclipse.php.internal.ui.actions.PHPSearchActionGroup.java

License:Open Source License

public void fillContextMenu(IMenuManager menu) {
    super.fillContextMenu(menu);
    if (!PreferenceConstants.getPreferenceStore().getBoolean(PreferenceConstants.SEARCH_USE_REDUCED_MENU)) {
        IMenuManager target = menu;/* w  ww .  j av  a2 s  .  c  o  m*/
        IMenuManager searchSubMenu = null;
        if (fEditor != null) {
            String groupName = "SearchMessages.group_search"; //$NON-NLS-1$
            searchSubMenu = new MenuManager(groupName, ITextEditorActionConstants.GROUP_FIND);
            searchSubMenu.add(new GroupMarker(ITextEditorActionConstants.GROUP_FIND));
            target = searchSubMenu;
        }

        if (searchSubMenu != null) {
            fOccurrencesGroup.fillContextMenu(target);
            searchSubMenu.add(new Separator());
        }

        // no other way to find out if we have added items.
        if (searchSubMenu != null && searchSubMenu.getItems().length > 2) {
            menu.appendToGroup(ITextEditorActionConstants.GROUP_FIND, searchSubMenu);
        }

        fReferencesGroup.fillContextMenu(target);
        fDeclarationsGroup.fillContextMenu(target);
    } else {
        fReferencesGroup.fillContextMenu(menu);
        fDeclarationsGroup.fillContextMenu(menu);
    }

    IContributionItem item = menu.find(IContextMenuConstants.GROUP_OPEN);
    if (item != null) {
        menu.appendToGroup(IContextMenuConstants.GROUP_OPEN, action);
    }
}

From source file:org.eclipse.php.internal.ui.compare.MergeSourceViewer.java

License:Open Source License

public void menuAboutToShow(IMenuManager menu) {

    menu.add(new Separator("undo")); //$NON-NLS-1$
    addMenu(menu, UNDO_ID);//from   ww w .ja va  2 s .c o  m
    addMenu(menu, REDO_ID);
    menu.add(new GroupMarker("save")); //$NON-NLS-1$
    if (fAddSaveAction)
        addMenu(menu, SAVE_ID);
    menu.add(new Separator("file")); //$NON-NLS-1$

    menu.add(new Separator("ccp")); //$NON-NLS-1$
    addMenu(menu, CUT_ID);
    addMenu(menu, COPY_ID);
    addMenu(menu, PASTE_ID);
    addMenu(menu, DELETE_ID);
    addMenu(menu, SELECT_ALL_ID);

    menu.add(new Separator("edit")); //$NON-NLS-1$
    menu.add(new Separator("find")); //$NON-NLS-1$
    addMenu(menu, FIND_ID);

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

    menu.add(new Separator("text")); //$NON-NLS-1$
    for (Iterator iterator = textActions.iterator(); iterator.hasNext();) {
        IAction action = (IAction) iterator.next();
        menu.add(action);
    }

    menu.add(new Separator("rest")); //$NON-NLS-1$

    // update all actions
    // to get undo redo right
    updateActions();
}