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


Java IMenuManager.add方法代碼示例

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


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

示例1: fillDialogMenu

import org.eclipse.jface.action.IMenuManager; //導入方法依賴的package包/類
/**
 * Fill the dialog's menu. Subclasses may extend or override.
 * 
 * @param dialogMenu
 *            The dialog's menu.
 */
protected void fillDialogMenu(IMenuManager dialogMenu) {
	dialogMenu.add(new GroupMarker("SystemMenuStart")); //$NON-NLS-1$
	// RAP [bm]: Tracker
	// dialogMenu.add(new MoveAction());
	// dialogMenu.add(new ResizeAction());
	if (showPersistActions) {
		if (isUsing34API) {
			dialogMenu.add(new PersistLocationAction());
			dialogMenu.add(new PersistSizeAction());
		} else {
			dialogMenu.add(new PersistBoundsAction());
		}
	}
	dialogMenu.add(new Separator("SystemMenuEnd")); //$NON-NLS-1$
}
 
開發者ID:sergueik,項目名稱:SWET,代碼行數:22,代碼來源:PopupDialog.java

示例2: fillContextMenu

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

    ZooKeeperOpenAction openAction = getOpenAction();
    if (openAction != null && openAction.isEnabled()) {
        manager.add(openAction);
    }

    ZooKeeperDeleteAction deleteAction = getDeleteAction();
    if (deleteAction != null && deleteAction.isEnabled()) {
        manager.add(new Separator());
        manager.add(deleteAction);
    }

    RefreshAction refreshAction = getRefreshAction();
    if (refreshAction != null && refreshAction.isEnabled()) {
        manager.add(new Separator());
        manager.add(refreshAction);
    }
}
 
開發者ID:baloise,項目名稱:eZooKeeper,代碼行數:21,代碼來源:AbstractZooKeeperDataModelElementType.java

示例3: fillLocalPullDown

