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


Java ContributionItemFactory类代码示例

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


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

示例1: makeActions

import org.eclipse.ui.actions.ContributionItemFactory; //导入依赖的package包/类
@Override
protected void makeActions ( final IWorkbenchWindow window )
{
    this.exitAction = ActionFactory.QUIT.create ( window );
    register ( this.exitAction );

    this.aboutAction = ActionFactory.ABOUT.create ( window );
    register ( this.aboutAction );

    this.newWindowAction = ActionFactory.OPEN_NEW_WINDOW.create ( window );
    register ( this.newWindowAction );

    register ( ActionFactory.NEW_WIZARD_DROP_DOWN.create ( window ) );
    register ( ActionFactory.NEW.create ( window ) );
    register ( ActionFactory.INTRO.create ( window ) );
    register ( ActionFactory.SAVE.create ( window ) );

    this.showViews = ContributionItemFactory.VIEWS_SHORTLIST.create ( window );
    this.newWizards = ContributionItemFactory.NEW_WIZARD_SHORTLIST.create ( window );

    register ( ActionFactory.NEW_EDITOR.create ( window ) );
    register ( ActionFactory.PREFERENCES.create ( window ) );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:24,代码来源:ApplicationActionBarAdvisor.java

示例2: createWindowMenu

import org.eclipse.ui.actions.ContributionItemFactory; //导入依赖的package包/类
/**
 * Creates and returns the Window menu.
 */
private MenuManager createWindowMenu() {
	MenuManager menu = new MenuManager(
			IDEWorkbenchMessages.Workbench_window,
			IWorkbenchActionConstants.M_WINDOW);

	menu.add(newWindowAction);
	menu.add(newEditorAction);

	menu.add(new Separator());
	addPerspectiveActions(menu);
	menu.add(new Separator());
	addKeyboardShortcuts(menu);
	Separator sep = new Separator(IWorkbenchActionConstants.MB_ADDITIONS);
	sep.setVisible(!Util.isMac());
	menu.add(sep);

	// See the comment for quit in createFileMenu
	ActionContributionItem openPreferencesItem = new ActionContributionItem(
			openPreferencesAction);
	openPreferencesItem.setVisible(!Util.isMac());
	menu.add(openPreferencesItem);

	menu.add(ContributionItemFactory.OPEN_WINDOWS.create(getWindow()));
	return menu;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:29,代码来源:ApplicationActionBarAdvisor.java

示例3: addPerspectiveActions

import org.eclipse.ui.actions.ContributionItemFactory; //导入依赖的package包/类
/**
 * Adds the perspective actions to the specified menu.
 */
private void addPerspectiveActions(MenuManager menu) {
	{
		String openText = IDEWorkbenchMessages.Workbench_openPerspective;
		MenuManager changePerspMenuMgr = new MenuManager(openText,
				"openPerspective"); //$NON-NLS-1$
		IContributionItem changePerspMenuItem = ContributionItemFactory.PERSPECTIVES_SHORTLIST
				.create(getWindow());
		changePerspMenuMgr.add(changePerspMenuItem);
		menu.add(changePerspMenuMgr);
	}
	{
		MenuManager showViewMenuMgr = new MenuManager(
				IDEWorkbenchMessages.Workbench_showView, "showView"); //$NON-NLS-1$
		IContributionItem showViewMenu = ContributionItemFactory.VIEWS_SHORTLIST
				.create(getWindow());
		showViewMenuMgr.add(showViewMenu);
		menu.add(showViewMenuMgr);
	}
	menu.add(new Separator());
	menu.add(editActionSetAction);
	menu.add(savePerspectiveAction);
	menu.add(resetPerspectiveAction);
	menu.add(closePerspAction);
	menu.add(closeAllPerspsAction);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:29,代码来源:ApplicationActionBarAdvisor.java

示例4: createWindowMenu

import org.eclipse.ui.actions.ContributionItemFactory; //导入依赖的package包/类
/**
 * Creates and returns the Window menu.
 */
private MenuManager createWindowMenu()
{
  MenuManager menu =
      new MenuManager(IDEWorkbenchMessages.Workbench_window,
          IWorkbenchActionConstants.M_WINDOW);

  menu.add(newWindowAction);
  menu.add(newEditorAction);

  menu.add(new Separator());
  addPerspectiveActions(menu);
  menu.add(new Separator());
  Separator sep = new Separator(IWorkbenchActionConstants.MB_ADDITIONS);
  sep.setVisible(!Util.isMac());
  menu.add(sep);

  menu.add(ContributionItemFactory.OPEN_WINDOWS.create(getWindow()));
  return menu;
}
 
开发者ID:debrief,项目名称:limpet,代码行数:23,代码来源:ApplicationActionBarAdvisor.java

示例5: addPerspectiveActions

import org.eclipse.ui.actions.ContributionItemFactory; //导入依赖的package包/类
/**
 * Adds the perspective actions to the specified menu.
 */
private void addPerspectiveActions(MenuManager menu)
{
  String openText = IDEWorkbenchMessages.Workbench_openPerspective;
  MenuManager changePerspMenuMgr =
      new MenuManager(openText, "openPerspective"); //$NON-NLS-1$
  IContributionItem changePerspMenuItem =
      ContributionItemFactory.PERSPECTIVES_SHORTLIST.create(getWindow());
  changePerspMenuMgr.add(changePerspMenuItem);
  menu.add(changePerspMenuMgr);

  MenuManager showViewMenuMgr =
      new MenuManager(IDEWorkbenchMessages.Workbench_showView, "showView"); //$NON-NLS-1$
  IContributionItem showViewMenu =
      ContributionItemFactory.VIEWS_SHORTLIST.create(getWindow());
  showViewMenuMgr.add(showViewMenu);
  menu.add(showViewMenuMgr);

  menu.add(new Separator());
  menu.add(getSavePerspectiveItem());
  menu.add(getResetPerspectiveItem());
  menu.add(closePerspAction);
  menu.add(closeAllPerspsAction);
}
 
开发者ID:debrief,项目名称:limpet,代码行数:27,代码来源:ApplicationActionBarAdvisor.java

示例6: addPerspectiveActions

import org.eclipse.ui.actions.ContributionItemFactory; //导入依赖的package包/类
/**
 * Adds the perspective actions to the specified menu.
 */
private void addPerspectiveActions(final MenuManager menu) {

	{
		final MenuManager perspectiveMenuMgr = new MenuManager(
				Messages.App_Action_open_perspective,
				"openPerspective"); //$NON-NLS-1$

		final IContributionItem changePerspMenuItem = ContributionItemFactory.PERSPECTIVES_SHORTLIST
				.create(_window);

		perspectiveMenuMgr.add(changePerspMenuItem);

		menu.add(perspectiveMenuMgr);
	}

	menu.add(_actionSavePerspective);
	menu.add(_actionResetPerspective);
	menu.add(_actionClosePerspective);
	menu.add(_actionCloseAllPerspective);
}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:24,代码来源:ApplicationActionBarAdvisor.java

示例7: fillContextMenu

import org.eclipse.ui.actions.ContributionItemFactory; //导入依赖的package包/类
@Override
public void fillContextMenu(IMenuManager menu) {
	super.fillContextMenu(menu);
	if (!fIsTypeHiararchyViewerOwner)
		appendToGroup(menu, fOpenTypeHierarchy);
       if (!fIsCallHiararchyViewerOwner)
           appendToGroup(menu, fOpenCallHierarchy);

       if (fShowShowInMenu) {
		MenuManager showInSubMenu= new MenuManager(getShowInMenuLabel());
		IWorkbenchWindow workbenchWindow= fOpenSuperImplementation.getSite().getWorkbenchWindow();
		showInSubMenu.add(ContributionItemFactory.VIEWS_SHOW_IN.create(workbenchWindow));
		menu.appendToGroup(IContextMenuConstants.GROUP_OPEN, showInSubMenu);
       }

	IStructuredSelection selection= getStructuredSelection();
	if (fShowOpenPropertiesAction && selection != null && fOpenPropertiesDialog.isApplicableForSelection())
		menu.appendToGroup(IContextMenuConstants.GROUP_PROPERTIES, fOpenPropertiesDialog);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:20,代码来源:OpenViewActionGroup.java

示例8: createFileMenu

import org.eclipse.ui.actions.ContributionItemFactory; //导入依赖的package包/类
/**
 * Creates and returns the 'File' menu.
 * 
 * @return the created menu manager
 */
private MenuManager createFileMenu() {
  MenuManager menu = new MenuManager("&File", IWorkbenchActionConstants.M_FILE); //$NON-NLS-1$
  menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_START));

  menu.add(new GroupMarker(IWorkbenchActionConstants.NEW_EXT));
  menu.add(getAction(ActionFactory.CLOSE.getId()));
  menu.add(getAction(ActionFactory.CLOSE_ALL.getId()));
  // menu.add(closeAllSavedAction);
  menu.add(new GroupMarker(IWorkbenchActionConstants.CLOSE_EXT));
  menu.add(new Separator());
  menu.add(getAction(ActionFactory.SAVE.getId()));
  menu.add(getAction(ActionFactory.SAVE_AS.getId()));
  menu.add(getAction(ActionFactory.SAVE_ALL.getId()));

  menu.add(getAction(ActionFactory.REVERT.getId()));
  menu.add(ContributionItemFactory.REOPEN_EDITORS.create(getActionBarConfigurer().getWindowConfigurer().getWindow()));
  menu.add(new GroupMarker(IWorkbenchActionConstants.MRU));
  menu.add(new Separator());
  menu.add(getAction(ActionFactory.QUIT.getId()));
  menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_END));
  return menu;
}
 
