org.eclipse.ui.actions.ContributionItemFactory#org.eclipse.ui.IWorkbenchActionConstants源码实例Demo

下面列出了org.eclipse.ui.actions.ContributionItemFactory#org.eclipse.ui.IWorkbenchActionConstants 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: elexis-3-core   文件: FindingsComposite.java
private void fillContextMenu(IMenuManager contextMenu, FindingsTemplate findingsTemplate){
	contextMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
	contextMenu.add(new Action("Entfernen") {
		
		@Override
		public ImageDescriptor getImageDescriptor(){
			return Images.IMG_DELETE.getImageDescriptor();
		}
		
		@Override
		public void run(){
			if (getModel().isPresent()) {
				
				EcoreUtil.delete(findingsTemplate);
				getViewer().refresh();
			}
		}
	});
}
 
源代码2 项目: eclipse-cs   文件: GraphStatsView.java
/**
 * Adds the actions to the tableviewer context menu.
 *
 * @param actions
 *          a collection of IAction objets
 */
private void hookContextMenu(final Collection<Object> actions, StructuredViewer viewer) {
  MenuManager menuMgr = new MenuManager();
  menuMgr.setRemoveAllWhenShown(true);
  menuMgr.addMenuListener(new IMenuListener() {
    @Override
    public void menuAboutToShow(IMenuManager manager) {
      for (Iterator<Object> iter = actions.iterator(); iter.hasNext();) {
        Object item = iter.next();
        if (item instanceof IContributionItem) {
          manager.add((IContributionItem) item);
        } else if (item instanceof IAction) {
          manager.add((IAction) item);
        }
      }
      manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
    }
  });
  Menu menu = menuMgr.createContextMenu(viewer.getControl());
  viewer.getControl().setMenu(menu);

  getSite().registerContextMenu(menuMgr, viewer);
}
 
源代码3 项目: eclipse-cs   文件: MarkerStatsView.java
/**
 * Adds the actions to the tableviewer context menu.
 *
 * @param actions
 *          a collection of IAction objets
 */
private void hookContextMenu(final Collection<Object> actions, StructuredViewer viewer) {
  MenuManager menuMgr = new MenuManager();
  menuMgr.setRemoveAllWhenShown(true);
  menuMgr.addMenuListener(new IMenuListener() {
    @Override
    public void menuAboutToShow(IMenuManager manager) {
      for (Iterator<Object> iter = actions.iterator(); iter.hasNext();) {
        Object item = iter.next();
        if (item instanceof IContributionItem) {
          manager.add((IContributionItem) item);
        } else if (item instanceof IAction) {
          manager.add((IAction) item);
        }
      }
      manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
    }
  });
  Menu menu = menuMgr.createContextMenu(viewer.getControl());
  viewer.getControl().setMenu(menu);

  getSite().registerContextMenu(menuMgr, viewer);
}
 
源代码4 项目: 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) );

}
 
源代码5 项目: birt   文件: TabularMeasureGroupNodeProvider.java
/**
 * Creates the context menu for the given object. Gets the action from the
 * actionRegistry and adds the action to the given menu.
 * 
 * @param menu
 *            the menu
 * @param object
 *            the object
 */
public void createContextMenu( TreeViewer sourceViewer, Object object,
		IMenuManager menu )
{
	// WizardUtil.createNewCubeMenu( menu );
	super.createContextMenu( sourceViewer, object, menu );

	if ( ( (MeasureGroupHandle) object ).canEdit( ) )
	{
		menu.insertAfter( IWorkbenchActionConstants.MB_ADDITIONS,
				new EditCubeMeasureGroupAction( object,
						Messages.getString( "CubeMeasureGroupNodeProvider.menu.text" ) ) ); //$NON-NLS-1$
	}

	menu.insertBefore( IWorkbenchActionConstants.MB_ADDITIONS + "-refresh", //$NON-NLS-1$
			new ShowPropertyAction( object ) );

	menu.insertAfter( IWorkbenchActionConstants.MB_ADDITIONS + "-refresh", new Separator( ) ); //$NON-NLS-1$
	IAction action = new RefreshAction( sourceViewer );
	if (action.isEnabled( ))
	{
		menu.insertAfter( IWorkbenchActionConstants.MB_ADDITIONS + "-refresh", action ); //$NON-NLS-1$
	}

}
 
