Java 类org.eclipse.ui.IWorkbenchActionConstants 实例源码

项目:pgcodekeeper    文件:SQLEditorActionContributor.java   
@Override
public void contributeToMenu(IMenuManager menu) {
    super.contributeToMenu(menu);

    IMenuManager editMenu= menu.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT);
    if (editMenu != null) {
        editMenu.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, fContentAssist);
    }
}
项目:team-explorer-everywhere    文件:QueryEditorControl.java   
private void fillContextMenu(final IMenuManager manager) {
    final TableViewer tableViewer = getFocusedTableViewer();
    if (tableViewer != null) {
        final boolean itemsSelected = ((IStructuredSelection) tableViewer.getSelection()).size() > 0;
        final int[] boundaries = getSelectedRowBoundaries(tableViewer.getTable());
        final QEQueryRowCollection rows = getRowCollection(tableViewer);

        insertAction.setEnabled(true);
        deleteAction.setEnabled(itemsSelected);
        groupAction.setEnabled(itemsSelected && rows.getGrouping().canGroup(boundaries[0], boundaries[1]));
        ungroupAction.setEnabled(itemsSelected && rows.getGrouping().canUngroup(boundaries[0], boundaries[1]));

        manager.add(insertAction);
        manager.add(deleteAction);
        manager.add(groupAction);
        manager.add(ungroupAction);
        manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
    }
}
项目:team-explorer-everywhere    文件:TeamExplorerBaseSection.java   
public void registerContextMenu(
    final TeamExplorerContext context,
    final Control control,
    final ISelectionProvider provider) {
    final MenuManager contextMenuManager = new MenuManager("#PopupMenu"); //$NON-NLS-1$
    contextMenuManager.setRemoveAllWhenShown(false);
    contextMenuManager.add(new Separator("group1")); //$NON-NLS-1$
    contextMenuManager.add(new Separator("group2")); //$NON-NLS-1$
    contextMenuManager.add(new Separator("group3")); //$NON-NLS-1$
    contextMenuManager.add(new Separator("group4")); //$NON-NLS-1$
    contextMenuManager.add(new Separator("group5")); //$NON-NLS-1$
    contextMenuManager.add(new Separator("group6")); //$NON-NLS-1$
    contextMenuManager.add(new Separator("group7")); //$NON-NLS-1$
    contextMenuManager.add(new Separator("group8")); //$NON-NLS-1$
    contextMenuManager.add(new Separator("group9")); //$NON-NLS-1$
    contextMenuManager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));

    final Menu menu = contextMenuManager.createContextMenu(control);
    control.setMenu(menu);

    context.getWorkbenchPart().getSite().registerContextMenu(EXTENSION_POINT_ID, contextMenuManager, provider);
}
项目:team-explorer-everywhere    文件:QueueEditorPage.java   
protected void fillMenu(final IMenuManager menuMgr) {
    menuMgr.add(new Separator("group0")); //$NON-NLS-1$
    menuMgr.add(new Separator("group1")); //$NON-NLS-1$
    menuMgr.add(new Separator("group2")); //$NON-NLS-1$
    menuMgr.add(new GroupMarker("group2.top")); //$NON-NLS-1$
    menuMgr.add(new GroupMarker("group2.middle")); //$NON-NLS-1$
    menuMgr.add(new GroupMarker("group2.bottom")); //$NON-NLS-1$
    menuMgr.add(new Separator("group3")); //$NON-NLS-1$
    menuMgr.add(new Separator("group4")); //$NON-NLS-1$
    menuMgr.add(new Separator("group5")); //$NON-NLS-1$
    menuMgr.add(new Separator("group6")); //$NON-NLS-1$
    menuMgr.add(new Separator("group7")); //$NON-NLS-1$
    menuMgr.add(new Separator("group8")); //$NON-NLS-1$
    menuMgr.add(new Separator("group9")); //$NON-NLS-1$
    menuMgr.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}
项目:team-explorer-everywhere    文件:VersionControlEditor.java   
/**
 * Create the menu extension points to allow plugins (including this one) to
 * add menu items.
 */
private void registerMenus(final String menuId, final Control control, final ISelectionProvider selectionProvider) {
    final MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$
    menuMgr.setRemoveAllWhenShown(false);
    menuMgr.add(new Separator("group0")); //$NON-NLS-1$
    menuMgr.add(new Separator("group1")); //$NON-NLS-1$
    menuMgr.add(new Separator("group2")); //$NON-NLS-1$
    menuMgr.add(new Separator("group3")); //$NON-NLS-1$
    menuMgr.add(new Separator("group4")); //$NON-NLS-1$
    menuMgr.add(new Separator("group5")); //$NON-NLS-1$
    menuMgr.add(new Separator("group6")); //$NON-NLS-1$
    menuMgr.add(new Separator("group7")); //$NON-NLS-1$
    menuMgr.add(new Separator("group8")); //$NON-NLS-1$
    menuMgr.add(new Separator("group9")); //$NON-NLS-1$

    menuMgr.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
    final Menu menu = menuMgr.createContextMenu(control);
    control.setMenu(menu);
    getSite().registerContextMenu(menuId, menuMgr, selectionProvider);
}
项目:subclipse    文件:SvnPropertiesView.java   
/**
 * fill the popup menu for the table
 */
