Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » dynamic PopupMenu on Part
dynamic PopupMenu on Part [message #1343776] Fri, 09 May 2014 12:56 Go to next message
Beat Schaller is currently offline Beat SchallerFriend
Messages: 42
Registered: July 2009
Member
We are creating in an editor area programmatically the MInputParts. This MInputParts are created under the MPartStack.
Now I wan't to add an MPopupMenu to each of these Parts to do some actions part-wide. So how can I ad more actions to the 'part' menu (like the 'close' PopupMenu)? Is my only option to provide a toolbar in the part? It would be very nice to just add those action under the close action.

Why isn't it possible under the application model - Menu Contribution to add over the model editor an MPopupMenu? There are only 5 other choices (Separator, Menu, Handled MenuItem, Direct MenuItem, DynamicMenuContribution)?

Do I really have to iterate over application.getMenuContributions and compare the id's to get the menu? no menuService, another way?

And last Question - if I define in MenuContribution my menu. Can I use it in different controls or do I have to clone them?

Thx for any help
Beat
Re: dynamic PopupMenu on Part [message #1343794 is a reply to message #1343776] Fri, 09 May 2014 13:07 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5487
Registered: July 2009
Senior Member
Hi,

I'm not sure I could digest all your questions correctly but let me try it.

on MPopupMenu:

An MPopupMenu is supposed to be used inconjunction with EMenuService -
the Tab-Menu is currently hard coded in the renderer - I think
contributing to the Tab-Menu would require a feature request and until
then you'd have to roll your own renderer.

On MApplication#getMenuContributions: this is only for compat layer use
not in native e4

A popup menu can be assigned to multiple controls inside your part using
EMenuService

Tom

On 09.05.14 14:56, Beat Schaller wrote:
> We are creating in an editor area programmatically the MInputParts. This
> MInputParts are created under the MPartStack.
> Now I wan't to add an MPopupMenu to each of these Parts to do some
> actions part-wide. So how can I ad more actions to the 'part' menu (like
> the 'close' PopupMenu)? Is my only option to provide a toolbar in the
> part? It would be very nice to just add those action under the close
> action.
>
> Why isn't it possible under the application model - Menu Contribution to
> add over the model editor an MPopupMenu? There are only 5 other choices
> (Separator, Menu, Handled MenuItem, Direct MenuItem,
> DynamicMenuContribution)?
>
> Do I really have to iterate over application.getMenuContributions and
> compare the id's to get the menu? no menuService, another way?
> And last Question - if I define in MenuContribution my menu. Can I use
> it in different controls or do I have to clone them?
>
> Thx for any help
> Beat
Re: dynamic PopupMenu on Part [message #1343822 is a reply to message #1343794] Fri, 09 May 2014 13:24 Go to previous message
Beat Schaller is currently offline Beat SchallerFriend
Messages: 42
Registered: July 2009
Member
Thank you Tom

You answered my questions - even I am not happy that I can't add additional actions to the close part action Sad(
I don't want to roll my own renderer -I want to sty 'standard'. So perhaps a feature request. I think for all part-wide actions it would be a good place. A toolbar allways requires additional lines and for complex business applications there is not enough...

Menu Contribution only for compat layer - thank you - didn't see anywhere.

Thx Beat

Previous Topic:Installation Problem Eclipse e4 Tools Bridge for 3.x
Next Topic:Proper way to open window second time, after closing it once
Goto Forum:
  


Current Time: Sat Dec 20 04:28:56 GMT 2014

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

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