源代码6 项目: birt   文件: TabularCubeNodeProvider.java
/**
 * Creates the context menu for the given object. Gets the action from the
 * actionRegistry and adds the action to the menu.
 * 
 * @param menu
 *            the menu
 * @param object
 *            the object
 */
public void createContextMenu( TreeViewer sourceViewer, Object object,
		IMenuManager menu )
{
	super.createContextMenu( sourceViewer, object, menu );

	if ( ( (CubeHandle) object ).canEdit( ) )
	{
		menu.insertAfter( IWorkbenchActionConstants.MB_ADDITIONS,
				new EditCubeAction( object,
						Messages.getString( "CubeNodeProvider.menu.text" ) ) ); //$NON-NLS-1$
	}

	menu.insertBefore( IWorkbenchActionConstants.MB_ADDITIONS + "-refresh", //$NON-NLS-1$
			new ShowPropertyAction( object ) );

	menu.insertAfter( IWorkbenchActionConstants.MB_ADDITIONS + "-refresh", new Separator( ) ); //$NON-NLS-1$
	IAction action = new RefreshAction( sourceViewer );
	if (action.isEnabled( ))
	{
		menu.insertAfter( IWorkbenchActionConstants.MB_ADDITIONS + "-refresh", action ); //$NON-NLS-1$
	}
}
 
源代码7 项目: birt   文件: DesignerActionBarAdvisor.java
/**
	 * Creates and returns the Help menu.
	 */
	private MenuManager createHelpMenu( )
	{
		MenuManager menu = new MenuManager( DesignerWorkbenchMessages.Workbench_help,
				IWorkbenchActionConstants.M_HELP );

		// See if a welcome or introduction page is specified
		if ( introAction != null )
			menu.add( introAction );
//		else if ( quickStartAction != null )
//			menu.add( quickStartAction );
		menu.add( helpContentsAction );

//		if ( tipsAndTricksAction != null )
//			menu.add( tipsAndTricksAction );

		menu.add( new GroupMarker( "group.tutorials" ) ); //$NON-NLS-1$
		menu.add( new Separator( IWorkbenchActionConstants.MB_ADDITIONS ) );
		menu.add( new Separator( "group.about" ) ); //$NON-NLS-1$
		menu.add( aboutAction );
		menu.add( new GroupMarker( "group.about.ext" ) ); //$NON-NLS-1$

		return menu;
	}
 
源代码8 项目: tracecompass   文件: AbstractTimeGraphView.java
/**
 * Add contributions to the local tool bar manager. The contributions should be
 * appended to the {@link IWorkbenchActionConstants#MB_ADDITIONS} group.
 *
 * @param manager
 *            the tool bar manager
 */
protected void fillLocalToolBar(IToolBarManager manager) {
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, getHideEmptyRowsAction());
    if (fFilterColumns != null && fFilterLabelProvider != null && fFilterColumns.length > 0) {
        manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, fTimeGraphViewer.getShowFilterDialogAction());
    }
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, fTimeGraphViewer.getShowLegendAction());
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, new Separator());
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, fTimeGraphViewer.getResetScaleAction());
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, fTimeGraphViewer.getPreviousEventAction());
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, fTimeGraphViewer.getNextEventAction());
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, new Separator());
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, fTimeGraphViewer.getToggleBookmarkAction());
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, fTimeGraphViewer.getPreviousMarkerAction());
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, fTimeGraphViewer.getNextMarkerAction());
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, new Separator());
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, fPreviousResourceAction);
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, fNextResourceAction);
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, fTimeGraphViewer.getZoomInAction());
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, fTimeGraphViewer.getZoomOutAction());
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, new Separator());
}
 
源代码9 项目: tracecompass   文件: FlameChartView.java
/**
 * @since 1.2
 */
@Override
protected void fillLocalToolBar(@Nullable IToolBarManager manager) {
    if (manager == null) {
        return;
    }
    makeActions();
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, getConfigureSymbolsAction());
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, new Separator());
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, getTimeGraphViewer().getShowFilterDialogAction());
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, new Separator());
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, getTimeGraphViewer().getResetScaleAction());
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, getPreviousEventAction());
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, getNextEventAction());
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, new Separator());
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, getTimeGraphViewer().getToggleBookmarkAction());
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, getTimeGraphViewer().getPreviousMarkerAction());
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, getTimeGraphViewer().getNextMarkerAction());
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, new Separator());
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, fPreviousItemAction);
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, fNextItemAction);
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, getTimeGraphViewer().getZoomInAction());
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, getTimeGraphViewer().getZoomOutAction());
}
 
