Java Code Examples for org.eclipse.ui.IWorkbenchActionConstants#M_WINDOW

The following examples show how to use org.eclipse.ui.IWorkbenchActionConstants#M_WINDOW . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ApplicationActionBarAdvisor.java    From neoscada with Eclipse Public License 1.0 5 votes vote down vote up
@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 () ) );
}
 
Example 2
Source File: DesignerActionBarAdvisor.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Creates and returns the Window menu.
 */
private MenuManager createWindowMenu( )
{
	MenuManager menu = new MenuManager( DesignerWorkbenchMessages.Workbench_window,
			IWorkbenchActionConstants.M_WINDOW );

	addPerspectiveActions( menu );
	menu.add( new Separator( IWorkbenchActionConstants.MB_ADDITIONS ) );
	menu.add( openPreferencesAction );
	return menu;
}
 
Example 3
Source File: ApplicationActionBarAdvisor.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
@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 );
}
 
Example 4
Source File: ClientActionBarAdvisor.java    From ice with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * This operation overrides fillMenuBar to fill the menu bar for ICE.
 */
@Override
protected void fillMenuBar(IMenuManager menuBar) {

	// Create a MenuManager for a File Menu Item and a Window Menu Item
	// MenuManager facilitates the addition of simple and complex menu items
	MenuManager fileMenu = new MenuManager("&File", "file");
	MenuManager window = new MenuManager("&Window",
			IWorkbenchActionConstants.M_WINDOW);

	// Create Perspectives Menu Item
	MenuManager perspectiveMenuManager = new MenuManager("Perspectives",
			"layout");
	perspectiveMenuManager.add(perspectivesMenu);
	// Add it to the Window Menu
	window.add(perspectiveMenuManager);

	// Create the Show View menu item
	MenuManager showViewMenuManager = new MenuManager("Show View",
			"showView");
	showViewMenuManager.add(showViewMenu);
	window.add(showViewMenuManager);

	// Add a Create Item action
	fileMenu.add(createItemAction);
	// Add a Connect to Core action
	// Add an Exit action
	fileMenu.add(exitAction);
	// Add an import action
	fileMenu.add(importFileAction);
	// Add an import action for input files
	fileMenu.add(openImportWizardAction);

	// Create a Help Menu and add the About action to it.
	MenuManager help = new MenuManager("&Help", "help");

	// Add all these MenuManagers to the ActionBarAdvisor's menuBar handle.
	menuBar.add(fileMenu);
	menuBar.add(window);
	menuBar.add(help);

	return;
}
 
Example 5
Source File: ApplicationActionBarAdvisor.java    From elexis-3-core with Eclipse Public License 1.0 4 votes vote down vote up
protected void fillMenuBar(IMenuManager menuBar){
	
	fileMenu =
		new MenuManager(Messages.ApplicationActionBarAdvisor_3,
			IWorkbenchActionConstants.M_FILE);
	fileMenu.addMenuListener(reflectRightsListener);
	editMenu =
		new MenuManager(Messages.ApplicationActionBarAdvisor_4,
			IWorkbenchActionConstants.M_EDIT);
	editMenu.addMenuListener(reflectRightsListener);
	windowMenu =
		new MenuManager(Messages.ApplicationActionBarAdvisor_5,
			IWorkbenchActionConstants.M_WINDOW);
	helpMenu =
		new MenuManager(Messages.ApplicationActionBarAdvisor_6,
			IWorkbenchActionConstants.M_HELP);
	helpMenu.addMenuListener(reflectRightsListener);
	menuBar.add(fileMenu);
	menuBar.add(editMenu);
	menuBar.add(windowMenu);
	menuBar.add(helpMenu);
	
	fileMenu.add(GlobalActions.loginAction);
	fileMenu.add(GlobalActions.changeMandantAction);
	fileMenu.add(GlobalActions.connectWizardAction);
	fileMenu.add(GlobalActions.prefsAction);
	fileMenu.add(new Separator());
	fileMenu.add(GlobalActions.importAction);
	fileMenu.add(new GroupMarker(IMPORTER_GROUP));
	fileMenu.add(new Separator());
	// fileMenu.add(GlobalActions.updateAction);
	fileMenu.add(new GroupMarker(ADDITIONS));
	fileMenu.add(new Separator());
	fileMenu.add(GlobalActions.exitAction);
	
	editMenu.add(GlobalActions.copyAction);
	editMenu.add(GlobalActions.cutAction);
	editMenu.add(GlobalActions.pasteAction);

	
	GlobalActions.perspectiveMenu =
		new MenuManager(Messages.ApplicationActionBarAdvisor_7, "openPerspective"); //$NON-NLS-1$
	perspectiveMenu.add(resetPerspectiveAction);
	windowMenu.add(perspectiveMenu);
	
	GlobalActions.viewMenu = new MenuManager(Messages.ApplicationActionBarAdvisor_9);
	GlobalActions.viewList = ContributionItemFactory.VIEWS_SHORTLIST.create(window);
	GlobalActions.viewMenu.add(GlobalActions.viewList);
	windowMenu.add(GlobalActions.viewMenu);
	windowMenu.addMenuListener(new IMenuListener() {
		
		@Override
		public void menuAboutToShow(IMenuManager manager){
			IContributionItem[] items = manager.getItems();
			for (IContributionItem iContributionItem : items) {
				if( "viewsShortlist".equals(iContributionItem.getId())) {
					iContributionItem.setVisible(CoreHub.acl.request(AC_SHOWVIEW));
				}
			}
		}
	});
	
	/* helpMenu.add(testAction); */
	helpMenu.add(GlobalActions.helpAction);
	helpMenu.add(new Separator("additions"));
	helpMenu.add(new Separator());
	helpMenu.add(GlobalActions.aboutAction);
}