private void fillTableMenu(IMenuManager manager) {
    manager.add(getRefreshAction());

    Action action = getAddPropertyAction();
    try {       
        if (resource != null)
            action.setEnabled(resource.isManaged());
        else
            action.setEnabled(false);
    } catch (SVNException e) {
        action.setEnabled(false);
    }
    manager.add(action);

    manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}
项目:mesfavoris    文件:BookmarksView.java   
private void addRemoteBookmarksStoreActions(IMenuManager manager) {
    for (IRemoteBookmarksStore store : BookmarksPlugin.getDefault().getRemoteBookmarksStoreManager()
            .getRemoteBookmarksStores()) {
        MenuManager subMenu = new MenuManager(store.getDescriptor().getLabel(),
                ID + "." + store.getDescriptor().getId());
        AddToRemoteBookmarksStoreAction addToStoreAction = new AddToRemoteBookmarksStoreAction(eventBroker,
                bookmarksTreeViewer, store);
        RemoveFromRemoteBookmarksStoreAction removeFromStoreAction = new RemoveFromRemoteBookmarksStoreAction(
                eventBroker, bookmarksTreeViewer, store);
        subMenu.add(addToStoreAction);
        subMenu.add(removeFromStoreAction);
        // Other plug-ins can contribute there actions here
        subMenu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
        manager.add(subMenu);
    }
}
项目:ncl30-eclipse    文件:NCLActionContributor.java   
public void init(IActionBars bars) {
    super.init(bars);

    IMenuManager menuManager = bars.getMenuManager();
    IMenuManager editMenu = menuManager
            .findMenuUsingPath(IWorkbenchActionConstants.M_EDIT);
    if (editMenu != null) {
        editMenu.add(new Separator());
        editMenu.add(fContentAssistProposal);
        editMenu.add(fContentFormat);
        editMenu.add(fContentGotoLastEditPosition);
    }

    IToolBarManager toolBarManager = bars.getToolBarManager();
    if (toolBarManager != null) {
        toolBarManager.add(new Separator());
        // toolBarManager.add(fTogglePresentation);
    }
    bars.getToolBarManager().remove(ITextEditorActionConstants.DELETE);
}
项目:ForgedUI-Eclipse    文件:GUIEditorActionBarContributor.java   
/**
 * Just to make the zooming actions for the editor via the context menu.
 */
@Override
public void contributeToMenu(IMenuManager menuManager) {
    // TODO Auto-generated method stub
    super.contributeToMenu(menuManager);

    // Adding the zooming to the workbench while our editor is active.
    MenuManager zoomMenu = new MenuManager("Zoom");
    IAction zoomInAction = getAction(GEFActionConstants.ZOOM_IN);
    IAction zoomOutAction = getAction(GEFActionConstants.ZOOM_OUT);
    if (zoomInAction != null && zoomOutAction != null) {
        zoomMenu.add(zoomInAction);
        zoomMenu.add(zoomOutAction);
        menuManager.insertAfter(IWorkbenchActionConstants.M_EDIT,zoomMenu);
    }

    MenuManager mnu = new MenuManager ("view");
    mnu.add(getAction(GEFActionConstants.TOGGLE_GRID_VISIBILITY));
    menuManager.insertAfter(IWorkbenchActionConstants.M_EDIT, mnu);
}
项目:yamcs-studio    文件:YamcsStudioActionBarAdvisor.java   
@Override
protected void fillMenuBar(final IMenuManager menubar) {
    menubar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    IMenuManager windowMenu = new MenuManager("Window", IWorkbenchActionConstants.M_WINDOW);
    menubar.add(windowMenu);
    windowMenu.add(resetPerspectiveAction);
    windowMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    windowMenu.add(new Separator());
    windowMenu.add(preferencesAction);

    // plugin.xml in css menu.app defines a non-brandable icon.
    // through plugin.xml in this bundle, that help menu is hidden, and
    // we replace it here with another one (shorter) version
    IMenuManager helpMenu = new MenuManager("Help", "help-2");
    menubar.add(helpMenu);
    helpMenu.add(onlineHelpAction);
    helpMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    helpMenu.add(new Separator());
    helpMenu.add(raiseIssueAction);
    helpMenu.add(new Separator());
    helpMenu.add(aboutAction);
}
项目:triquetrum    文件:TriquetrumEditorAdvisor.java   
/**
 * Creates the 'File' menu. <!-- begin-user-doc --> <!-- end-user-doc -->
 * 
 * @generated
 */
protected IMenuManager createFileMenu(IWorkbenchWindow window) {
  IMenuManager menu = new MenuManager(getString("_UI_Menu_File_label"), IWorkbenchActionConstants.M_FILE);
  menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_START));

  IMenuManager newMenu = new MenuManager(getString("_UI_Menu_New_label"), "new");
  newMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));

  menu.add(newMenu);
  menu.add(new Separator());
  menu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
  menu.add(new Separator());
  addToMenuAndRegister(menu, ActionFactory.CLOSE.create(window));
  addToMenuAndRegister(menu, ActionFactory.CLOSE_ALL.create(window));
  menu.add(new Separator());
  addToMenuAndRegister(menu, ActionFactory.SAVE.create(window));
  addToMenuAndRegister(menu, ActionFactory.SAVE_AS.create(window));
  addToMenuAndRegister(menu, ActionFactory.SAVE_ALL.create(window));
  menu.add(new Separator());
  addToMenuAndRegister(menu, ActionFactory.QUIT.create(window));
  menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_END));
  return menu;
}
项目:triquetrum    文件:TriquetrumEditorAdvisor.java   
/**
 * Creates the 'Edit' menu. <!-- begin-user-doc --> <!-- end-user-doc -->
 * 
 * @generated
 */
