| Dynamic menu contributions [message #908970] |
Thu, 06 September 2012 06:19  |
Marco Descher Messages: 37 Registered: October 2010 Location: Austria |
Member |
|
|
I want to realize a dynamic menu contribution to the menu of a handler located in a view toolbar. In Eclipse 3 it was possible to add "dynamic" as org.eclipse.ui.menus contribution to a Menu!
I already found out about www.vogella.com/blog/2010/10/26/processors-e4-model explaining on how to dynamically contribute to menus by means of processor model extensions.
But to set it into specific questions:
- Why is it not possible to use the dynamic contribution element in the e4 tooling on an element of MMenu as it was possible to contribute in Eclipse 3.x, where you had to implement a class that extends org.eclipse.jface.action.ContributionItem?
- Am I required to contribute such elements by means of processor contributions or
- is support for it only not yet implemented!
- What is the purpose of MMenuContribution, as it's not possible to execute something like MMenu.getChildren().add(MMenuContribution).
Thanks a lot for your comments!
|
|
|
|
| Re: Dynamic menu contributions [message #909048 is a reply to message #909029] |
Thu, 06 September 2012 09:08   |
Marco Descher Messages: 37 Registered: October 2010 Location: Austria |
Member |
|
|
Thanks for your answer, yet I am still confused, please let me explain the scenario:
I am placing a button at the toolbar of a contact selector which aims to implement a filter, where the dropdown of the filter symbol allows me to check the filter on
- persons
- organizations
- ...
These are all SWT.CHECK elements which should directly lead to the re-configuration of the respective filter implementation class. And on click of the menu the elements show the resp. state of the filter class. This was no problem to realize in Eclipse 3.x via the dynamic menu contribution and the set of isDynamic() to true.
So it is about a completely dynamic menu implementation which changes on every call of the resp. submenu.
I still do not understand what is the correct way to realize this in Eclipse 4. What is the correct way to realize this within the application model?
Please find the following image to describe the usage within the Eclipse 3.x implementation which I am currently trying to port to Eclipse 4 (unfortunately I can't post the image .... the forum blocks me to do so):
https: dl.dropbox.com/u/72943400/dynamic%20toolbar%20command.png
[Updated on: Thu, 06 September 2012 09:11] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02287 seconds