开发者ID:agusevas,项目名称:logan,代码行数:28,代码来源:LoganActionBarAdvisor.java

示例9: makeActions

import org.eclipse.ui.actions.ContributionItemFactory; //导入依赖的package包/类
protected void makeActions(IWorkbenchWindow window) {
	this.window = window;

	this.saveBTAction = ActionFactory.SAVE.create(this.window);
	this.saveBTAsAction = ActionFactory.SAVE_AS.create(this.window);
	this.exportAsCppAction = new DialogExportAsCppAction(this.window);
	this.openBTAction = new DialogOpenBTAction(this.window);
	this.newBTAction = new NewBTAction();
	this.loadMMPMDomainAction = new DialogLoadMMPMDomainAction(this.window);
	this.viewsList = ContributionItemFactory.VIEWS_SHORTLIST.create(this.window);
	this.aboutAction = ActionFactory.ABOUT.create(this.window);

	/* For key bindings and for copy and paste actions... */
	this.register(this.saveBTAction);
	this.register(ActionFactory.COPY.create(this.window));
	this.register(ActionFactory.PASTE.create(this.window));
}
 
开发者ID:gaia-ucm,项目名称:jbt,代码行数:18,代码来源:ApplicationActionBarAdvisor.java

示例10: makeActions

import org.eclipse.ui.actions.ContributionItemFactory; //导入依赖的package包/类
@Override
protected void makeActions(final IWorkbenchWindow window) {
	// save
	saveAction = ActionFactory.SAVE.create(window);
	saveAction.setImageDescriptor(Icon.SAVE.descriptor());
	saveAction.setDisabledImageDescriptor(Icon.SAVE_DISABLED.descriptor());
	// save as
	saveAsAction = ActionFactory.SAVE_AS.create(window);
	saveAsAction.setImageDescriptor(Icon.SAVE_AS.descriptor());
	saveAsAction.setDisabledImageDescriptor(Icon.SAVE_AS_DISABLED.descriptor());
	// save all
	saveAllAction = ActionFactory.SAVE_ALL.create(window);
	saveAllAction.setImageDescriptor(Icon.SAVE_ALL.descriptor());
	saveAllAction.setDisabledImageDescriptor(Icon.SAVE_ALL_DISABLED.descriptor());
	closeAction = ActionFactory.CLOSE.create(window);
	closeAllAction = ActionFactory.CLOSE_ALL.create(window);
	preferencesAction = ActionFactory.PREFERENCES.create(window);
	preferencesAction.setImageDescriptor(Icon.PREFERENCES.descriptor());
	importAction = ActionFactory.IMPORT.create(window);
	importAction.setImageDescriptor(Icon.IMPORT.descriptor());
	exportAction = ActionFactory.EXPORT.create(window);
	exportAction.setImageDescriptor(Icon.EXPORT.descriptor());
	exitAction = ActionFactory.QUIT.create(window);
	showViews = ContributionItemFactory.VIEWS_SHORTLIST.create(window);
	aboutAction = ActionFactory.ABOUT.create(window);
}
 
