当前位置: 首页>>代码示例>>Java>>正文


Java IWorkbenchActionConstants类代码示例

本文整理汇总了Java中org.eclipse.ui.IWorkbenchActionConstants的典型用法代码示例。如果您正苦于以下问题:Java IWorkbenchActionConstants类的具体用法?Java IWorkbenchActionConstants怎么用?Java IWorkbenchActionConstants使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IWorkbenchActionConstants类属于org.eclipse.ui包,在下文中一共展示了IWorkbenchActionConstants类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: contributeToMenu

import org.eclipse.ui.IWorkbenchActionConstants; //导入依赖的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

示例2: fillContextMenu

import org.eclipse.ui.IWorkbenchActionConstants; //导入依赖的package包/类
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));
    }
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:20,代码来源:QueryEditorControl.java

示例3: registerContextMenu

import org.eclipse.ui.IWorkbenchActionConstants; //导入依赖的package包/类
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);
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:23,代码来源:TeamExplorerBaseSection.java

示例4: fillMenu

import org.eclipse.ui.IWorkbenchActionConstants; //导入依赖的package包/类
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));
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:17,代码来源:QueueEditorPage.java

示例5: registerMenus

import org.eclipse.ui.IWorkbenchActionConstants; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:24,代码来源:VersionControlEditor.java

示例6: fillTableMenu

import org.eclipse.ui.IWorkbenchActionConstants; //导入依赖的package包/类
/**
 * 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));
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:20,代码来源:SvnPropertiesView.java

示例7: addRemoteBookmarksStoreActions

import org.eclipse.ui.IWorkbenchActionConstants; //导入依赖的package包/类
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);
	}
}
 
开发者ID:cchabanois,项目名称:mesfavoris,代码行数:17,代码来源:BookmarksView.java

示例8: init

import org.eclipse.ui.IWorkbenchActionConstants; //导入依赖的package包/类
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);
}
 
开发者ID:ncleclipse,项目名称:ncl30-eclipse,代码行数:21,代码来源:NCLActionContributor.java

示例9: contributeToMenu

import org.eclipse.ui.IWorkbenchActionConstants; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:ShoukriKattan,项目名称:ForgedUI-Eclipse,代码行数:23,代码来源:GUIEditorActionBarContributor.java

示例10: fillMenuBar

import org.eclipse.ui.IWorkbenchActionConstants; //导入依赖的package包/类
@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);
}
 
开发者ID:yamcs,项目名称:yamcs-studio,代码行数:23,代码来源:YamcsStudioActionBarAdvisor.java

示例11: createFileMenu

import org.eclipse.ui.IWorkbenchActionConstants; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:eclipse,项目名称:triquetrum,代码行数:28,代码来源:TriquetrumEditorAdvisor.java

示例12: createEditMenu

import org.eclipse.ui.IWorkbenchActionConstants; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:eclipse,项目名称:triquetrum,代码行数:31,代码来源:TriquetrumEditorAdvisor.java

示例13: fillContextMenu

import org.eclipse.ui.IWorkbenchActionConstants; //导入依赖的package包/类
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));
}
 
开发者ID:osswangxining,项目名称:dockerfoundry,代码行数:27,代码来源:DockerContainersView.java

示例14: fillContextMenu

import org.eclipse.ui.IWorkbenchActionConstants; //导入依赖的package包/类
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));
}
 
开发者ID:osswangxining,项目名称:dockerfoundry,代码行数:23,代码来源:DockerImagesView.java

示例15: createFileMenu

import org.eclipse.ui.IWorkbenchActionConstants; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:mondo-project,项目名称:mondo-demo-wt,代码行数:30,代码来源:WTSpec4MEditorAdvisor.java


注:本文中的org.eclipse.ui.IWorkbenchActionConstants类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。