|Custom visible-when in standalone RCP application [message #1043832]
||Thu, 18 April 2013 07:08
Registered: April 2013
I am currently working on a RCP application that shall serve as a standalone application and not as a plugin for the Eclipse IDE.
What I am currently trying to do is to have a "Show View" menu entry which is set up in my persistent application model (application.e4xmi, I created the handledMenuItems for the views I have).
My problem now is that I need some kind of validation so that the submenu entry for a special view / part is only displayed in case it is closed. My idea was to use a visible-when clause which references a key-value pair in the application context.
In order to keep track of the visibility of a part I added a LifeCycle class via the lifeCycleURI to my product extension. In the postContextCreate method I subscribe to the UIEvents.UIElement.TOPIC_TOBERENDERED event. The EventHandler then tests, if the ELEMENT that fired the event is of type MPart. Then I only need to add a custom key-value pair to the application context but here I get stuck: I somehow cannot @Inject the application or reference a class which is not part of the application.e4xmi.
Is this approach too complicated? Is there a better way of solving the problem?
Thank you in advance.
[Updated on: Thu, 18 April 2013 20:20]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.08470 seconds