源代码10 项目: tracecompass   文件: CriticalPathView.java
@Override
protected void fillLocalToolBar(@Nullable IToolBarManager manager) {
    super.fillLocalToolBar(manager);
    if (manager == null) {
        return;
    }
    IAction followArrowBwdAction = getTimeGraphViewer().getFollowArrowBwdAction();
    followArrowBwdAction.setText(Messages.CriticalPathView_followArrowBwdText);
    followArrowBwdAction.setToolTipText(Messages.CriticalPathView_followArrowBwdText);
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, followArrowBwdAction);

    IAction followArrowFwdAction = getTimeGraphViewer().getFollowArrowFwdAction();
    followArrowFwdAction.setText(Messages.CriticalPathView_followArrowFwdText);
    followArrowFwdAction.setToolTipText(Messages.CriticalPathView_followArrowFwdText);
    manager.appendToGroup(IWorkbenchActionConstants.MB_ADDITIONS, followArrowFwdAction);
}
 
源代码11 项目: birt   文件: ScriptViewContextMenuProvider.java
public void buildContextMenu( IMenuManager menu )
{
	menu.add( new Separator( IWorkbenchActionConstants.MB_ADDITIONS ) );
	TreeViewer treeViewer = (TreeViewer) getViewer( );

	IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection( );
	
	//temporary solution
	
	if ( selection.size( ) == 1 )
	{
		Object obj = selection.getFirstElement( );
		ScriptProviderFactory.createProvider( obj )
				.createContextMenu( treeViewer, obj, menu );
	}
	else
	{
		ScriptProviderFactory.getDefaultProvider( )
				.createContextMenu( treeViewer, selection, menu );
		
	}
}
 
源代码12 项目: birt   文件: LeveAttributelNodeProvider.java
/**
 * Creates the context menu for the given object. Gets the action from the
 * actionRegistry and adds the action to the menu.
 * 
 * @param menu
 *            the menu
 * @param object
 *            the object
 */
public void createContextMenu( TreeViewer sourceViewer, Object object,
		IMenuManager menu )
{
	super.createContextMenu( sourceViewer, object, menu );

	menu.insertBefore( IWorkbenchActionConstants.MB_ADDITIONS + "-refresh", //$NON-NLS-1$
			new ShowPropertyAction( object ) );

	menu.insertAfter( IWorkbenchActionConstants.MB_ADDITIONS + "-refresh", new Separator( ) ); //$NON-NLS-1$
	IAction action = new RefreshAction( sourceViewer );
	if (action.isEnabled( ))
	{
		menu.insertAfter( IWorkbenchActionConstants.MB_ADDITIONS + "-refresh", action ); //$NON-NLS-1$
	}
}
 
源代码13 项目: 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;
}
 
源代码14 项目: 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;
}
 
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));
}
 
源代码16 项目: 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 );
}
 
源代码17 项目: birt   文件: TabularDimensionNodeProvider.java
/**
 * Creates the context menu for the given object. Gets the action from the
 * actionRegistry and adds the action to the menu.
 * 
 * @param menu
 *            the menu
 * @param object
 *            the object
 */
public void createContextMenu( TreeViewer sourceViewer, Object object,
		IMenuManager menu )
{
	super.createContextMenu( sourceViewer, object, menu );

	if ( ( (DimensionHandle) object ).canEdit( ) )
	{
		menu.insertAfter( IWorkbenchActionConstants.MB_ADDITIONS,
				new EditCubeDimensionAction( object,
						Messages.getString( "CubeDimensionNodeProvider.menu.text" ) ) ); //$NON-NLS-1$
	}

	menu.insertBefore( IWorkbenchActionConstants.MB_ADDITIONS + "-refresh", //$NON-NLS-1$
			new ShowPropertyAction( object ) );

	menu.insertAfter( IWorkbenchActionConstants.MB_ADDITIONS + "-refresh", new Separator( ) ); //$NON-NLS-1$
	IAction action = new RefreshAction( sourceViewer );
	if (action.isEnabled( ))
	{
		menu.insertAfter( IWorkbenchActionConstants.MB_ADDITIONS + "-refresh", action ); //$NON-NLS-1$
	}
}
 