protected IMenuManager createEditMenu(IWorkbenchWindow window) {
  IMenuManager menu = new MenuManager(getString("_UI_Menu_Edit_label"), IWorkbenchActionConstants.M_EDIT);
  menu.add(new GroupMarker(IWorkbenchActionConstants.EDIT_START));

  addToMenuAndRegister(menu, ActionFactory.UNDO.create(window));
  addToMenuAndRegister(menu, ActionFactory.REDO.create(window));
  menu.add(new GroupMarker(IWorkbenchActionConstants.UNDO_EXT));
  menu.add(new Separator());

  addToMenuAndRegister(menu, ActionFactory.CUT.create(window));
  addToMenuAndRegister(menu, ActionFactory.COPY.create(window));
  addToMenuAndRegister(menu, ActionFactory.PASTE.create(window));
  menu.add(new GroupMarker(IWorkbenchActionConstants.CUT_EXT));
  menu.add(new Separator());

  addToMenuAndRegister(menu, ActionFactory.DELETE.create(window));
  addToMenuAndRegister(menu, ActionFactory.SELECT_ALL.create(window));
  menu.add(new Separator());

  menu.add(new GroupMarker(IWorkbenchActionConstants.ADD_EXT));

  menu.add(new GroupMarker(IWorkbenchActionConstants.EDIT_END));
  menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
  return menu;
}
项目:dockerfoundry    文件:DockerContainersView.java   
private void fillContextMenu(IMenuManager manager) {
    DockerContainerElement elem = getSelectedElement();
    String status = null;
    if(elem != null)
        status = elem.getStatus();
    startAction.setEnabled(status != null && status.startsWith("Exited"));
    stopAction.setEnabled(status != null && status.startsWith("Up"));
    unpauseAction.setEnabled(status != null && status.startsWith("Paused"));
    pauseAction.setEnabled(status != null && status.startsWith("Up"));
    showConsoleAction.setEnabled(status != null && status.startsWith("Up"));
    showEnvAction.setEnabled(status != null && status.startsWith("Up"));
    showLinkAction.setEnabled(status != null && status.startsWith("Up"));
    manager.add(startAction);
    manager.add(stopAction);
    manager.add(unpauseAction);
    manager.add(pauseAction);
    manager.add(deleteAction);
    manager.add(inspectAction);
    manager.add(showConsoleAction);
    manager.add(showEnvAction);
    manager.add(showLinkAction);
    manager.add(refreshAction);

    // Other plug-ins can contribute there actions here
    manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}
项目:dockerfoundry    文件:DockerImagesView.java   
private void fillContextMenu(IMenuManager manager) {
    if(viewer.getSelection() instanceof IStructuredSelection){
        IStructuredSelection selection = (IStructuredSelection)viewer.getSelection();
        if(selection.size() <1)
            return;
        Object obj = selection.getFirstElement();
        System.out.println(obj);
        if(obj instanceof DockerImageElement){
            DockerImageElement elem = (DockerImageElement)obj;
        }
    }
    manager.add(pullImageAction);
    manager.add(pushmageAction);
    manager.add(createImageAction);
    manager.add(createContainerAction);
    manager.add(deleteImageAction);
    manager.add(inspectAction);
    manager.add(refreshAction);

    // Other plug-ins can contribute there actions here
    manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}
项目:mondo-demo-wt    文件:WTSpec4MEditorAdvisor.java   
/**
 * Creates the 'File' menu.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected IMenuManager createFileMenu(IWorkbenchWindow window) {
    IMenuManager menu = new MenuManager(getString("_UI_Menu_File_label"),
    IWorkbenchActionConstants.M_FILE);    
    menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_START));

    IMenuManager newMenu = new MenuManager(getString("_UI_Menu_New_label"), "new");
    newMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));

    menu.add(newMenu);
    menu.add(new Separator());
    menu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    menu.add(new Separator());
    addToMenuAndRegister(menu, ActionFactory.CLOSE.create(window));
    addToMenuAndRegister(menu, ActionFactory.CLOSE_ALL.create(window));
    menu.add(new Separator());
    addToMenuAndRegister(menu, ActionFactory.SAVE.create(window));
    addToMenuAndRegister(menu, ActionFactory.SAVE_AS.create(window));
    addToMenuAndRegister(menu, ActionFactory.SAVE_ALL.create(window));
    menu.add(new Separator());
    addToMenuAndRegister(menu, ActionFactory.QUIT.create(window));
    menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_END));
    return menu;
}
项目:org.csstudio.display.builder    文件:AxesTableHandler.java   
/** Add context menu to axes_table */
private void createContextMenu()
{
    final MenuManager menu = new MenuManager();
    menu.setRemoveAllWhenShown(true);
    menu.addMenuListener(new IMenuListener()
    {
        @Override
        public void menuAboutToShow(IMenuManager manager)
        {
            menu.add(new AddAxisAction(operations_manager, model));
            if (!axes_table.getSelection().isEmpty())
                menu.add(new DeleteAxesAction(operations_manager, axes_table, model));
            if (model.getEmptyAxis() != null)
                menu.add(new RemoveUnusedAxesAction(operations_manager, model));
            menu.add(new Separator());
            menu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
        }
    });
    final Table table = axes_table.getTable();
    table.setMenu(menu.createContextMenu(table));
}
项目:PDFReporter-Studio    文件:ApplicationActionBarAdvisor.java   
/**
 * Creates and returns the Project menu.
 */
