Active Perspective Core Expression [message #1219011] |
Fri, 29 November 2013 10:34  |
Eclipse User |
|
|
|
Hi,
I've already got around this in a different way but is there a core expression to get the Active Perspective Id in pure e4?
I have found below expression online but 'activeWorkbenchWindow.activePerspective' seems not to contain the Active Perspective Id. Is this known to be broken in e4?
<extension point="org.eclipse.core.expressions.definitions">
<definition id="onValidationPerspective">
<with variable="activeWorkbenchWindow.activePerspective">
<equals value="com.sample.perspective1"/>
</with>
</definition>
</extension>
I also did try querying the variable with context.get("activeWorkbenchWindow.activePerspective") but it always returns 'null'.
Is there any other core expression that replaces this in e4?
Regards,
Ozgur.
|
|
|
|
|
Re: Active Perspective Core Expression [message #1221291 is a reply to message #1221040] |
Tue, 17 December 2013 05:19   |
Eclipse User |
|
|
|
Eric,
Thanks very much for the direction. However, let's say for Handled Popup Menu Items, if we use @CanExecute rather than Visible-When, this just grays out the menu item instead of totally hiding it. So, I think we cannot achieve the exactly same behaviour.
Also, using @CanExecute means handling this at the command handler level, however, where the required functionality is modifying the visibility of the menu item, this should be handled at a central location regardless of individual handlers I think. So, this is where we need Visible-When. However, I appreciate why you are in favour of POJOs and DI as opposed to using core expressions, so maybe we need a new mechanism to be able to accommodate POJOs as Visible-When handlers. Does that make sense? Either an existing annotation like @CanExecute can be used or a new one (i.e. @IsVisible) can be appointed for this purpose.
I personally feel that current Core Expression definition mechanism is a bit lengthy anyway, so, replacing this with (or extending to) POJOs for Visible-When can also simplify the process.
Regards,
Ozgur.
|
|
|
|
Powered by
FUDForum. Page generated in 0.03320 seconds