當前位置: 首頁>>代碼示例>>Java>>正文


Java IMenuManager.appendToGroup方法代碼示例

本文整理匯總了Java中org.eclipse.jface.action.IMenuManager.appendToGroup方法的典型用法代碼示例。如果您正苦於以下問題:Java IMenuManager.appendToGroup方法的具體用法?Java IMenuManager.appendToGroup怎麽用?Java IMenuManager.appendToGroup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.jface.action.IMenuManager的用法示例。


在下文中一共展示了IMenuManager.appendToGroup方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: fillContextMenu

import org.eclipse.jface.action.IMenuManager; //導入方法依賴的package包/類
@Override
public void fillContextMenu(final IMenuManager menu) {
	// {@link N4JSProjectActionGroup} does enablement-logic
	// on its own, thus always invoke it here
	projectGroup.fillContextMenu(menu);

	// Only delegate to {@link N4JSWorkingSetActionProvider},
	// if the current selection contains working sets.
	if (selectionContainsWorkingSet) {
		workingSetActionProvider.fillContextMenu(menu);
	}

	if (assignWorkingSetsAction.isEnabled()) {
		menu.appendToGroup(IContextMenuConstants.GROUP_BUILD, assignWorkingSetsAction);
	}
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:17,代碼來源:N4JSNavigatorActionProvider.java

示例2: fillContextMenu

import org.eclipse.jface.action.IMenuManager; //導入方法依賴的package包/類
@Override
public void fillContextMenu(final IMenuManager menu) {
	super.fillContextMenu(menu);

	// If disabled, do not contribute
	if (!enableContribution) {
		return;
	}

	if (openAction.isEnabled() && enableOpenInContextMenu)
		menu.appendToGroup(IContextMenuConstants.GROUP_BUILD, openAction);
	if (closeAction.isEnabled())
		menu.appendToGroup(IContextMenuConstants.GROUP_BUILD, closeAction);
	if (closeUnrelatedAction.isEnabled()
			&& areOnlyProjectsSelected(closeUnrelatedAction.getStructuredSelection()))
		menu.appendToGroup(IContextMenuConstants.GROUP_BUILD, closeUnrelatedAction);
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:18,代碼來源:N4JSProjectActionGroup.java

示例3: contributeToMenu

import org.eclipse.jface.action.IMenuManager; //導入方法依賴的package包/類
@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);
    }
}
 
開發者ID:pgcodekeeper,項目名稱:pgcodekeeper,代碼行數:10,代碼來源:SQLEditorActionContributor.java

示例4: buildContextMenu

import org.eclipse.jface.action.IMenuManager; //導入方法依賴的package包/類
public void buildContextMenu(IMenuManager menu) {
	GEFActionConstants.addStandardActionGroups(menu);

	menu.appendToGroup(GEFActionConstants.GROUP_UNDO, getAction(ActionFactory.UNDO.getId()));
	menu.appendToGroup(GEFActionConstants.GROUP_UNDO, getAction(ActionFactory.REDO.getId()));
	menu.appendToGroup(GEFActionConstants.GROUP_EDIT, getAction(ActionFactory.DELETE.getId()));
	menu.appendToGroup(GEFActionConstants.GROUP_EDIT, getAction(ActionIdConstants.MODIFY_ACTION_ID));

	IAction saveAction = getAction(ActionFactory.SAVE.getId());
	saveAction.setImageDescriptor(Activator.getImageDescriptor(Activator.IMAGE_SAVE));

	menu.appendToGroup(GEFActionConstants.GROUP_SAVE, saveAction);
	menu.appendToGroup(GEFActionConstants.MB_ADDITIONS, createExportMenuManager());
	menu.appendToGroup(GEFActionConstants.MB_ADDITIONS, getAction(ActionIdConstants.IMPORT_DATABASE_ACTION_ID));
	menu.appendToGroup(GEFActionConstants.MB_ADDITIONS, getAction(ActionIdConstants.CHANGE_DATABASE_ACTION_ID));

}
 
開發者ID:bsteker,項目名稱:bdf2,代碼行數:18,代碼來源:DbToolGefEditorContextMenuProvider.java

示例5: fillContextMenu

