Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 13:48 Go to next message
Christoph Keimel is currently offline Christoph KeimelFriend
Messages: 386
Registered: December 2010
Location: Germany
Senior Member
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 13:09 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

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 10:01 Go to previous messageGo to next message
Christoph Keimel is currently offline Christoph KeimelFriend
Messages: 386
Registered: December 2010
Location: Germany
Senior Member
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 11:27 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

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: Tue Dec 23 03:10:46 GMT 2014

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

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