use of org.eclipse.jface.action.MenuManager in project archi by archimatetool.
the class ArchiActionBarAdvisor method createHelpMenu.
/**
* Create the Help menu
* @return
*/
private MenuManager createHelpMenu() {
IWorkbenchWindow window = getActionBarConfigurer().getWindowConfigurer().getWindow();
MenuManager menu = new MenuManager(Messages.ArchimateEditorActionBarAdvisor_16, IWorkbenchActionConstants.M_HELP);
menu.add(new GroupMarker(IWorkbenchActionConstants.HELP_START));
menu.add(ActionFactory.INTRO.create(window));
menu.add(new Separator());
menu.add(ActionFactory.HELP_CONTENTS.create(window));
menu.add(ActionFactory.HELP_SEARCH.create(window));
menu.add(ActionFactory.DYNAMIC_HELP.create(window));
menu.add(new Separator());
menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
menu.add(new GroupMarker(IWorkbenchActionConstants.HELP_END));
menu.add(fDonateAction);
menu.add(fActionCheckForNewVersion);
menu.add(fInstallPlugin);
menu.add(new Separator());
menu.add(fActionResetApplication);
menu.add(new Separator());
menu.add(fActionShowRelationsMatrix);
/*
* On a Mac, there is an "About" menu item under the application menu bar.
*/
if (!PlatformUtils.isMac()) {
ActionContributionItem item = new ActionContributionItem(fActionAbout);
menu.add(new Separator());
menu.add(item);
}
return menu;
}
use of org.eclipse.jface.action.MenuManager in project archi by archimatetool.
the class AbstractDiagramEditorActionBarContributor method createViewMenu.
/**
* Create the "View" Menu
*/
protected IMenuManager createViewMenu(IMenuManager menuManager) {
IMenuManager viewMenu = new MenuManager(Messages.AbstractDiagramEditorActionBarContributor_4);
viewMenu.add(getAction(GEFActionConstants.ZOOM_IN));
viewMenu.add(getAction(GEFActionConstants.ZOOM_OUT));
viewMenu.add(getAction(ZoomNormalAction.ID));
viewMenu.add(new Separator());
viewMenu.add(getAction(SnapToGrid.PROPERTY_GRID_ENABLED));
viewMenu.add(getAction(GEFActionConstants.TOGGLE_GRID_VISIBILITY));
viewMenu.add(getAction(GEFActionConstants.TOGGLE_SNAP_TO_GEOMETRY));
// viewMenu.add(getAction(GEFActionConstants.TOGGLE_RULER_VISIBILITY));
viewMenu.add(new Separator());
// $NON-NLS-1$
IMenuManager orderMenu = new MenuManager(Messages.AbstractDiagramEditorActionBarContributor_5, "menu_order");
viewMenu.add(orderMenu);
orderMenu.add(getAction(BringToFrontAction.ID));
orderMenu.add(getAction(BringForwardAction.ID));
orderMenu.add(getAction(SendToBackAction.ID));
orderMenu.add(getAction(SendBackwardAction.ID));
viewMenu.add(new GroupMarker(GROUP_POSITION));
// $NON-NLS-1$
IMenuManager alignmentMenu = new MenuManager(Messages.AbstractDiagramEditorActionBarContributor_6, "menu_position");
viewMenu.add(alignmentMenu);
alignmentMenu.add(getAction(GEFActionConstants.ALIGN_LEFT));
alignmentMenu.add(getAction(GEFActionConstants.ALIGN_CENTER));
alignmentMenu.add(getAction(GEFActionConstants.ALIGN_RIGHT));
alignmentMenu.add(new Separator());
alignmentMenu.add(getAction(GEFActionConstants.ALIGN_TOP));
alignmentMenu.add(getAction(GEFActionConstants.ALIGN_MIDDLE));
alignmentMenu.add(getAction(GEFActionConstants.ALIGN_BOTTOM));
alignmentMenu.add(new Separator());
alignmentMenu.add(getAction(GEFActionConstants.MATCH_WIDTH));
alignmentMenu.add(getAction(GEFActionConstants.MATCH_HEIGHT));
alignmentMenu.add(new Separator());
alignmentMenu.add(getAction(DefaultEditPartSizeAction.ID));
viewMenu.add(new Separator(GROUP_CONNECTIONS));
// $NON-NLS-1$
IMenuManager connectionMenu = new MenuManager(Messages.AbstractDiagramEditorActionBarContributor_7, "menu_connection_router");
viewMenu.add(connectionMenu);
connectionMenu.add(getAction(ConnectionRouterAction.BendPointConnectionRouterAction.ID));
// Doesn't work with Connection to Connection
// connectionMenu.add(getAction(ConnectionRouterAction.ShortestPathConnectionRouterAction.ID));
connectionMenu.add(getAction(ConnectionRouterAction.ManhattanConnectionRouterAction.ID));
viewMenu.add(new Separator());
if (!PlatformUtils.isMac()) {
viewMenu.add(getAction(FullScreenAction.ID));
viewMenu.add(new Separator());
}
menuManager.insertAfter(IWorkbenchActionConstants.M_EDIT, viewMenu);
return viewMenu;
}
use of org.eclipse.jface.action.MenuManager in project archi by archimatetool.
the class ArchimateDiagramEditor method registerContextMenu.
/**
* Set up and register the context menu
*/
@Override
protected void registerContextMenu(GraphicalViewer viewer) {
MenuManager provider = new ArchimateDiagramEditorContextMenuProvider(viewer, getActionRegistry());
viewer.setContextMenu(provider);
getSite().registerContextMenu(ArchimateDiagramEditorContextMenuProvider.ID, provider, viewer);
}
use of org.eclipse.jface.action.MenuManager in project archi by archimatetool.
the class ArchimateDiagramEditorActionBarContributor method contributeToEditMenu.
@Override
protected IMenuManager contributeToEditMenu(IMenuManager menuManager) {
IMenuManager editMenu = super.contributeToEditMenu(menuManager);
// Text Positions
IMenuManager textPositionMenu = new MenuManager(Messages.ArchimateDiagramEditorActionBarContributor_1);
for (String id : TextPositionAction.ACTION_IDS) {
textPositionMenu.add(getAction(id));
}
editMenu.appendToGroup(GROUP_EDIT_MENU, textPositionMenu);
editMenu.insertAfter(ArchiActionFactory.DELETE.getId(), new GroupMarker(editDeleteMenuGroup));
editMenu.appendToGroup(editDeleteMenuGroup, getAction(DeleteFromModelAction.ID));
return editMenu;
}
use of org.eclipse.jface.action.MenuManager in project archi by archimatetool.
the class ArchimateDiagramEditorContextMenuProvider method buildContextMenu.
/**
* @see ContextMenuProvider#buildContextMenu(org.eclipse.jface.action.IMenuManager)
*/
@Override
public void buildContextMenu(IMenuManager menu) {
super.buildContextMenu(menu);
// Delete from Model
menu.appendToGroup(GROUP_EDIT, actionRegistry.getAction(DeleteFromModelAction.ID));
// Select Element in Tree
menu.appendToGroup(GROUP_RENAME, new Separator());
menu.appendToGroup(GROUP_RENAME, actionRegistry.getAction(SelectElementInTreeAction.ID));
// Generate View For Element
menu.appendToGroup(GROUP_RENAME, actionRegistry.getAction(ArchiActionFactory.GENERATE_VIEW.getId()));
// Viewpoints
menu.appendToGroup(GROUP_CONNECTIONS, new Separator(GROUP_VIEWPOINTS));
IMenuManager viewPointMenu = new MenuManager(Messages.ArchimateDiagramEditorContextMenuProvider_0);
menu.appendToGroup(GROUP_VIEWPOINTS, viewPointMenu);
for (IViewpoint viewPoint : ViewpointManager.INSTANCE.getAllViewpoints()) {
viewPointMenu.add(actionRegistry.getAction(viewPoint.toString()));
}
}
Aggregations