private MenuManager createProjectMenu() {
    MenuManager menu = new MenuManager(
            IDEWorkbenchMessages.Workbench_project,
            IWorkbenchActionConstants.M_PROJECT);
    menu.add(new Separator(IWorkbenchActionConstants.PROJ_START));

    menu.add(getOpenProjectItem());
    menu.add(getCloseProjectItem());
    menu.add(new GroupMarker(IWorkbenchActionConstants.OPEN_EXT));
    menu.add(new Separator());
    menu.add(buildAllAction);
    menu.add(buildProjectAction);
    addWorkingSetBuildActions(menu);
    menu.add(cleanAction);
    menu.add(toggleAutoBuildAction);
    menu.add(new GroupMarker(IWorkbenchActionConstants.BUILD_EXT));
    menu.add(new Separator());

    menu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    menu.add(new GroupMarker(IWorkbenchActionConstants.PROJ_END));
    menu.add(new Separator());
    menu.add(projectPropertyDialogAction);
    return menu;
}
项目:PDFReporter-Studio    文件:ApplicationActionBarAdvisor.java   
/**
 * Creates and returns the Window menu.
 */
private MenuManager createWindowMenu() {
    MenuManager menu = new MenuManager(
            IDEWorkbenchMessages.Workbench_window,
            IWorkbenchActionConstants.M_WINDOW);

    menu.add(newWindowAction);
    menu.add(newEditorAction);

    menu.add(new Separator());
    addPerspectiveActions(menu);
    menu.add(new Separator());
    addKeyboardShortcuts(menu);
    Separator sep = new Separator(IWorkbenchActionConstants.MB_ADDITIONS);
    sep.setVisible(!Util.isMac());
    menu.add(sep);

    // See the comment for quit in createFileMenu
    ActionContributionItem openPreferencesItem = new ActionContributionItem(
            openPreferencesAction);
    openPreferencesItem.setVisible(!Util.isMac());
    menu.add(openPreferencesItem);

    menu.add(ContributionItemFactory.OPEN_WINDOWS.create(getWindow()));
    return menu;
}
项目:PDFReporter-Studio    文件:ApplicationActionBarAdvisor.java   
/**
 * Update the pin action's tool bar
 */
void updatePinActionToolbar() {

    ICoolBarManager coolBarManager = getActionBarConfigurer()
            .getCoolBarManager();
    IContributionItem cbItem = coolBarManager
            .find(IWorkbenchActionConstants.TOOLBAR_NAVIGATE);
    if (!(cbItem instanceof IToolBarContributionItem)) {
        // This should not happen
        IDEWorkbenchPlugin
                .log("Navigation toolbar contribution item is missing"); //$NON-NLS-1$
        return;
    }
    IToolBarContributionItem toolBarItem = (IToolBarContributionItem) cbItem;
    IToolBarManager toolBarManager = toolBarItem.getToolBarManager();
    if (toolBarManager == null) {
        // error if this happens, navigation toolbar assumed to always exist
        IDEWorkbenchPlugin.log("Navigate toolbar is missing"); //$NON-NLS-1$
        return;
    }

    toolBarManager.update(false);
    toolBarItem.update(ICoolBarManager.SIZE);
}
项目:PDFReporter-Studio    文件:JrxmlEditorContributor.java   
public void contributeToMenu(IMenuManager manager) {
    super.contributeToMenu(manager);

    MenuManager viewMenu = new MenuManager(Messages.JrxmlEditorContributor_view);
    viewMenu.add(getAction(GEFActionConstants.ZOOM_IN));
    viewMenu.add(getAction(GEFActionConstants.ZOOM_OUT));
    viewMenu.add(new Separator());
    viewMenu.add(getAction(GEFActionConstants.TOGGLE_RULER_VISIBILITY));
    viewMenu.add(getAction(SnapToGuidesAction.ID));
    viewMenu.add(new Separator());
    viewMenu.add(getAction(GEFActionConstants.TOGGLE_GRID_VISIBILITY));
    viewMenu.add(getAction(SnapToGridAction.ID));
    viewMenu.add(getAction(GEFActionConstants.TOGGLE_SNAP_TO_GEOMETRY));
    viewMenu.add(getAction(SizeGridAction.ID));

    JaspersoftStudioPlugin.getDecoratorManager().contribute2Menu(getActionRegistry(), viewMenu);

    manager.insertAfter(IWorkbenchActionConstants.M_EDIT, viewMenu);
}
项目:gama    文件:GamaActionBarAdvisor.java   
/**
 * Creates and returns the Edit menu.
 */