import org.eclipse.jface.action.IMenuManager; //導入方法依賴的package包/類
@Override
public void fillContextMenu(final IMenuManager menu) {
	super.fillContextMenu(menu);

	final ISelection selection = getContext().getSelection();
	if (selection instanceof IStructuredSelection) {
		if (canEnable((IStructuredSelection) selection)) {
			final MenuManager newMenu = new MenuManager("Ne&w");
			menu.appendToGroup(IContextMenuConstants.GROUP_NEW, newMenu);
			newMenu.add(getNewWizardMenu());
		}
	}

}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:15,代碼來源:N4JSNewWizardsActionGroup.java

示例6: buildContextMenu

import org.eclipse.jface.action.IMenuManager; //導入方法依賴的package包/類
@Override
public void buildContextMenu(IMenuManager menu) {
	GEFActionConstants.addStandardActionGroups(menu);
	IAction rAction;
	rAction = getActionRegistry().getAction("OSETS_FREFRESH_COMMANDS");
	if (rAction != null) {
		menu.appendToGroup(GEFActionConstants.MB_ADDITIONS, rAction);
	}
	rAction = getActionRegistry().getAction("OSETS_DREFRESH_COMMANDS");
	if (rAction != null) {
		menu.appendToGroup(GEFActionConstants.MB_ADDITIONS, rAction);
	}
	rAction = getActionRegistry().getAction("OSETS_CREFRESH_COMMANDS");
	if (rAction != null) {
		menu.appendToGroup(GEFActionConstants.MB_ADDITIONS, rAction);
	}
	IAction eAction;
	eAction = getActionRegistry().getAction("OSETS_EXPORT_COMMANDS");
	menu.appendToGroup(GEFActionConstants.MB_ADDITIONS, eAction);
	IAction action;
	action = getActionRegistry().getAction("OSETS_COMMANDS");
	menu.appendToGroup(GEFActionConstants.MB_ADDITIONS, action);
	IAction cAction;
	cAction = getActionRegistry().getAction("OSETS_CLEAR_COMMANDS");
	menu.appendToGroup(GEFActionConstants.MB_ADDITIONS, cAction);
	IAction uAction;
	uAction = getActionRegistry().getAction("OSETS_UID_COMMANDS");
	menu.appendToGroup(GEFActionConstants.MB_ADDITIONS, uAction);
	IAction aAction;
	aAction = getActionRegistry().getAction("OSETS_API_COMMANDS");
	menu.appendToGroup(GEFActionConstants.MB_ADDITIONS, aAction);
	IAction iAction;
	iAction = getActionRegistry().getAction("OSETS_INT_COMMANDS");
	menu.appendToGroup(GEFActionConstants.MB_ADDITIONS, iAction);
}
 
開發者ID:dstl,項目名稱:Open_Source_ECOA_Toolset_AS5,代碼行數:36,代碼來源:ContextMenuProvider.java

示例7: fillContextMenu

