Bug 447954 - WorkbenchActionBarContributor.contributeToMenu does not contribute correctly to "Emf Parsley" menu
Summary: WorkbenchActionBarContributor.contributeToMenu does not contribute correctly ...
Status: NEW
Alias: None
Product: EMF.Parsley
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P3 normal
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-20 11:02 EDT by Lorenzo Bettini CLA
Modified: 2014-10-21 09:05 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lorenzo Bettini CLA 2014-10-20 11:02:31 EDT
WorkbenchActionBarContributor.contributeToMenu performs the following operations (see below).

First of all, is the contribution to "Emf Parsley" menu intentional (I mean, do we want such a menu)?
If it is intentional, then it does not work as expected: if you open a Parsley editor, the menu does not appear until another view or editor is selected.

	@Override
	public void contributeToMenu(IMenuManager menuManager) {
		IMenuManager submenuManager = new MenuManager("Emf Parsley",
				"org.eclipse.emf.parsley.MenuID");

		menuManager.insertAfter("additions", submenuManager);
		submenuManager.add(new Separator("settings"));
		submenuManager.add(new Separator("actions"));
		submenuManager.add(new Separator("additions"));
		submenuManager.add(new Separator("additions-end"));

		emfActionManager.contributeToMenu(submenuManager);

		submenuManager.addMenuListener(new IMenuListener() {
			public void menuAboutToShow(IMenuManager menuManager) {
				menuManager.updateAll(true);
			}
		});

		addGlobalActions(submenuManager);
	}
Comment 1 Lorenzo Bettini CLA 2014-10-21 08:09:43 EDT
Can it be due to the fact that upon first invocation there's no selected object and thus the menu would be empty?
Comment 2 Francesco Guidieri CLA 2014-10-21 08:37:07 EDT
Yes, it could be the answer. 

In any case I don't think it's intentional, and probably we can remove this part of code.
Comment 3 Lorenzo Bettini CLA 2014-10-21 09:05:45 EDT
OK, for the moment I commented that out... it would be nice to contribute to the Edit menu though :)

On the branch 'menus' I'm heavily refactoring all that stuff, see, e.g., https://git.eclipse.org/r/#/c/35216/, in particular everything is delegated to the EditingMenuBuilder which is intended to be polymorphically customized.