private MenuManager createEditMenu() {
    final MenuManager menu = new MenuManager(IDEWorkbenchMessages.Workbench_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());
    menu.add(getCutItem());
    menu.add(getCopyItem());
    menu.add(getPasteItem());
    menu.add(new GroupMarker(IWorkbenchActionConstants.CUT_EXT));
    menu.add(new Separator());
    menu.add(getDeleteItem());
    menu.add(getSelectAllItem());
    menu.add(new Separator());
    menu.add(getFindItem());
    menu.add(new GroupMarker(IWorkbenchActionConstants.FIND_EXT));
    menu.add(new Separator());
    menu.add(new GroupMarker(IWorkbenchActionConstants.ADD_EXT));
    menu.add(new GroupMarker(IWorkbenchActionConstants.EDIT_END));
    menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
    return menu;
}
项目:gama    文件:GamaActionBarAdvisor.java   
/**
 * Creates and returns the Help menu.
 */
private MenuManager createHelpMenu() {
    final MenuManager menu = new MenuManager(IDEWorkbenchMessages.Workbench_help, IWorkbenchActionConstants.M_HELP);
    addSeparatorOrGroupMarker(menu, "group.intro"); //$NON-NLS-1$
    menu.add(new GroupMarker("group.intro.ext")); //$NON-NLS-1$
    addSeparatorOrGroupMarker(menu, "group.main"); //$NON-NLS-1$
    menu.add(helpContentsAction);
    addSeparatorOrGroupMarker(menu, "group.assist"); //$NON-NLS-1$
    menu.add(new GroupMarker(IWorkbenchActionConstants.HELP_START));
    menu.add(new GroupMarker("group.main.ext")); //$NON-NLS-1$
    addSeparatorOrGroupMarker(menu, "group.tutorials"); //$NON-NLS-1$
    addSeparatorOrGroupMarker(menu, "group.tools"); //$NON-NLS-1$
    addSeparatorOrGroupMarker(menu, "group.updates"); //$NON-NLS-1$
    menu.add(new GroupMarker(IWorkbenchActionConstants.HELP_END));
    addSeparatorOrGroupMarker(menu, IWorkbenchActionConstants.MB_ADDITIONS);
    // about should always be at the bottom
    menu.add(new Separator("group.about")); //$NON-NLS-1$

    final ActionContributionItem aboutItem = new ActionContributionItem(aboutAction);
    aboutItem.setVisible(!Util.isMac());
    menu.add(aboutItem);
    menu.add(new GroupMarker("group.about.ext")); //$NON-NLS-1$
    menu.add(openPreferencesAction);
    return menu;
}
项目:limpet    文件:ApplicationActionBarAdvisor.java   
/**
 * Creates and returns the Window menu.
 */
private MenuManager createWindowMenu()
{
  MenuManager menu =
      new MenuManager(IDEWorkbenchMessages.Workbench_window,
          IWorkbenchActionConstants.M_WINDOW);

  menu.add(newWindowAction);
  menu.add(newEditorAction);

  menu.add(new Separator());
  addPerspectiveActions(menu);
  menu.add(new Separator());
  Separator sep = new Separator(IWorkbenchActionConstants.MB_ADDITIONS);
  sep.setVisible(!Util.isMac());
  menu.add(sep);

  menu.add(ContributionItemFactory.OPEN_WINDOWS.create(getWindow()));
  return menu;
}
项目:limpet    文件:ApplicationActionBarAdvisor.java   
/**
 * Update the pin action's tool bar
 */
void updatePinActionToolbar()
{

  ICoolBarManager coolBarManager =
      getActionBarConfigurer().getCoolBarManager();
  IContributionItem cbItem =
      coolBarManager.find(IWorkbenchActionConstants.TOOLBAR_NAVIGATE);
  if (!(cbItem instanceof IToolBarContributionItem))
  {
    // This should not happen
    IDEWorkbenchPlugin.log("Navigation toolbar contribution item is missing"); //$NON-NLS-1$
    return;
  }
  IToolBarContributionItem toolBarItem = (IToolBarContributionItem) cbItem;
  IToolBarManager toolBarManager = toolBarItem.getToolBarManager();
  if (toolBarManager == null)
  {
    // error if this happens, navigation toolbar assumed to always exist
    IDEWorkbenchPlugin.log("Navigate toolbar is missing"); //$NON-NLS-1$
    return;
  }

  toolBarManager.update(false);
  toolBarItem.update(ICoolBarManager.SIZE);
}
项目:APICloud-Studio    文件:SvnPropertiesView.java   
/**
 * fill the popup menu for the table
 */
private void fillTableMenu(IMenuManager manager) {
    manager.add(getRefreshAction());

    Action action = getAddPropertyAction();
    try {       
        if (resource != null)
            action.setEnabled(resource.isManaged());
        else
            action.setEnabled(false);
    } catch (SVNException e) {
        action.setEnabled(false);
    }
    manager.add(action);

    manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}
项目:OpenSPIFe    文件:EnsembleActionBarAdvisor.java   
/**
 * Create the file, edit, window, view, and help menu items.
 * 
 * @param menuBar The application's menu bar.
 */
