package org.csstudio.utility.adlparser;

import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.actions.ActionFactory;
import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;
import org.eclipse.ui.application.ActionBarAdvisor;
import org.eclipse.ui.application.IActionBarConfigurer;

/**
 * An action bar advisor is responsible for creating, adding, and disposing of
 * the actions added to a workbench window. Each window will be populated with
 * new actions.
 */
public class ApplicationActionBarAdvisor extends ActionBarAdvisor {

	// Actions - important to allocate these only in makeActions, and then use
	// them
	// in the fill methods. This ensures that the actions aren't recreated
	// when fillActionBars is called with FILL_PROXY.
	private IWorkbenchAction exitAction;

	public ApplicationActionBarAdvisor(IActionBarConfigurer configurer) {
		super(configurer);
	}

	protected void makeActions(final IWorkbenchWindow window) {
		// Creates the actions and registers them.
		// Registering is needed to ensure that key bindings work.
		// The corresponding commands keybindings are defined in the plugin.xml
		// file.
		// Registering also provides automatic disposal of the actions when
		// the window is closed.

		exitAction = ActionFactory.QUIT.create(window);
		register(exitAction);
	}

	protected void fillMenuBar(IMenuManager menuBar) {
		MenuManager fileMenu = new MenuManager("&File",
				IWorkbenchActionConstants.M_FILE);
		menuBar.add(fileMenu);
		fileMenu.add(exitAction);
	}

}

@@ -34,16 +34,67 @@
 arser;%0A%0A
+import org.eclipse.jface.action.IContributionItem;%0A
 import o
@@ -310,16 +310,71 @@
 actory;%0A
+import org.eclipse.ui.actions.ContributionItemFactory;%0A
 import o
@@ -1032,16 +1032,227 @@
 tAction;
+%0A%09private IWorkbenchAction perspectiveAction;%0A%09private IWorkbenchAction saveAction;%0A%09private IWorkbenchAction saveAsAction;%0A%09private IWorkbenchAction preferencesAction;%0A%09private IContributionItem showViewAction;
 %0A%0A%09publi
@@ -1747,197 +1747,965 @@
 ;%0A%09%09
-register(exitAction);%0A%09%7D%0A%0A%09protected void fillMenuBar(IMenuManager menuBar) %7B%0A%09%09MenuManager fileMenu = new MenuManager(%22&File%22,%0A%09%09%09%09IWorkbenchActionConstants.M_FILE);%0A%09%09menuBar.add(fileMenu
+perspectiveAction = ActionFactory.OPEN_PERSPECTIVE_DIALOG.create(window);%0A%09%09showViewAction = ContributionItemFactory.VIEWS_SHORTLIST.create(window);%0A%09%09saveAction = ActionFactory.SAVE.create(window);%0A%09%09saveAsAction = ActionFactory.SAVE_AS.create(window);%0A%09%09preferencesAction = ActionFactory.PREFERENCES.create(window);%0A%09%09register(exitAction);%0A%09%09register(perspectiveAction);%0A%09%09register(saveAction);%0A%09%09register(saveAsAction);%0A%09%09register(preferencesAction);%0A%09%7D%0A%0A%09protected void fillMenuBar(IMenuManager menuBar) %7B%0A%09%09MenuManager fileMenu = new MenuManager(%22&File%22,%0A%09%09%09%09IWorkbenchActionConstants.M_FILE);%0A%09%09MenuManager windowMenu = new MenuManager(%22&Window%22,%0A%09%09%09%09IWorkbenchActionConstants.M_WINDOW);%0A%09%09menuBar.add(fileMenu);%0A%09%09menuBar.add(windowMenu);%0A%09%09windowMenu.add(perspectiveAction);%0A%09%09windowMenu.add(showViewAction);%0A%09%09fileMenu.add(saveAction);%0A%09%09System.out.println (%22hello from fill menubar%22);%0A%09%09fileMenu.add(saveAsAction);%0A%09%09fileMenu.add(preferencesAction
 );%0A%09

Add menu items to make manual tests easier.