/**
 * 创建帮助菜单
 * @return 返回帮助菜单的 menu manager;
 */
private MenuManager createHelpMenu() {
	MenuManager menu = new MenuManager(Messages.getString("ts.ApplicationActionBarAdvisor.menu.help"),
			IWorkbenchActionConstants.M_HELP);
	// menu.add(new GroupMarker(IWorkbenchActionConstants.HELP_START));
	menu.add(helpAction);
	// menu.add(helpSearchAction);
	// menu.add(dynamicHelpAction);
	// menu.add(new GroupMarker(IWorkbenchActionConstants.HELP_END));
	menu.add(new GroupMarker("help.keyAssist"));
	menu.add(new Separator());
	menu.add(new GroupMarker("help.updatePlugin"));
	menu.add(new Separator());
	menu.add(new GroupMarker("help.license"));
	// 关于菜单需要始终显示在最底端
	menu.add(new GroupMarker("group.about"));
	// ActionContributionItem aboutItem = new ActionContributionItem(aboutAction);
	// aboutItem.setVisible(!Util.isMac());
	// menu.add(aboutItem);
	return menu;
}
 
源代码19 项目: olca-app   文件: RcpActionBarAdvisor.java
private void fillFileMenu(IMenuManager menuBar) {
	MenuManager menu = new MenuManager(
			M.File, IWorkbenchActionConstants.M_FILE);
	menu.add(saveAction);
	menu.add(saveAsAction);
	menu.add(saveAllAction);
	menu.add(new Separator());
	menu.add(closeAction);
	menu.add(closeAllAction);
	menu.add(new Separator());
	menu.add(preferencesAction);
	menu.add(new Separator());
	menu.add(new ImportAction());
	menu.add(new ExportAction());
	menu.add(new Separator());
	menu.add(exitAction);
	menuBar.add(menu);
}
 
源代码20 项目: tmxeditor8   文件: 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(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(new Separator());
	menu.add(findAction);
	menu.add(new GroupMarker(IWorkbenchActionConstants.FIND_EXT));
	menu.add(new GroupMarker(IWorkbenchActionConstants.EDIT_END));
	menu.add(new Separator());
	menu.add(new GroupMarker("taskEdit"));
	return menu;
}
 
源代码21 项目: tmxeditor8   文件: ApplicationActionBarAdvisor.java
/**
 * 创建帮助菜单
 * @return 返回帮助菜单的 menu manager;
 */
private MenuManager createHelpMenu() {
	MenuManager menu = new MenuManager(Messages.getString("ts.ApplicationActionBarAdvisor.menu.help"),
			IWorkbenchActionConstants.M_HELP);
	// menu.add(new GroupMarker(IWorkbenchActionConstants.HELP_START));
	menu.add(helpAction);
	// menu.add(helpSearchAction);
	// menu.add(dynamicHelpAction);
	// menu.add(new GroupMarker(IWorkbenchActionConstants.HELP_END));
	menu.add(new GroupMarker("help.keyAssist"));
	menu.add(new Separator());
	menu.add(new GroupMarker("help.updatePlugin"));
	menu.add(new Separator());
	menu.add(new GroupMarker("help.license"));
	// 关于菜单需要始终显示在最底端
	menu.add(new GroupMarker("group.about"));
	// ActionContributionItem aboutItem = new ActionContributionItem(aboutAction);
	// aboutItem.setVisible(!Util.isMac());
	// menu.add(aboutItem);
	return menu;
}
 
源代码22 项目: lapse-plus   文件: SinkView.java
private void fillContextMenu(IMenuManager manager) {
    
    ViewMatch match = (ViewMatch) ((IStructuredSelection) viewer.getSelection())
        .getFirstElement();
    if (match != null && match.isError()) {
        manager.add(doBackwardPropagationAction);
    }
    manager.add(runAction);
    manager.add(copyToClipboardAction);
    
    // Other plug-ins can contribute there actions here
    manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}
 