@Override
protected void fillMenuBar(IMenuManager menuBar) {
    IMenuManager menu = createFileMenu();
    if (menu != null) menuBar.add(menu);
    menu = createEditMenu();
    if (menu != null) menuBar.add(menu);
    menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    menu = createWindowMenu();
    if (menu != null) menuBar.add(menu);
    menu = createViewMenu();
    if (menu != null) menuBar.add(menu);
    menu = createAdminMenu();
    if (menu != null) menuBar.add(menu);
    menu = createHelpMenu();
    if (menu != null) menuBar.add(menu);
}
项目:OpenSPIFe    文件:EnsembleActionBarAdvisor.java   
/**
     * Create the "Edit" menu. This adds the undo, redo, cut, copy, paste,
     * delete, select all, and collapse all options to the menu.
     * 
     * @param window
     * @return
     */
    protected IMenuManager createEditMenu() {
        IMenuManager menu = new MenuManager(IDEWorkbenchMessages.Workbench_edit, IWorkbenchActionConstants.M_EDIT);
        menu.add(new GroupMarker(IWorkbenchActionConstants.EDIT_START));
        menu.add(getGlobalAction(ActionFactory.UNDO));
        menu.add(getGlobalAction(ActionFactory.REDO));
        menu.add(new GroupMarker(IWorkbenchActionConstants.UNDO_EXT));
        menu.add(new Separator());
        menu.add(getGlobalAction(ActionFactory.CUT));
        menu.add(getGlobalAction(ActionFactory.COPY));
        menu.add(getGlobalAction(ActionFactory.PASTE));
//      menu.add(getGlobalAction(EnsembleActionFactory.PASTE_SPECIAL));
        menu.add(new GroupMarker(IWorkbenchActionConstants.CUT_EXT));
        menu.add(new Separator());
        menu.add(getGlobalAction(ActionFactory.DELETE));
        menu.add(getGlobalAction(ActionFactory.SELECT_ALL));
        menu.add(new Separator());
        menu.add(getGlobalAction(ActionFactory.FIND));
        menu.add(new GroupMarker(IWorkbenchActionConstants.FIND_EXT));
        menu.add(new Separator());
        menu.add(new GroupMarker(IWorkbenchActionConstants.ADD_EXT));
        menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
        menu.add(new GroupMarker(IWorkbenchActionConstants.EDIT_END));
        return menu;
    }
项目:OpenSPIFe    文件:EnsembleActionBarAdvisor.java   
/**
 * Create the "Help" menu.
 * 
 * @param window
 * @return the help MenuManager
 */
protected IMenuManager createHelpMenu() {
    IMenuManager menu = new MenuManager(IDEWorkbenchMessages.Workbench_help, IWorkbenchActionConstants.M_HELP);
    menu.add(new GroupMarker(IWorkbenchActionConstants.HELP_START));
       menu.add(new Separator());
       menu.add(getGlobalAction(ActionFactory.DYNAMIC_HELP));
       menu.add(getGlobalAction(ActionFactory.HELP_CONTENTS));
    menu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    menu.add(new GroupMarker(IWorkbenchActionConstants.HELP_END));
       menu.add(new Separator());
       IWorkbenchAction about = getGlobalAction(ActionFactory.ABOUT);
    ActionContributionItem aboutItem = new ActionContributionItem(about);
    menu.add(aboutItem);
    if (Platform.OS_MACOSX.equals(Platform.getOS())) {
        aboutItem.setVisible(false);
    }
    return menu;
}
项目:birt    文件:ParametersNodeProvider.java   
/**
 * Creates the context menu for the given object. Gets the action from the
 * actionRegistry for the given object and adds them to the menu
 * 
 * @param menu
 *            the menu
 * @param object
 *            the object
 */
public void createContextMenu( TreeViewer sourceViewer, Object object,
        IMenuManager menu )
{
    // Add new parameter action
    menu.add( new InsertAction( object,
            Messages.getString( "ParametersNodeProvider.menu.text.parameter" ), //$NON-NLS-1$
            ReportDesignConstants.SCALAR_PARAMETER_ELEMENT ) );

    // Add new parameter action
    menu.add( new InsertAction( object,
            Messages.getString( "ParametersNodeProvider.menu.text.cascadingParameter" ), //$NON-NLS-1$
            ReportDesignConstants.CASCADING_PARAMETER_GROUP_ELEMENT ) );

    // Add new parameter group action
    menu.add( new InsertAction( object,
            Messages.getString( "ParametersNodeProvider.menu.text.group" ), //$NON-NLS-1$
            ReportDesignConstants.PARAMETER_GROUP_ELEMENT ) );

    menu.add( new Separator( IWorkbenchActionConstants.MB_ADDITIONS
            + "-parameters" ) ); //$NON-NLS-1$

    super.createContextMenu( sourceViewer, object, menu );
}
项目:OpenSPIFe    文件:AbstractEnsembleEditorPart.java   
/**
     * Create the context menu for an ensemble editor part.
     * @see EnsembleActionBarAdvisor.createEditMenu
     * @param menu
     */
    public void fillContextMenu(IMenuManager menu) {
        menu.add(new GroupMarker(IWorkbenchActionConstants.EDIT_START));
        menu.add(new Separator());
        menu.add(undoHandler);
        menu.add(redoHandler);
        menu.add(new GroupMarker(IWorkbenchActionConstants.UNDO_EXT));
        menu.add(new Separator());
        menu.add(cutHandler);
        menu.add(copyHandler);
        menu.add(pasteHandler);
//      menu.add(pasteSpecialHandler);
        menu.add(new GroupMarker(IWorkbenchActionConstants.CUT_EXT));
        menu.add(new Separator());
        menu.add(deleteHandler);
        menu.add(selectAllHandler);
        menu.add(new Separator());

        menu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
        menu.add(new GroupMarker(IWorkbenchActionConstants.EDIT_END));
        updateActionBars(getEditorSite().getActionBars());
    }