开发者ID:GreenDelta,项目名称:olca-app,代码行数:27,代码来源:RcpActionBarAdvisor.java

示例11: editorContextMenuAboutToShow

import org.eclipse.ui.actions.ContributionItemFactory; //导入依赖的package包/类
@Override
protected void editorContextMenuAboutToShow(final IMenuManager menu) {
	super.editorContextMenuAboutToShow(menu);

	final IContributionItem[] items = menu.getItems();
	for (int i = 0; i < items.length; i++) {
		if (items[i] instanceof IMenuManager) {
			final IMenuManager subMenu = (IMenuManager) items[i];
			final IContributionItem testShowIn = subMenu.find(ContributionItemFactory.VIEWS_SHOW_IN.getId());
			if (null != testShowIn) {
				menu.remove(subMenu);
			}
		}
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:16,代码来源:N4JSEditor.java

示例12: makeActions

import org.eclipse.ui.actions.ContributionItemFactory; //导入依赖的package包/类
@Override
protected void makeActions ( final IWorkbenchWindow window )
{
    this.newWindowAction = ActionFactory.OPEN_NEW_WINDOW.create ( window );
    this.exitAction = ActionFactory.QUIT.create ( window );
    this.aboutAction = ActionFactory.ABOUT.create ( window );

    this.showViews = ContributionItemFactory.VIEWS_SHORTLIST.create ( window );
    this.newWizards = ContributionItemFactory.NEW_WIZARD_SHORTLIST.create ( window );

    this.showHelpAction = ActionFactory.HELP_CONTENTS.create ( window );
    this.searchHelpAction = ActionFactory.HELP_SEARCH.create ( window );
    this.dynamicHelpAction = ActionFactory.DYNAMIC_HELP.create ( window );

    register ( this.exitAction );
    register ( this.aboutAction );
    register ( this.newWindowAction );

    register ( this.showHelpAction );
    register ( this.searchHelpAction );
    register ( this.dynamicHelpAction );

    register ( ActionFactory.NEW_WIZARD_DROP_DOWN.create ( window ) );
    register ( ActionFactory.NEW.create ( window ) );
    register ( ActionFactory.INTRO.create ( window ) );
    register ( ActionFactory.SAVE.create ( window ) );

    register ( ActionFactory.NEW_EDITOR.create ( window ) );
    register ( ActionFactory.PREFERENCES.create ( window ) );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:31,代码来源:ApplicationActionBarAdvisor.java

示例13: createWindowMenu

import org.eclipse.ui.actions.ContributionItemFactory; //导入依赖的package包/类
/**
 * Creates the 'Window' menu. <!-- begin-user-doc --> <!-- end-user-doc -->
 * 
 * @generated
 */
protected IMenuManager createWindowMenu(IWorkbenchWindow window) {
  IMenuManager menu = new MenuManager(getString("_UI_Menu_Window_label"), IWorkbenchActionConstants.M_WINDOW);

  addToMenuAndRegister(menu, ActionFactory.OPEN_NEW_WINDOW.create(window));
  menu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
  menu.add(ContributionItemFactory.OPEN_WINDOWS.create(window));

  return menu;
}
 
开发者ID:eclipse,项目名称:triquetrum,代码行数:15,代码来源:TriquetrumEditorAdvisor.java

示例14: fillMenuBar

import org.eclipse.ui.actions.ContributionItemFactory; //导入依赖的package包/类
@Override
protected void fillMenuBar(IMenuManager menuBar) {
  //DepAn menu actions
  MenuManager newMenu = new MenuManager("New...", "New...");
  IContributionItem newWizards = ContributionItemFactory.NEW_WIZARD_SHORTLIST
      .create(getActionBarConfigurer().getWindowConfigurer().getWindow());
  newMenu.add(newWizards);

  // window menu actions
  MenuManager viewsMenu = new MenuManager("Views", "Views");
  IContributionItem views = ContributionItemFactory.VIEWS_SHORTLIST
      .create(getActionBarConfigurer().getWindowConfigurer().getWindow());
  viewsMenu.add(views);

  // top level menu
  MenuManager depanMenu = new MenuManager("&DepAn", "DepAn");
  depanMenu.add(newMenu);
  depanMenu.add(new Separator());
  depanMenu.add(saveAction);
  depanMenu.add(saveAsAction);
  depanMenu.add(new Separator());
  depanMenu.add(exitAction);

  MenuManager windowMenu = new MenuManager("&Window", "Window");
  windowMenu.add(viewsMenu);
  windowMenu.add(preferencesAction);

  MenuManager helpMenu = new MenuManager("&Help", "Help");
  helpMenu.add(aboutAction);

  menuBar.add(depanMenu);
  // Room for Edit, View, etc.
  menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
  menuBar.add(windowMenu);
  menuBar.add(helpMenu);
}
 
开发者ID:google,项目名称:depan,代码行数:37,代码来源:ApplicationActionBarAdvisor.java

示例15: fillCoolBar

import org.eclipse.ui.actions.ContributionItemFactory; //导入依赖的package包/类
@Override
protected void fillCoolBar(ICoolBarManager coolBar) {
  IToolBarManager toolbar = new ToolBarManager(coolBar.getStyle());
  toolbar.add(saveAction);
  toolbar.add(ContributionItemFactory.NEW_WIZARD_SHORTLIST
      .create(getActionBarConfigurer().getWindowConfigurer().getWindow()));

  coolBar.add(toolbar);
  // allow contributions here with id "additions" (MB_ADDITIONS)
  coolBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
}
 
开发者ID:google,项目名称:depan,代码行数:12,代码来源:ApplicationActionBarAdvisor.java


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