import org.eclipse.jface.action.IMenuManager; //導入方法依賴的package包/類
@Override
public void fillContextMenu(IMenuManager menu) {
	menu.appendToGroup(IContextMenuConstants.GROUP_REORGANIZE, new Separator(GROUP_MANAGE));
	menu.appendToGroup(GROUP_MANAGE, hideAction);
	super.fillContextMenu(menu);
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:7,代碼來源:ManagerWorkingSetActionGroup.java

示例8: fillContextMenu

import org.eclipse.jface.action.IMenuManager; //導入方法依賴的package包/類
@Override
public void fillContextMenu(IMenuManager menu) {
    if (openAction.isEnabled()) {
        menu.appendToGroup(ICommonMenuConstants.GROUP_OPEN, openAction);
    }
}
 
開發者ID:pgcodekeeper,項目名稱:pgcodekeeper,代碼行數:7,代碼來源:NavigatorOutlineActionProvider.java

示例9: buildContextMenu

import org.eclipse.jface.action.IMenuManager; //導入方法依賴的package包/類
/**
 * Called when the context menu is about to show. Actions, whose state is
 * enabled, will appear in the context menu.
 */
@Override
public void buildContextMenu(IMenuManager menu) {
	// Add standard action groups to the menu
	GEFActionConstants.addStandardActionGroups(menu);
	 
       IAction[] actions = new IAction[4];
	actions[0] = getAction(Constants.SUBJOB_CREATE);
    actions[1] = getAction(Constants.SUBJOB_OPEN);
    actions[2] = getAction(Constants.SUBJOB_UPDATE);
    actions[3] = getAction(Constants.SUBJOB_TRACKING);
    
    SubMenuAction subJobMenu=new SubMenuAction( actions, Constants.SUBJOB_ACTION, Constants.SUBJOB_ACTION_ToolTip,true);	// Add actions to the menu
	IAction[] watcherAction = new IAction[2];
       watcherAction[0] = getAction(Constants.ADD_WATCH_POINT_ID);
       watcherAction[1] = getAction(Constants.REMOVE_WATCH_POINT_ID);
       WatcherMenuAction watcherMenu = new WatcherMenuAction(watcherAction, Constants.WATCHER_ACTION,Constants.WATCHER_ACTION_TEXT, true); //action to add watch points
        
       
       IAction[] viewDataActions = new IAction[2];
       viewDataActions[0] = getAction(Constants.CURRENT_VIEW_DATA_ID);
       viewDataActions[1] = getAction(Constants.WATCH_RECORD_ID);
       ViewDataActionMenu viewDataActionMenu = new ViewDataActionMenu(viewDataActions, "View Data", "View Data", true);
       //WatcherMenuAction viewDataActionMenu = new WatcherMenuAction(viewDataActions, Constants.WATCHER_ACTION,Constants.WATCHER_ACTION_TEXT, true); //action to add watch points
       
       
       //IAction actionWatchRecords = getAction(Constants.WATCH_RECORD_ID);// action to view debug data
       IAction componentHelpAction=getAction(Constants.HELP_ID);
       IAction componentPropertiesAction=getAction(Constants.COMPONENT_PROPERTIES_ID);
       
       
	menu.appendToGroup(GEFActionConstants.GROUP_UNDO, // target group id
	getAction(ActionFactory.UNDO.getId())); // action to add
	menu.appendToGroup(GEFActionConstants.GROUP_UNDO, getAction(ActionFactory.REDO.getId()));
    menu.appendToGroup(GEFActionConstants.GROUP_EDIT, getAction(ActionFactory.DELETE.getId()));
	menu.appendToGroup(GEFActionConstants.GROUP_EDIT, getAction(ActionFactory.SAVE.getId()));
	menu.appendToGroup(GEFActionConstants.GROUP_COPY, getAction(ActionFactory.CUT.getId()));
	menu.appendToGroup(GEFActionConstants.GROUP_COPY, getAction(ActionFactory.COPY.getId()));
	menu.appendToGroup(GEFActionConstants.GROUP_COPY, getAction(ActionFactory.PASTE.getId()));
    menu.appendToGroup(GEFActionConstants.GROUP_REST, subJobMenu);
    menu.appendToGroup(GEFActionConstants.GROUP_REST, getAction(Constants.PROPAGATE));
    menu.appendToGroup(GEFActionConstants.GROUP_REST, getAction(Constants.COMMENT_BOX));
    menu.appendToGroup(GEFActionConstants.GROUP_REST, getAction(Constants.GRAPH_PROPERTY));
	menu.appendToGroup(GEFActionConstants.GROUP_REST, watcherMenu);
	//menu.appendToGroup(GEFActionConstants.GROUP_REST, actionWatchRecords);
	menu.appendToGroup(GEFActionConstants.GROUP_REST, viewDataActionMenu);
	menu.appendToGroup(GEFActionConstants.GROUP_REST,componentPropertiesAction);
	menu.appendToGroup(GEFActionConstants.GROUP_REST, componentHelpAction);

	if(subJobMenu.getActiveOperationCount()== 0)
    subJobMenu.setEnabled(false);
		 
	if(watcherMenu.getActiveOperationCount()== 0){
		watcherMenu.setEnabled(false);
	}
	
	if(viewDataActionMenu.getActiveOperationCount() == 0){
		viewDataActionMenu.setEnabled(false);
	}
	
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:65,代碼來源:ComponentsEditorContextMenuProvider.java


注:本文中的org.eclipse.jface.action.IMenuManager.appendToGroup方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。