项目:OpenSPIFe    文件:DictionaryEditorAdvisor.java   
/**
 * Creates the 'File' menu.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected IMenuManager createFileMenu(IWorkbenchWindow window) {
    IMenuManager menu = new MenuManager(getString("_UI_Menu_File_label"),
    IWorkbenchActionConstants.M_FILE);    
    menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_START));

    IMenuManager newMenu = new MenuManager(getString("_UI_Menu_New_label"), "new");
    newMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));

    menu.add(newMenu);
    menu.add(new Separator());
    menu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    menu.add(new Separator());
    addToMenuAndRegister(menu, ActionFactory.CLOSE.create(window));
    addToMenuAndRegister(menu, ActionFactory.CLOSE_ALL.create(window));
    menu.add(new Separator());
    addToMenuAndRegister(menu, ActionFactory.SAVE.create(window));
    addToMenuAndRegister(menu, ActionFactory.SAVE_AS.create(window));
    addToMenuAndRegister(menu, ActionFactory.SAVE_ALL.create(window));
    menu.add(new Separator());
    addToMenuAndRegister(menu, ActionFactory.QUIT.create(window));
    menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_END));
    return menu;
}
项目:Eclipse-Postfix-Code-Completion    文件:PackageExplorerActionGroup.java   
private void setGlobalActionHandlers(IActionBars actionBars) {
    // Navigate Go Into and Go To actions.
    actionBars.setGlobalActionHandler(IWorkbenchActionConstants.GO_INTO, fZoomInAction);
    actionBars.setGlobalActionHandler(ActionFactory.BACK.getId(), fBackAction);
    actionBars.setGlobalActionHandler(ActionFactory.FORWARD.getId(), fForwardAction);
    actionBars.setGlobalActionHandler(IWorkbenchActionConstants.UP, fUpAction);
    actionBars.setGlobalActionHandler(IWorkbenchActionConstants.GO_TO_RESOURCE, fGotoResourceAction);
    actionBars.setGlobalActionHandler(JdtActionConstants.GOTO_TYPE, fGotoTypeAction);
    actionBars.setGlobalActionHandler(JdtActionConstants.GOTO_PACKAGE, fGotoPackageAction);
    actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), fSelectAllAction);

    fRefactorActionGroup.retargetFileMenuActions(actionBars);

    IHandlerService handlerService= (IHandlerService) fPart.getViewSite().getService(IHandlerService.class);
    handlerService.activateHandler(IWorkbenchCommandConstants.NAVIGATE_TOGGLE_LINK_WITH_EDITOR, new ActionHandler(fToggleLinkingAction));
    handlerService.activateHandler(CollapseAllHandler.COMMAND_ID, new ActionHandler(fCollapseAllAction));
}
项目:Eclipse-Postfix-Code-Completion    文件:CommonLayoutActionGroup.java   
@Override
public void fillActionBars(IActionBars actionBars) {
    if (!fHasContributedToViewMenu) {

        IMenuManager viewMenu = actionBars.getMenuManager();
        // Create layout sub menu
        if (fLayoutSubMenu == null) {
            fLayoutSubMenu = new MenuManager(PackagesMessages.LayoutActionGroup_label);
            addActions(fLayoutSubMenu);

            viewMenu.insertAfter(IWorkbenchActionConstants.MB_ADDITIONS, new Separator(LAYOUT_GROUP_NAME));
        }

        viewMenu.appendToGroup(LAYOUT_GROUP_NAME, fLayoutSubMenu);

        fHasContributedToViewMenu = true;
    }
}
项目:translationstudio8    文件:ApplicationActionBarAdvisor.java   
/**
 * 创建编辑菜单
 * @return 返回编辑菜单的 menu manager;
 */
private MenuManager createEditMenu() {
    MenuManager menu = new MenuManager(Messages.getString("ts.ApplicationActionBarAdvisor.menu.edit"),
            IWorkbenchActionConstants.M_EDIT); // &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());
    menu.add(cutAction);
    menu.add(copyAction);
    menu.add(pasteAction);
    menu.add(new GroupMarker(IWorkbenchActionConstants.CUT_EXT));
    // menu.add(deleteAction);
    menu.add(renameAction);
    menu.add(new Separator());
    menu.add(findAction);
    menu.add(selectAllAction);
    menu.add(new GroupMarker(IWorkbenchActionConstants.FIND_EXT));
    // menu.add(new Separator());
    // menu.add(preferenceAction);
    menu.add(new GroupMarker(IWorkbenchActionConstants.EDIT_END));
    return menu;
}
项目:birt    文件:StylesNodeProvider.java   
/**
 * Creates the context menu for the given object.
 * 
 * @param menu
 *            the menu
 * @param object
 *            the object
 */
