本文整理汇总了Java中org.eclipse.ui.internal.ide.IDEWorkbenchMessages.Workbench_file方法的典型用法代码示例。如果您正苦于以下问题:Java IDEWorkbenchMessages.Workbench_file方法的具体用法?Java IDEWorkbenchMessages.Workbench_file怎么用?Java IDEWorkbenchMessages.Workbench_file使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ui.internal.ide.IDEWorkbenchMessages
的用法示例。
在下文中一共展示了IDEWorkbenchMessages.Workbench_file方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createFileMenu
import org.eclipse.ui.internal.ide.IDEWorkbenchMessages; //导入方法依赖的package包/类
/**
* Create the "File" menu.
*
* @param window
* @return the menu
*/
protected IMenuManager createFileMenu() {
IMenuManager menu = new MenuManager(IDEWorkbenchMessages.Workbench_file, IWorkbenchActionConstants.M_FILE);
menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_START));
menu.add(new GroupMarker(IWorkbenchActionConstants.NEW_EXT));
menu.add(new GroupMarker(IWorkbenchActionConstants.OPEN_EXT));
menu.add(new Separator());
menu.add(getGlobalAction(ActionFactory.CLOSE));
menu.add(getGlobalAction(ActionFactory.CLOSE_ALL));
menu.add(new GroupMarker(IWorkbenchActionConstants.CLOSE_EXT));
menu.add(new Separator());
menu.add(getGlobalAction(ActionFactory.SAVE));
menu.add(getGlobalAction(ActionFactory.SAVE_AS));
menu.add(getGlobalAction(ActionFactory.SAVE_ALL));
// menu.add(getGlobalAction(ActionFactory.REVERT));
menu.add(new GroupMarker(IWorkbenchActionConstants.SAVE_EXT));
menu.add(new Separator());
menu.add(createActionFactoryCommandContributionItem(ActionFactory.PRINT));
menu.add(new GroupMarker(IWorkbenchActionConstants.PRINT_EXT));
menu.add(new Separator());
IWorkbenchWindow workbenchWindow = this.getWindow();
ISelection selection = workbenchWindow.getSelectionService().getSelection();
WizardUtils.addImportWizardSubmenu(menu, getGlobalAction(ActionFactory.IMPORT), workbenchWindow, selection);
WizardUtils.addExportWizardSubmenu(menu, getGlobalAction(ActionFactory.EXPORT), workbenchWindow, selection);
menu.add(new GroupMarker(IWorkbenchActionConstants.IMPORT_EXT));
menu.add(new Separator());
menu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
// menu.add(ContributionItemFactory.REOPEN_EDITORS.create(getWindow()));
menu.add(new Separator());
menu.add(getGlobalAction(ActionFactory.QUIT));
menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_END));
return menu;
}
示例2: createFileMenu
import org.eclipse.ui.internal.ide.IDEWorkbenchMessages; //导入方法依赖的package包/类
/**
* Creates and returns the File menu.
*/
private MenuManager createFileMenu() {
MenuManager menu = new MenuManager(IDEWorkbenchMessages.Workbench_file,
IWorkbenchActionConstants.M_FILE);
menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_START));
{
// create the New submenu, using the same id for it as the New
// action
String newText = IDEWorkbenchMessages.Workbench_new;
String newId = ActionFactory.NEW.getId();
MenuManager newMenu = new MenuManager(newText, newId);
newMenu.setActionDefinitionId("org.eclipse.ui.file.newQuickMenu"); //$NON-NLS-1$
newMenu.add(new Separator(newId));
this.newWizardMenu = new NewWizardMenu(getWindow());
newMenu.add(this.newWizardMenu);
newMenu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
menu.add(newMenu);
}
menu.add(new GroupMarker(IWorkbenchActionConstants.NEW_EXT));
menu.add(new Separator());
menu.add(closeAction);
menu.add(closeAllAction);
// menu.add(closeAllSavedAction);
menu.add(new GroupMarker(IWorkbenchActionConstants.CLOSE_EXT));
menu.add(new Separator());
menu.add(saveAction);
menu.add(saveAsAction);
menu.add(saveAllAction);
menu.add(getRevertItem());
menu.add(new Separator());
menu.add(getMoveItem());
menu.add(getRenameItem());
menu.add(getRefreshItem());
menu.add(new GroupMarker(IWorkbenchActionConstants.SAVE_EXT));
menu.add(new Separator());
menu.add(getPrintItem());
menu.add(new GroupMarker(IWorkbenchActionConstants.PRINT_EXT));
menu.add(new Separator());
menu.add(switchWorkspaceAction);
menu.add(new GroupMarker(IWorkbenchActionConstants.OPEN_EXT));
menu.add(new Separator());
menu.add(importResourcesAction);
menu.add(exportResourcesAction);
menu.add(new GroupMarker(IWorkbenchActionConstants.IMPORT_EXT));
menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
menu.add(new Separator());
menu.add(getPropertiesItem());
menu.add(ContributionItemFactory.REOPEN_EDITORS.create(getWindow()));
menu.add(new GroupMarker(IWorkbenchActionConstants.MRU));
menu.add(new Separator());
// If we're on OS X we shouldn't show this command in the File menu. It
// should be invisible to the user. However, we should not remove it -
// the carbon UI code will do a search through our menu structure
// looking for it when Cmd-Q is invoked (or Quit is chosen from the
// application menu.
ActionContributionItem quitItem = new ActionContributionItem(quitAction);
quitItem.setVisible(!Util.isMac());
menu.add(quitItem);
menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_END));
return menu;
}
示例3: createFileMenu
import org.eclipse.ui.internal.ide.IDEWorkbenchMessages; //导入方法依赖的package包/类
/**
* Creates and returns the File menu.
*/
private MenuManager createFileMenu() {
final MenuManager menu = new MenuManager(IDEWorkbenchMessages.Workbench_file, IWorkbenchActionConstants.M_FILE);
menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_START));
{
// create the New submenu, using the same id for it as the New action
final String newText = IDEWorkbenchMessages.Workbench_new;
final String newId = ActionFactory.NEW.getId();
final MenuManager newMenu = new MenuManager(newText, newId);
newMenu.setActionDefinitionId("org.eclipse.ui.file.newQuickMenu"); //$NON-NLS-1$
newMenu.setImageDescriptor(icons.desc("navigator/navigator.new2"));
newMenu.add(new Separator(newId));
this.newWizardMenu = new BaseNewWizardMenu(getWindow(), null) {
@Override
protected void addItems(final List list) {
addShortcuts(list);
}
};
newMenu.add(this.newWizardMenu);
newMenu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
menu.add(newMenu);
}
menu.add(new GroupMarker(IWorkbenchActionConstants.NEW_EXT));
menu.add(new Separator());
menu.add(closeAction);
menu.add(closeAllAction);
menu.add(new GroupMarker(IWorkbenchActionConstants.CLOSE_EXT));
menu.add(new Separator());
menu.add(saveAction);
menu.add(saveAsAction);
menu.add(saveAllAction);
// menu.add(getRevertItem());
menu.add(new Separator());
menu.add(getMoveItem());
menu.add(getRenameItem());
menu.add(getRefreshItem());
menu.add(new GroupMarker(IWorkbenchActionConstants.SAVE_EXT));
menu.add(new Separator());
menu.add(getPrintItem());
menu.add(new GroupMarker(IWorkbenchActionConstants.PRINT_EXT));
menu.add(new Separator());
menu.add(openWorkspaceAction);
menu.add(new GroupMarker(IWorkbenchActionConstants.OPEN_EXT));
menu.add(new GroupMarker(IWorkbenchActionConstants.IMPORT_EXT));
menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
menu.add(new Separator());
menu.add(getPropertiesItem());
menu.add(ContributionItemFactory.REOPEN_EDITORS.create(getWindow()));
menu.add(new GroupMarker(IWorkbenchActionConstants.MRU));
menu.add(new Separator());
// If we're on OS X we shouldn't show this command in the File menu. It
// should be invisible to the user. However, we should not remove it -
// the carbon UI code will do a search through our menu structure
// looking for it when Cmd-Q is invoked (or Quit is chosen from the
// application menu.
final ActionContributionItem quitItem = new ActionContributionItem(quitAction);
quitItem.setVisible(!Util.isMac());
menu.add(quitItem);
menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_END));
return menu;
}
示例4: createFileMenu
import org.eclipse.ui.internal.ide.IDEWorkbenchMessages; //导入方法依赖的package包/类
/**
* Creates and returns the File menu.
*/
private MenuManager createFileMenu()
{
MenuManager menu =
new MenuManager(IDEWorkbenchMessages.Workbench_file,
IWorkbenchActionConstants.M_FILE);
menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_START));
// create the New submenu, using the same id for it as the New action
String newText = IDEWorkbenchMessages.Workbench_new;
String newId = ActionFactory.NEW.getId();
MenuManager newMenu = new MenuManager(newText, newId);
newMenu.setActionDefinitionId("org.eclipse.ui.file.newQuickMenu"); //$NON-NLS-1$
newMenu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
menu.add(newMenu);
menu.add(new GroupMarker(IWorkbenchActionConstants.NEW_EXT));
menu.add(new Separator());
menu.add(closeAction);
menu.add(closeAllAction);
// menu.add(closeAllSavedAction);
menu.add(new GroupMarker(IWorkbenchActionConstants.CLOSE_EXT));
menu.add(new Separator());
menu.add(saveAction);
menu.add(saveAsAction);
menu.add(saveAllAction);
menu.add(getRevertItem());
menu.add(new Separator());
menu.add(getMoveItem());
menu.add(getRenameItem());
menu.add(getRefreshItem());
menu.add(new GroupMarker(IWorkbenchActionConstants.SAVE_EXT));
menu.add(new Separator());
menu.add(getPrintItem());
menu.add(new GroupMarker(IWorkbenchActionConstants.PRINT_EXT));
menu.add(new Separator());
menu.add(openWorkspaceAction);
menu.add(new GroupMarker(IWorkbenchActionConstants.OPEN_EXT));
menu.add(new Separator());
menu.add(getPropertiesItem());
menu.add(ContributionItemFactory.REOPEN_EDITORS.create(getWindow()));
menu.add(new GroupMarker(IWorkbenchActionConstants.MRU));
menu.add(new Separator());
// If we're on OS X we shouldn't show this command in the File menu. It
// should be invisible to the user. However, we should not remove it -
// the carbon UI code will do a search through our menu structure
// looking for it when Cmd-Q is invoked (or Quit is chosen from the
// application menu.
ActionContributionItem quitItem = new ActionContributionItem(quitAction);
quitItem.setVisible(!Util.isMac());
menu.add(quitItem);
menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_END));
return menu;
}