本文整理汇总了Java中org.eclipse.ui.IWorkbenchActionConstants.M_FILE属性的典型用法代码示例。如果您正苦于以下问题:Java IWorkbenchActionConstants.M_FILE属性的具体用法?Java IWorkbenchActionConstants.M_FILE怎么用?Java IWorkbenchActionConstants.M_FILE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.ui.IWorkbenchActionConstants
的用法示例。
在下文中一共展示了IWorkbenchActionConstants.M_FILE属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createFileMenu
/**
* 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;
}
示例2: createFileMenu
/**
* 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;
}
示例3: fillMenuBar
protected void fillMenuBar(IMenuManager menuBar) {
MenuManager fileMenu = new MenuManager("&File", IWorkbenchActionConstants.M_FILE);
MenuManager helpMenu = new MenuManager("&Help", IWorkbenchActionConstants.M_HELP);
menuBar.add(fileMenu);
// Add a group marker indicating where action set menus will appear.
menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
menuBar.add(helpMenu);
// File
fileMenu.add(newWindowAction);
fileMenu.add(new Separator());
fileMenu.add(messagePopupAction);
fileMenu.add(openViewAction);
fileMenu.add(new Separator());
fileMenu.add(exitAction);
// Help
helpMenu.add(aboutAction);
}
示例4: createFileMenu
/**
* 创建文件菜单
* @return 返回文件菜单的 menu manager;
*/
private MenuManager createFileMenu() {
MenuManager menu = new MenuManager(Messages.getString("ts.ApplicationActionBarAdvisor.menu.file"),
IWorkbenchActionConstants.M_FILE); // &File
menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_START));
// 添加 new.ext group,这样 IDE 中定义的 Open File... 可以显示在最顶端
menu.add(new GroupMarker(IWorkbenchActionConstants.NEW_EXT));
menu.add(new Separator());
menu.add(new GroupMarker(IWorkbenchActionConstants.CLOSE_EXT));
menu.add(new GroupMarker("xliff.switch"));
menu.add(new GroupMarker("rtf.switch"));
menu.add(new GroupMarker("xliff.split"));
menu.add(new Separator());
// 设置保存文件记录条数为 5 条
WorkbenchPlugin.getDefault().getPreferenceStore().setValue(IPreferenceConstants.RECENT_FILES, 5);
menu.add(new GroupMarker(IWorkbenchActionConstants.HISTORY_GROUP));
menu.add(exitAction);
menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_END));
return menu;
}
示例5: fillMenuBar
@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 );
menuBar.add ( fileMenu );
// Add a group marker indicating where action set menus will appear.
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 ( this.aboutAction );
helpMenu.add ( getAction ( ActionFactory.INTRO.getId () ) );
}
示例6: fillMenuBar
@Override
protected void fillMenuBar(final IMenuManager menuBar) {
final MenuManager fileMenu = new MenuManager("&Datei", IWorkbenchActionConstants.M_FILE);
final MenuManager helpMenu = new MenuManager("&Hilfe", IWorkbenchActionConstants.M_HELP);
menuBar.add(fileMenu);
// Add a group marker indicating where action set menus will appear.
menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
menuBar.add(helpMenu);
}
示例7: createFileMenu
/**
* 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;
}
示例8: createFileToolbar
protected ToolBarContributionItem createFileToolbar(ICoolBarManager coolBar) {
IToolBarManager toolBar = new ToolBarManager(coolBar.getStyle());
toolBar.add(new GroupMarker(IWorkbenchActionConstants.FILE_START));
toolBar.add(new GroupMarker(IWorkbenchActionConstants.NEW_EXT));
toolBar.add(new GroupMarker(IWorkbenchActionConstants.OPEN_EXT));
toolBar.add(getGlobalAction(ActionFactory.SAVE));
toolBar.add(new GroupMarker(IWorkbenchActionConstants.SAVE_EXT));
toolBar.add(new GroupMarker(IWorkbenchActionConstants.IMPORT_EXT));
toolBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
toolBar.add(new GroupMarker(IWorkbenchActionConstants.FILE_END));
return new ToolBarContributionItem(toolBar, IWorkbenchActionConstants.M_FILE);
}
示例9: createFileMenu
/**
* 创建文件菜单
* @return 返回文件菜单的 menu manager;
*/
private MenuManager createFileMenu() {
MenuManager menu = new MenuManager(Messages.getString("ts.ApplicationActionBarAdvisor.menu.file"),
IWorkbenchActionConstants.M_FILE); // &File
menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_START));
// 添加 new.ext group,这样 IDE 中定义的 Open File... 可以显示在最顶端
// menu.add(newAction);
menu.add(new GroupMarker(IWorkbenchActionConstants.NEW_EXT));
menu.add(new Separator());
menu.add(closeAction);
menu.add(closeAllAction);
menu.add(refreshAction);
// menu.add(new Separator("net.heartsome.cat.ts.ui.menu.file.separator"));
menu.add(new GroupMarker("xliff.switch"));
menu.add(new GroupMarker("rtf.switch"));
menu.add(new GroupMarker("xliff.split"));
menu.add(new Separator());
// 设置保存文件记录条数为 5 条
WorkbenchPlugin.getDefault().getPreferenceStore().setValue(IPreferenceConstants.RECENT_FILES, 5);
// 添加文件访问列表
ContributionItemFactory REOPEN_EDITORS = new ContributionItemFactory("reopenEditors") { //$NON-NLS-1$
/* (non-javadoc) method declared on ContributionItemFactory */
public IContributionItem create(IWorkbenchWindow window) {
if (window == null) {
throw new IllegalArgumentException();
}
return new ReopenEditorMenu(window, getId(), false);
}
};
menu.add(REOPEN_EDITORS.create(window));
menu.add(exitAction);
menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_END));
return menu;
}
示例10: fillMenuBar
protected void fillMenuBar(IMenuManager menuBar) {
MenuManager fileMenu = new MenuManager("&File",
IWorkbenchActionConstants.M_FILE);
menuBar.add(fileMenu);
fileMenu.add(exitAction);
MenuManager editMenu = new MenuManager("&Edit",
IWorkbenchActionConstants.M_EDIT);
menuBar.add(editMenu);
editMenu.add(preferenceAction);
}
示例11: fillMenuBar
@Override
protected void fillMenuBar(IMenuManager menuBar) {
MenuManager fileMenu = new MenuManager("&File", IWorkbenchActionConstants.M_FILE);
menuBar.add(fileMenu);
fileMenu.add(exitAction);
MenuManager editMenu = new MenuManager("&Edit", IWorkbenchActionConstants.M_EDIT);
menuBar.add(editMenu);
editMenu.add(preferenceAction);
}
示例12: createFileMenu
/**
* 创建文件菜单
* @return 返回文件菜单的 menu manager;
*/
private MenuManager createFileMenu() {
MenuManager menu = new MenuManager(Messages.getString("ts.ApplicationActionBarAdvisor.menu.file"),
IWorkbenchActionConstants.M_FILE); // &File
menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_START));
// 添加 new.ext group,这样 IDE 中定义的 Open File... 可以显示在最顶端
menu.add(new GroupMarker(IWorkbenchActionConstants.NEW_EXT));
menu.add(new Separator());
menu.add(new GroupMarker(IWorkbenchActionConstants.CLOSE_EXT));
menu.add(new GroupMarker("xliff.switch"));
menu.add(new GroupMarker("rtf.switch"));
menu.add(new GroupMarker("xliff.split"));
menu.add(new Separator());
// 设置保存文件记录条数为 5 条
WorkbenchPlugin.getDefault().getPreferenceStore().setValue(IPreferenceConstants.RECENT_FILES, 5);
// 添加文件访问列表
ContributionItemFactory REOPEN_EDITORS = new ContributionItemFactory("reopenEditors") { //$NON-NLS-1$
/* (non-javadoc) method declared on ContributionItemFactory */
public IContributionItem create(IWorkbenchWindow window) {
if (window == null) {
throw new IllegalArgumentException();
}
return new ReopenEditorMenu(window, getId(), false);
}
};
menu.add(REOPEN_EDITORS.create(window));
menu.add(exitAction);
menu.add(new GroupMarker(IWorkbenchActionConstants.FILE_END));
return menu;
}
示例13: createFileMenu
/**
* Creates and returns the File menu.
*/
private MenuManager createFileMenu( )
{
MenuManager menu = new MenuManager( DesignerWorkbenchMessages.Workbench_file,
IWorkbenchActionConstants.M_FILE );
MenuManager newMenu = new MenuManager(DesignerWorkbenchMessages.Workbench_new, ActionFactory.NEW.getId());
newMenu.add(newReportAction);
newMenu.add(newLibraryAction);
newMenu.add(newReportTemplateAction);
for (int i=0; i<newActions.length; i++)
{
newMenu.add(newActions[i]);
}
menu.add(newMenu);
menu.add(openFileAction);
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( new GroupMarker( IWorkbenchActionConstants.SAVE_EXT ) );
menu.add( new GroupMarker( IWorkbenchActionConstants.MB_ADDITIONS ) );
menu.add( ContributionItemFactory.REOPEN_EDITORS.create( getWindow( ) ) );
menu.add( new GroupMarker( IWorkbenchActionConstants.MRU ) );
menu.add( new Separator( ) );
menu.add( quitAction );
menu.add( new GroupMarker( IWorkbenchActionConstants.FILE_END ) );
return menu;
}
示例14: fillMenuBar
@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 );
}
示例15: createFileMenu
/**
* 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;
}