import org.eclipse.jface.action.IMenuManager; //導入方法依賴的package包/類
private void fillLocalPullDown(IMenuManager manager) {
	manager.add(actionRelaunch);
	manager.add(actionRelaunchFailed);
	manager.add(actionStop);
	manager.add(new Separator());
	manager.add(actionLock);
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:8,代碼來源:TestResultsView.java

示例4: createMenu

import org.eclipse.jface.action.IMenuManager; //導入方法依賴的package包/類
private void createMenu() {
	IMenuManager manager = getViewSite().getActionBars().getMenuManager();
	manager.add(selectColumnsAction);
	manager.add(restoreDefaultsAction);
	manager.add(new Separator());
	manager.add(limitLogCharsAction);
	manager.add(activateOnNewEventsAction);
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:9,代碼來源:EngineLogView.java

示例5: createControl

import org.eclipse.jface.action.IMenuManager; //導入方法依賴的package包/類
public void createControl(Composite parent) {
	super.createControl(parent);

	labelProvider = new BatchEditorOutlineLabelProvider();

	TreeViewer viewer = getTreeViewer();
	viewer.setContentProvider(contentProvider);
	viewer.addDoubleClickListener(this);
	viewer.setLabelProvider(new DelegatingStyledCellLabelProvider(labelProvider));
	viewer.addSelectionChangedListener(this);

	/* it can happen that input is already updated before control created */
	if (input != null) {
		viewer.setInput(input);
	}
	toggleLinkingAction = new ToggleLinkingAction();
	toggleLinkingAction.setActionDefinitionId(IWorkbenchCommandConstants.NAVIGATE_TOGGLE_LINK_WITH_EDITOR);
	
	IActionBars actionBars = getSite().getActionBars();
	
	IToolBarManager toolBarManager = actionBars.getToolBarManager();
	toolBarManager.add(toggleLinkingAction);
	
	IMenuManager viewMenuManager = actionBars.getMenuManager();
	viewMenuManager.add(new Separator("EndFilterGroup")); //$NON-NLS-1$

	viewMenuManager.add(new Separator("treeGroup")); //$NON-NLS-1$
	viewMenuManager.add(toggleLinkingAction);
	
	
	/*
	 * when no input is set on init state - let the editor rebuild outline
	 * (async)
	 */
	if (input == null && editor != null) {
		editor.rebuildOutline();
	}

}
 
開發者ID:de-jcup,項目名稱:eclipse-batch-editor,代碼行數:40,代碼來源:BatchEditorContentOutlinePage.java

示例6: fillPopupMenu

import org.eclipse.jface.action.IMenuManager; //導入方法依賴的package包/類
@Override
public void fillPopupMenu(IMenuManager manager, SchemaViewer viewer) {
	for (String section : ORDERED_SECTIONS) {
           manager.add(new Separator(section));
       }
	IMenuService service = serviceProvider.getMenuService();
       service.populateContributionManager((ContributionManager) manager, getPopupMenuId());
}
 
開發者ID:Talend,項目名稱:avro-schema-editor,代碼行數:9,代碼來源:SchemaPopupMenuConfigurationImpl.java

示例7: addToolbarAction

import org.eclipse.jface.action.IMenuManager; //導入方法依賴的package包/類
private void addToolbarAction(String name, boolean toggle, String imageName, String description, Action action) {
	IMenuManager menuManager = getViewSite().getActionBars().getMenuManager();
	action.setImageDescriptor(ImageDescriptor.createFromImage(PandionJUI.getImage(imageName)));
	String tooltip = name;
	if(description != null)
		tooltip += "\n" + description;
	action.setToolTipText(tooltip);
	menuManager.add(action);
}
 
開發者ID:andre-santos-pt,項目名稱:pandionj,代碼行數:10,代碼來源:PandionJView.java

示例8: fillContextMenu

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

    BaseOpenAction openAction = getOpenAction();
    if (openAction != null && !openAction.getSelectionProvider().getSelection().isEmpty()) {
        manager.add(openAction);
    }

    RefreshAction refreshAction = getRefreshAction();
    if (refreshAction != null && !refreshAction.getSelectionProvider().getSelection().isEmpty()) {
        manager.add(new Separator());
        manager.add(refreshAction);
    }
}
 
開發者ID:baloise,項目名稱:eZooKeeper,代碼行數:15,代碼來源:AbstractJmxDataModelElementType.java

示例9: fillLocalPullDown

import org.eclipse.jface.action.IMenuManager; //導入方法依賴的package包/類
private void fillLocalPullDown(IMenuManager manager) {
	manager.add(collapseAllAction);
	Action[] enabledActions = new Action[] {chooseFolderAction, showReadOnlyAction, copyPathAction};
	for (Action action : enabledActions) {
		if (action.isEnabled()) {
			manager.add(action);
		}
		
	}

	manager.add(new Separator());
	manager.add(viewModeAction);
	manager.add(addAction);
	manager.add(trackAction);
}
 
開發者ID:32kda,項目名稱:com.onpositive.prefeditor,代碼行數:16,代碼來源:PreferenceView.java

示例10: fillContextMenu

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

示例11: fillLocalPullDown

import org.eclipse.jface.action.IMenuManager; //導入方法依賴的package包/類
private void fillLocalPullDown(IMenuManager manager) {
	manager.add(actionUpdate);
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:4,代碼來源:ApiCompareView.java

示例12: fillContextMenu

import org.eclipse.jface.action.IMenuManager; //導入方法依賴的package包/類
private void fillContextMenu(IMenuManager manager) {
	// Other plug-ins can contribute there actions here
	manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:5,代碼來源:ProjectExplorerView.java

示例13: contributeToMenu

import org.eclipse.jface.action.IMenuManager; //導入方法依賴的package包/類
public void contributeToMenu(IMenuManager manager) {
	IMenuManager menu = new MenuManager("Editor &Menu");
	manager.prependToGroup(IWorkbenchActionConstants.MB_ADDITIONS, menu);
	menu.add(sampleAction);
}
 
開發者ID:dstl,項目名稱:Open_Source_ECOA_Toolset_AS5,代碼行數:6,代碼來源:CompDefEditorContributor.java

示例14: fillContextMenu

import org.eclipse.jface.action.IMenuManager; //導入方法依賴的package包/類
private void fillContextMenu ( final IMenuManager manager )
{
    manager.add ( new Separator ( IWorkbenchActionConstants.MB_ADDITIONS ) );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:5,代碼來源:ServersViewer.java

示例15: fillMenuBar

import org.eclipse.jface.action.IMenuManager; //導入方法依賴的package包/類
@Override
protected void fillMenuBar ( final IMenuManager menuBar )
{
    final MenuManager fileMenu = new MenuManager ( "&File", IWorkbenchActionConstants.M_FILE );
    final MenuManager windowMenu = new MenuManager ( "&Window", IWorkbenchActionConstants.M_WINDOW );
    final MenuManager helpMenu = new MenuManager ( "&Help", IWorkbenchActionConstants.M_HELP );
    final MenuManager fileNewMenu = new MenuManager ( "&New", IWorkbenchActionConstants.NEW_EXT );
    final MenuManager windowNewMenu = new MenuManager ( "Show &View", IWorkbenchActionConstants.SHOW_EXT );

    // Main

    menuBar.add ( fileMenu );
    menuBar.add ( new GroupMarker ( IWorkbenchActionConstants.MB_ADDITIONS ) );
    menuBar.add ( windowMenu );
    menuBar.add ( helpMenu );

    // File
    fileMenu.add ( this.newWindowAction );
    fileMenu.add ( new Separator () );
    fileMenu.add ( fileNewMenu );
    fileMenu.add ( getAction ( ActionFactory.SAVE.getId () ) );
    fileMenu.add ( getAction ( ActionFactory.NEW_EDITOR.getId () ) );
    fileMenu.add ( new GroupMarker ( IWorkbenchActionConstants.OPEN_EXT ) );

    fileMenu.add ( new Separator () );
    fileMenu.add ( this.exitAction );

    fileNewMenu.add ( this.newWizards );

    // Window
    windowNewMenu.add ( this.showViews );
    windowMenu.add ( windowNewMenu );
    windowMenu.add ( getAction ( ActionFactory.PREFERENCES.getId () ) );

    // Help
    helpMenu.add ( getAction ( ActionFactory.INTRO.getId () ) );
    helpMenu.add ( this.showHelpAction ); // NEW
    helpMenu.add ( this.searchHelpAction ); // NEW
    helpMenu.add ( this.dynamicHelpAction ); // NEW
    helpMenu.add ( new GroupMarker ( IWorkbenchActionConstants.MB_ADDITIONS ) );
    helpMenu.add ( new Separator () );
    helpMenu.add ( this.aboutAction );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:44,代碼來源:ApplicationActionBarAdvisor.java


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