源代码23 项目: n4js   文件: SelectTopLevelElementActionGroup.java
@Override
public void fillActionBars(final IActionBars actionBars) {
	if (hasContributedToViewMenu) {
		return;
	}
	final IMenuManager topLevelSubMenu = new MenuManager("Top Level Elements");
	addActions(topLevelSubMenu);
	final IMenuManager menuManager = actionBars.getMenuManager();
	menuManager.insertBefore(IWorkbenchActionConstants.MB_ADDITIONS, topLevelSubMenu);
	hasContributedToViewMenu = true;
}
 
源代码24 项目: tmxeditor8   文件: ApplicationActionBarAdvisor.java
@Override
protected void fillMenuBar(IMenuManager menuBar) {
	MenuManager fileMenu = new MenuManager("&File", IWorkbenchActionConstants.M_FILE);
	menuBar.add(fileMenu);
	fileMenu.add(exitAction);

	MenuManager editMenu = new MenuManager("&Edit", IWorkbenchActionConstants.M_EDIT);
	menuBar.add(editMenu);
	editMenu.add(preferenceAction);
}
 
源代码25 项目: saros   文件: SarosView.java
protected void addToolBarItems(IToolBarManager toolBar) {
  toolBar.add(getAction(ChangeXMPPAccountAction.ACTION_ID));
  toolBar.add(getAction(NewContactAction.ACTION_ID));
  toolBar.add(getAction(OpenPreferencesAction.ACTION_ID));
  toolBar.add(new Separator());
  toolBar.add(getAction(FollowModeAction.ACTION_ID));
  toolBar.add(getAction(ConsistencyAction.ACTION_ID));
  toolBar.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
  toolBar.add(getAction(LeaveSessionAction.ACTION_ID));
}
 
源代码26 项目: tmxeditor8   文件: WorkingSetRootModeActionGroup.java
public void fillActionBars(IActionBars actionBars) {
	if (hasContributedToViewMenu)
		return;
	IMenuManager topLevelSubMenu = new MenuManager(
			WorkbenchNavigatorMessages.actions_WorkingSetRootModeActionGroup_Top_Level_Element_);
	addActions(topLevelSubMenu);
	actionBars.getMenuManager().insertBefore(IWorkbenchActionConstants.MB_ADDITIONS, topLevelSubMenu);
	hasContributedToViewMenu = true;
}
 
源代码27 项目: neoscada   文件: FactoryEditor.java
private void fillContextMenu ( final IMenuManager manager )
{
    // Other plug-ins can contribute there actions here

    manager.add ( this.deleteAction );
    manager.add ( new Separator () );
    manager.add ( new Separator ( IWorkbenchActionConstants.MB_ADDITIONS ) );
}
 
源代码28 项目: goclipse   文件: LangEditorActionContributor.java
protected void prepareEditMenu(IMenuManager menu) {
	IMenuManager editMenu= menu.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT);
	if(editMenu != null) {
		editMenu.appendToGroup(ITextEditorActionConstants.GROUP_ASSIST, pushItem(
			ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS, 
			ITextEditorActionConstants.CONTENT_ASSIST));
		
		editMenu.appendToGroup(ITextEditorActionConstants.GROUP_ASSIST, pushItem(
			ITextEditorActionDefinitionIds.CONTENT_ASSIST_CONTEXT_INFORMATION, 
			ITextEditorActionConstants.CONTENT_ASSIST_CONTEXT_INFORMATION));
	}
	
}
 
源代码29 项目: birt   文件: CascadingParameterGroupNodeProvider.java
public void createContextMenu( TreeViewer sourceViewer, Object object,
		IMenuManager menu )
{
	super.createContextMenu( sourceViewer, object, menu );

	menu.insertAfter( IWorkbenchActionConstants.MB_ADDITIONS,
			new EditAction( object,
					Messages.getString( "ParameterGroupNodeProvider.Action.ParameterEdit" ) ) ); //$NON-NLS-1$

}
 
源代码30 项目: birt   文件: DesignerActionBarAdvisor.java
/**
 * Fills the menu bar with the workbench actions.
 */
protected void fillMenuBar( IMenuManager menuBar )
{
	menuBar.add( createFileMenu( ) );
	menuBar.add( createEditMenu( ) );
	menuBar.add( new GroupMarker( IWorkbenchActionConstants.MB_ADDITIONS ) );
	menuBar.add( createWindowMenu( ) );
	menuBar.add( createHelpMenu( ) );
}