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.