|
Re: Dynamic menu contributions [message #909029 is a reply to message #908970] |
Thu, 06 September 2012 12:44 |
|
Quote: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?
Eclipse4 introduced a whole new paradigm, the same functionality exists just not through the same methods.
Quote:Am I required to contribute such elements by means of processor contributions
No, you can supply it through any application or fragment model.
Quote:or is support for it only not yet implemented!
Support exists.
Quote:What is the purpose of MMenuContribution, as it's not possible to execute something like MMenu.getChildren().add(MMenuContribution).
You can, you just cannot use a MMenuContribution because a menu contribution is a menu contribution and not a menu item. Menu contributions are meant to hold menu elements which are UIElements and the MMenuContribution is also a UIElement. Thus to dynamically show/hide a MMenuContribution you can use the toBeRendered flag.
http://www.vogella.com/articles/EclipseRCP/article.html
Take care,
JD
|
|
|
Re: Dynamic menu contributions [message #909048 is a reply to message #909029] |
Thu, 06 September 2012 13:08 |
Marco Descher Messages: 197 Registered: October 2010 Location: Austria |
Senior 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 13:11] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05659 seconds