Skip to main content



      Home
Home » Eclipse Projects » Eclipse 4 » Information on Menus, Contribution, Handlers, Commands, etc.
Information on Menus, Contribution, Handlers, Commands, etc. [message #694735] Sat, 09 July 2011 09:48 Go to next message
Eclipse UserFriend
Hello,

I am looking for some Information on how to work with Menus, Popup Menus, Commands and Handlers in e4.

1) How do I define a Menu to be reusable (i.e. in the Main Menu and as a Popup Menu)?
2) How do I define more than one Handler for a Command and decide which one should be active?
3) What is a Menu Contribution and how do I hook these into my Application? What is the Parent-Id in a Menu Contribution?

Is there some detailed documentation to these topics going more into detail that the standard tutorials?

Thanks!
Christoph

Re: Information on Menus, Contribution, Handlers, Commands, etc. [message #698430 is a reply to message #694735] Tue, 19 July 2011 09:09 Go to previous messageGo to next message
Eclipse UserFriend
The concepts are similar to what is found in the org.eclipse.ui.commands and org.eclipse.ui.menus extension points. They translate almost directly into the model.

As for handlers, you create a handler for a command either in the MApplication, MWindow, or MPart. The lookup order is MPart->MWindow->MApplication, and we'll use the first matching handler for that command that we find.

PW
Re: Information on Menus, Contribution, Handlers, Commands, etc. [message #698821 is a reply to message #698430] Wed, 20 July 2011 06:01 Go to previous messageGo to next message
Eclipse UserFriend
Hi Paul,

thanks for the Info.

So a Menu Contribution is basically the same thing as a Model Fragment with the Element-Id set to the Menu-Container with Featurename "children"?

Regards,
Christoph
Re: Information on Menus, Contribution, Handlers, Commands, etc. [message #698853 is a reply to message #698821] Wed, 20 July 2011 07:27 Go to previous message
Eclipse UserFriend
I think so. MMenuContributions get special processing (they have their own attribute, visibleWhen, that can effect visibility), but they're applied to their parent in an MMenu hierarchy. Fragments are just applied as the model is assembled.

PW
Previous Topic:Please help me evaluate e4 for my application
Next Topic:NPE using the live editor
Goto Forum:
  


Current Time: Fri Jul 04 15:45:42 EDT 2025

Powered by FUDForum. Page generated in 0.04074 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top