Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » e4ActivePart and visible when
e4ActivePart and visible when [message #865418] Mon, 30 April 2012 07:45 Go to previous message
Phill Perryman is currently offline Phill Perryman
Messages: 202
Registered: July 2009
Senior Member
I am trying to make a menu item active when a certain part becomes active. In e3 I used the activeEditorId. I have been trying to use the e4ActivePart variable but from looking at the code using it in an injection it always returns an MPart which in turn contains an object of the type I want.

So a core expression such as with="e4ActivePart" and an instanceOf="MyClass" does not work as the class is always org.eclipse.e4.ui.model.application.ui.basic.MPart.

so
<definition id="activepart">
<with variable="e4ActivePart">
<instanceof value="swb3.quotes.QuoteEditor"></instanceof>
</with>
</definition>

is never true, I tried iterating over the active part in case it contained a collection of user classes.

but
<definition id="activepart">
<with variable="e4ActivePart">
<instanceof value="org.eclipse.e4.ui.model.application.ui.basic.MPart"></instanceof>
</with>
</definition>

is always true.

Is there another way to display a menu item only for certain parts.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic:Using Factories in Class URI for Parts
Next Topic:Compatibility Layer
Goto Forum:
  


Current Time: Sat May 25 02:33:41 EDT 2013

Powered by FUDForum. Page generated in 0.01724 seconds