Example usage for org.eclipse.jface.action IMenuManager appendToGroup

List of usage examples for org.eclipse.jface.action IMenuManager appendToGroup

Introduction

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

Prototype

void appendToGroup(String groupName, IAction action);

Source Link

Document

Adds a contribution item for the given action at the end of the group with the given name.

Usage

From source file:ac.soton.eventb.classdiagrams.diagram.part.ClassdiagramsDiagramActionBarContributor.java

License:Open Source License

/**
 * @generated/*ww w  .j  av a 2s  . com*/
 */
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 ValidateAction(page);
    editMenu.appendToGroup("validationGroup", validateAction); //$NON-NLS-1$
}

From source file:ac.soton.eventb.classdiagrams.diagram.part.DiagramEditorContextMenuProvider.java

License:Open Source License

/**
 * @generated/*from   ww  w.  j  a va2s  . c  o m*/
 */
public void buildContextMenu(final IMenuManager menu) {
    getViewer().flush();
    try {
        TransactionUtil.getEditingDomain((EObject) getViewer().getContents().getModel())
                .runExclusive(new Runnable() {

                    public void run() {
                        ContributionItemService.getInstance()
                                .contributeToPopupMenu(DiagramEditorContextMenuProvider.this, part);
                        menu.remove(ActionIds.ACTION_DELETE_FROM_MODEL);
                        menu.appendToGroup("editGroup", deleteAction);
                    }
                });
    } catch (Exception e) {
        ClassdiagramsDiagramEditorPlugin.getInstance().logError("Error building context menu", e);
    }
}

From source file:ac.soton.eventb.emf.diagrams.navigator.provider.DiagramActionProvider.java

License:Open Source License

@Override
public void fillContextMenu(IMenuManager menu) {
    super.fillContextMenu(menu);
    menu.appendToGroup(ICommonMenuConstants.GROUP_OPEN, dblClickAction);
}

From source file:ac.soton.eventb.statemachines.diagram.part.DiagramEditorContextMenuProvider.java

License:Open Source License

/**
 * @generated//from   w ww. j ava  2 s  .c  om
 */
public void buildContextMenu(final IMenuManager menu) {
    getViewer().flush();
    try {
        TransactionUtil.getEditingDomain((EObject) getViewer().getContents().getModel())
                .runExclusive(new Runnable() {

                    public void run() {
                        ContributionItemService.getInstance()
                                .contributeToPopupMenu(DiagramEditorContextMenuProvider.this, part);
                        menu.remove(ActionIds.ACTION_DELETE_FROM_MODEL);
                        menu.appendToGroup("editGroup", deleteAction);
                    }
                });
    } catch (Exception e) {
        StatemachinesDiagramEditorPlugin.getInstance().logError("Error building context menu", e);
    }
}

From source file:ac.soton.fmusim.components.diagram.part.ComponentsDiagramActionBarContributor.java

License:Open Source License

/**
 * @generated/*  w w  w  .ja  v a 2s.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;
    fileMenu.remove("pageSetupAction"); //$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 ValidateAction(page);
    editMenu.appendToGroup("validationGroup", validateAction); //$NON-NLS-1$
}

From source file:ac.soton.fmusim.components.diagram.part.DiagramEditorContextMenuProvider.java

License:Open Source License

/**
 * @generated/*  www .  j  av  a 2 s  .co m*/
 */
public void buildContextMenu(final IMenuManager menu) {
    getViewer().flush();
    try {
        TransactionUtil.getEditingDomain((EObject) getViewer().getContents().getModel())
                .runExclusive(new Runnable() {

                    public void run() {
                        ContributionItemService.getInstance()
                                .contributeToPopupMenu(DiagramEditorContextMenuProvider.this, part);
                        menu.remove(ActionIds.ACTION_DELETE_FROM_MODEL);
                        menu.appendToGroup("editGroup", deleteAction);
                    }
                });
    } catch (Exception e) {
        ComponentsDiagramEditorPlugin.getInstance().logError("Error building context menu", e);
    }
}

From source file:ac.soton.fmusim.components.ui.navigator.EventBComponentActionProvider.java

License:Open Source License

@Override
public void fillContextMenu(IMenuManager menu) {
    super.fillContextMenu(menu);
    menu.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS,
            new DeleteEventBComponentAction(getActionSite()));
}

From source file:ac.soton.fmusim.components.ui.navigator.NavigatorComponentsDiagramActionProvider.java

License:Open Source License

@Override
public void fillContextMenu(IMenuManager menu) {
    super.fillContextMenu(menu);
    menu.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, new DeleteDiagramAction(getActionSite()));
}

From source file:ac.soton.multisim.diagram.part.DiagramEditorContextMenuProvider.java

License:Open Source License

/**
 * @generated//from w  w  w.  ja  v  a 2s.c  om
 */
public void buildContextMenu(final IMenuManager menu) {
    getViewer().flush();
    try {
        TransactionUtil.getEditingDomain((EObject) getViewer().getContents().getModel())
                .runExclusive(new Runnable() {

                    public void run() {
                        ContributionItemService.getInstance()
                                .contributeToPopupMenu(DiagramEditorContextMenuProvider.this, part);
                        menu.remove(ActionIds.ACTION_DELETE_FROM_MODEL);
                        menu.appendToGroup("editGroup", deleteAction);
                    }
                });
    } catch (Exception e) {
        MultisimDiagramEditorPlugin.getInstance().logError("Error building context menu", e);
    }
}

From source file:ac.soton.multisim.ui.navigator.FMUNavigatorActionProvider.java

License:Open Source License

@Override
public void fillContextMenu(IMenuManager menu) {
    super.fillContextMenu(menu);
    menu.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, new DeleteFMUResourceAction(getActionSite()));
}