use of org.eclipse.jface.action.GroupMarker 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.ArchiActionBarAdvisor_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));
// $NON-NLS-1$
menu.add(new GroupMarker("support_start"));
menu.add(fDonateAction);
menu.add(fActionCheckForNewVersion);
// $NON-NLS-1$
menu.add(new Separator("support_end"));
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.GroupMarker 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(getAction(GEFActionConstants.MATCH_SIZE));
alignmentMenu.add(new Separator());
alignmentMenu.add(getAction(DefaultEditPartSizeAction.ID));
alignmentMenu.add(getAction(ResetAspectRatioAction.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.GroupMarker in project archi by archimatetool.
the class AbstractDiagramEditorActionBarContributor method contributeToToolBar.
@Override
public void contributeToToolBar(IToolBarManager toolBarManager) {
// Add the Zoom Manager Combo
fZoomCombo = new ZoomComboContributionItem(getPage()) {
// Hook into the Combo so we can disable global edit action handlers when it gets the focus
private GlobalActionDisablementHandler globalActionHandler;
@Override
protected Control createControl(Composite parent) {
Combo combo = (Combo) super.createControl(parent);
combo.addFocusListener(new FocusListener() {
@Override
public void focusGained(FocusEvent e) {
globalActionHandler = new GlobalActionDisablementHandler(getActionBars());
globalActionHandler.clearGlobalActions();
}
@Override
public void focusLost(FocusEvent e) {
if (globalActionHandler != null) {
globalActionHandler.restoreGlobalActions();
}
}
});
return combo;
}
@Override
protected int computeWidth(Control control) {
// On Linux GTK this can get too wide
return Math.min(super.computeWidth(control), 100);
}
};
toolBarManager.add(fZoomCombo);
toolBarManager.add(new Separator());
toolBarManager.add(getAction(GEFActionConstants.ALIGN_LEFT));
toolBarManager.add(getAction(GEFActionConstants.ALIGN_CENTER));
toolBarManager.add(getAction(GEFActionConstants.ALIGN_RIGHT));
toolBarManager.add(new Separator());
toolBarManager.add(getAction(GEFActionConstants.ALIGN_TOP));
toolBarManager.add(getAction(GEFActionConstants.ALIGN_MIDDLE));
toolBarManager.add(getAction(GEFActionConstants.ALIGN_BOTTOM));
toolBarManager.add(new Separator());
toolBarManager.add(getAction(GEFActionConstants.MATCH_WIDTH));
toolBarManager.add(getAction(GEFActionConstants.MATCH_HEIGHT));
toolBarManager.add(getAction(GEFActionConstants.MATCH_SIZE));
toolBarManager.add(new Separator());
toolBarManager.add(getAction(DefaultEditPartSizeAction.ID));
toolBarManager.add(getAction(ResetAspectRatioAction.ID));
toolBarManager.add(new GroupMarker(GROUP_TOOLBAR_END));
}
use of org.eclipse.jface.action.GroupMarker in project archi by archimatetool.
the class ArchiActionBarAdvisor method createFileMenu.
/**
* Create the File menu
* @return
*/
private MenuManager createFileMenu() {
IWorkbenchWindow window = getActionBarConfigurer().getWindowConfigurer().getWindow();
MenuManager menu = new MenuManager(Messages.ArchiActionBarAdvisor_8, IWorkbenchActionConstants.M_FILE);
menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_START));
// New
// $NON-NLS-1$
MenuManager newMenu = new MenuManager(Messages.ArchiActionBarAdvisor_9, "new_menu");
menu.add(newMenu);
newMenu.add(fActionNewArchimateModel);
// $NON-NLS-1$
newMenu.add(new GroupMarker("new_menu.ext"));
menu.add(new GroupMarker(IWorkbenchActionConstants.NEW_EXT));
menu.add(fActionOpenModel);
// Open Recent
MenuManager openRecentMenu = new MRUMenuManager(window);
menu.add(openRecentMenu);
menu.add(new Separator());
menu.add(fActionOpenDiagram);
menu.add(fActionCloseModel);
menu.add(fActionCloseEditor);
menu.add(fActionCloseAllEditors);
menu.add(new GroupMarker(IWorkbenchActionConstants.CLOSE_EXT));
menu.add(new Separator());
menu.add(fActionSave);
menu.add(fActionSaveAs);
menu.add(new GroupMarker(IWorkbenchActionConstants.SAVE_EXT));
menu.add(new Separator());
menu.add(fActionPrint);
menu.add(new Separator());
// $NON-NLS-1$
MenuManager importMenu = new MenuManager(Messages.ArchiActionBarAdvisor_10, "import_menu");
menu.add(importMenu);
addImportModelExtensionMenuItems(window, importMenu);
// $NON-NLS-1$
importMenu.add(new GroupMarker("import_ext"));
importMenu.add(new Separator());
// $NON-NLS-1$
MenuManager exportMenu = new MenuManager(Messages.ArchiActionBarAdvisor_11, "export_menu");
menu.add(exportMenu);
addExportModelExtensionMenuItems(window, exportMenu);
// $NON-NLS-1$
exportMenu.add(new GroupMarker("export_ext"));
exportMenu.add(new Separator());
// $NON-NLS-1$
MenuManager reportMenu = new MenuManager(Messages.ArchiActionBarAdvisor_12, "report_menu");
menu.add(reportMenu);
// $NON-NLS-1$
reportMenu.add(new GroupMarker("report_ext"));
menu.add(new Separator());
menu.add(fActionProperties);
menu.add(new Separator());
// Quit action not needed on a Mac
if (!PlatformUtils.isMac()) {
menu.add(fActionQuit);
}
menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_END));
return menu;
}
use of org.eclipse.jface.action.GroupMarker in project core by jcryptool.
the class ApplicationActionBarAdvisor method createEditMenu.
private IMenuManager createEditMenu() {
MenuManager menu = new MenuManager(Messages.applicationActionBarAdvisor_Menu_Edit, IWorkbenchActionConstants.M_EDIT);
menu.add(new GroupMarker(IWorkbenchActionConstants.EDIT_START));
IServiceLocator serviceLocator = PlatformUI.getWorkbench();
// undo, redo
menu.add(createContributionItem(serviceLocator, null, IWorkbenchCommandConstants.EDIT_UNDO));
menu.add(createContributionItem(serviceLocator, null, IWorkbenchCommandConstants.EDIT_REDO));
menu.add(new GroupMarker(IWorkbenchActionConstants.UNDO_EXT));
menu.add(new Separator());
// cut, copy, paste
menu.add(createContributionItem(serviceLocator, null, IWorkbenchCommandConstants.EDIT_CUT));
menu.add(createContributionItem(serviceLocator, null, IWorkbenchCommandConstants.EDIT_COPY));
menu.add(createContributionItem(serviceLocator, null, IWorkbenchCommandConstants.EDIT_PASTE));
menu.add(new GroupMarker(IWorkbenchActionConstants.CUT_EXT));
menu.add(new Separator());
// delete, select all
menu.add(createContributionItem(serviceLocator, null, IWorkbenchCommandConstants.EDIT_DELETE));
menu.add(createContributionItem(serviceLocator, null, IWorkbenchCommandConstants.EDIT_SELECT_ALL));
menu.add(new Separator());
// find
menu.add(createContributionItem(serviceLocator, null, IWorkbenchCommandConstants.EDIT_FIND_AND_REPLACE));
menu.add(new GroupMarker(IWorkbenchActionConstants.FIND_EXT));
menu.add(new GroupMarker(IWorkbenchActionConstants.ADD_EXT));
// provide a uniform location for the "show in" or "open with" actions
// $NON-NLS-1$
MenuManager showin = new MenuManager(Messages.ApplicationActionBarAdvisor_1, "showin");
// $NON-NLS-1$
showin.add(new GroupMarker("start"));
menu.add(showin);
menu.add(new GroupMarker(IWorkbenchActionConstants.EDIT_END));
menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
return menu;
}
Aggregations