本文整理汇总了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$
}
示例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);
}
}
示例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);
}
示例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);
}
示例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();
}
}
示例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());
}
示例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);
}
示例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);
}
}
示例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);
}
示例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 ) );
}
示例11: fillLocalPullDown
import org.eclipse.jface.action.IMenuManager; //导入方法依赖的package包/类
private void fillLocalPullDown(IMenuManager manager) {
manager.add(actionUpdate);
}
示例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));
}
示例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);
}
示例14: fillContextMenu
import org.eclipse.jface.action.IMenuManager; //导入方法依赖的package包/类
private void fillContextMenu ( final IMenuManager manager )
{
manager.add ( new Separator ( IWorkbenchActionConstants.MB_ADDITIONS ) );
}
示例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 );
}