public void createContextMenu( TreeViewer sourceViewer, Object object,
        IMenuManager menu )
{
    menu.add( new InsertAction( object,
            Messages.getString( "StylesNodeProvider.action.New" ) ) ); //$NON-NLS-1$
    super.createContextMenu( sourceViewer, object, menu );

    menu.insertAfter( IWorkbenchActionConstants.MB_ADDITIONS,
            new Separator( ) );

    menu.insertAfter( IWorkbenchActionConstants.MB_ADDITIONS,
            new ImportCSSStyleAction( object ) ); //$NON-NLS-1$

    menu.insertAfter( IWorkbenchActionConstants.MB_ADDITIONS,
            new ReloadCssStyleAction( object ) );
    menu.insertAfter( IWorkbenchActionConstants.MB_ADDITIONS,new UseCssStyleAction(object) );

}
项目:LiquibaseEditor    文件:DbchangelogEditorAdvisor.java   
/**
 * Creates the 'File' menu.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected IMenuManager createFileMenu(IWorkbenchWindow window) {
    IMenuManager menu = new MenuManager(getString("_UI_Menu_File_label"),
    IWorkbenchActionConstants.M_FILE);    
    menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_START));

    IMenuManager newMenu = new MenuManager(getString("_UI_Menu_New_label"), "new");
    newMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));

    menu.add(newMenu);
    menu.add(new Separator());
    menu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    menu.add(new Separator());
    addToMenuAndRegister(menu, ActionFactory.CLOSE.create(window));
    addToMenuAndRegister(menu, ActionFactory.CLOSE_ALL.create(window));
    menu.add(new Separator());
    addToMenuAndRegister(menu, ActionFactory.SAVE.create(window));
    addToMenuAndRegister(menu, ActionFactory.SAVE_AS.create(window));
    addToMenuAndRegister(menu, ActionFactory.SAVE_ALL.create(window));
    menu.add(new Separator());
    addToMenuAndRegister(menu, ActionFactory.QUIT.create(window));
    menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_END));
    return menu;
}
项目:karaf-eik    文件:BundlesView.java   
protected void initContextMenu() {
    final MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$
    menuMgr.setRemoveAllWhenShown(true);
    menuMgr.addMenuListener(new IMenuListener() {
        @Override
        public void menuAboutToShow(final IMenuManager manager) {
            menuMgr.add(propertiesAction);
            menuMgr.add(new Separator());
            menuMgr.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
        }
    });

    final Menu menu = menuMgr.createContextMenu(treeTableViewer.getControl());
    treeTableViewer.getControl().setMenu(menu);
    getSite().registerContextMenu(menuMgr, treeTableViewer);
}
项目:idecore    文件:ApexActionContributor.java   
@Override
public void init(IActionBars bars) {
    super.init(bars);

    IMenuManager menuManager = bars.getMenuManager();
    IMenuManager editMenu = menuManager.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT);
    if (editMenu != null) {
        editMenu.add(new Separator());
        editMenu.add(fContentAssistProposal);
        editMenu.add(fContentAssistTip);
    }

    IToolBarManager toolBarManager = bars.getToolBarManager();
    if (toolBarManager != null) {
        toolBarManager.add(new Separator());
        toolBarManager.add(fTogglePresentation);
    }
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:PackageExplorerActionGroup.java   
private void setGlobalActionHandlers(IActionBars actionBars) {
    // Navigate Go Into and Go To actions.
    actionBars.setGlobalActionHandler(IWorkbenchActionConstants.GO_INTO, fZoomInAction);
    actionBars.setGlobalActionHandler(ActionFactory.BACK.getId(), fBackAction);
    actionBars.setGlobalActionHandler(ActionFactory.FORWARD.getId(), fForwardAction);
    actionBars.setGlobalActionHandler(IWorkbenchActionConstants.UP, fUpAction);
    actionBars.setGlobalActionHandler(IWorkbenchActionConstants.GO_TO_RESOURCE, fGotoResourceAction);
    actionBars.setGlobalActionHandler(JdtActionConstants.GOTO_TYPE, fGotoTypeAction);
    actionBars.setGlobalActionHandler(JdtActionConstants.GOTO_PACKAGE, fGotoPackageAction);
    actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), fSelectAllAction);

    fRefactorActionGroup.retargetFileMenuActions(actionBars);

    IHandlerService handlerService= (IHandlerService) fPart.getViewSite().getService(IHandlerService.class);
    handlerService.activateHandler(IWorkbenchCommandConstants.NAVIGATE_TOGGLE_LINK_WITH_EDITOR, new ActionHandler(fToggleLinkingAction));
    handlerService.activateHandler(CollapseAllHandler.COMMAND_ID, new ActionHandler(fCollapseAllAction));
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:CommonLayoutActionGroup.java   
@Override
public void fillActionBars(IActionBars actionBars) {
    if (!fHasContributedToViewMenu) {

        IMenuManager viewMenu = actionBars.getMenuManager();
        // Create layout sub menu
        if (fLayoutSubMenu == null) {
            fLayoutSubMenu = new MenuManager(PackagesMessages.LayoutActionGroup_label);
            addActions(fLayoutSubMenu);

            viewMenu.insertAfter(IWorkbenchActionConstants.MB_ADDITIONS, new Separator(LAYOUT_GROUP_NAME));
        }

        viewMenu.appendToGroup(LAYOUT_GROUP_NAME, fLayoutSubMenu);

        fHasContributedToViewMenu = true;
    }
}