Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 316065 - [Decorators] org.eclipse.ui.decorators enablement element should support property testers
Summary: [Decorators] org.eclipse.ui.decorators enablement element should support prop...
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows Server 2003
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-07 18:36 EDT by Jason Sholl CLA
Modified: 2019-09-09 18:23 EDT (History)
12 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Sholl CLA 2010-06-07 18:36:21 EDT
The org.eclipse.ui.decorators extension point 'enablement' element does not support the property tester 'test' sub element.  The 'enablement' element does define a notion of 'objectState' element which appears to be similar to a property tester, however because the object state object must implement the org.eclipse.ui.IActionFilter this means the objectState enablement object must be defined in a UI plugin which is limiting.

Our specific adopter scenario is we are decorating an org.eclipse.jdt.core.IMethod object.  This method should only be considered for decoration if this project contains certain facets (org.eclipse.wst.common.facets).  There are already property testers in place down in some of the lower level non UI plugins of WTP capable of making this determination, and these plugins are relatively lightweight to load (and the plugins are actually already loaded in our scenarios), so we would simply like to reuse those property testers.  In any case, because we can not use those property testers our UI plugin is currently being loaded even if the user is not using any of our tooling as soon as the simplest Java file containing a method is opened.  The only potential workaround I can see at this point is to use an objectState enablement element that is not defined in our plugin.  Even if we did that though, it is still skirting the issue because whatever UI plugin the ojbecStateEnablement element is defined in will be forced to load.
Comment 1 Matthew Martire CLA 2010-08-26 18:00:54 EDT
Hey Jason, has any progress been made on this one?
Comment 2 Jason Sholl CLA 2010-08-27 10:51:26 EDT
No progress has been made as far as I can tell.  I merely reported the bug.
Comment 3 Paul Webster CLA 2010-08-30 07:44:19 EDT
Just a note:  This would probably be solved by adding a new element, <enabledWhen/>, that provides access to core expressions like test.  Allowing core expressions will turn any current <enablement/> elements into warning in the PDE editor.

PW
Comment 4 Robert Taniwa CLA 2010-09-27 12:59:18 EDT
Hi,

Is there any outlook for triaging this? This is blocking some changes we are trying to make in the performance space, so we would like to get this one evaluated. Thanks.
Comment 5 Paul Webster CLA 2010-11-25 07:25:29 EST
Some thoughts:

One issue with objectState is it depends on the first contributor to adapt an object to IActionFilter.  Basically the first plugin to add "testable attributes" to an object type limits any other plugin from doing it.

PW
Comment 6 Matthew Martire CLA 2011-08-15 12:29:50 EDT
Can this please be triaged? It is blocking some of our performance improvements.
Comment 7 Oleg Besedin CLA 2011-08-17 11:55:26 EDT
Under the covers, DecoratorDefinition uses [older] ActionExpression. The property testers are not available in ActionExpression. 

To be able to use property testers we'll need to switch to using newer Expression class, meaning replacing the enablement evaluation for all existing decorators. Obviously that brings a great chance to create issues for existing decorators.

Have you tried to place this into the 3.8 plan?
Comment 8 Paul Webster CLA 2011-08-18 09:34:40 EDT
(In reply to comment #7)
> To be able to use property testers we'll need to switch to using newer
> Expression class, meaning replacing the enablement evaluation for all existing
> decorators. Obviously that brings a great chance to create issues for existing
> decorators.

The newer core expressions can be added in a different element.  If it's there, core expressions would be used (and any ActionExpression ignored), if not, the older ActionExpression would be used.

Everything that currently works would continue to work, and users could opt in to the new expression if they want.

PW
Comment 9 Oleg Besedin CLA 2011-08-18 10:45:20 EDT
(In reply to comment #8)
> The newer core expressions can be added in a different element.  If it's there,
> core expressions would be used (and any ActionExpression ignored), if not, the
> older ActionExpression would be used.

Yes, it could be done this way and it will solve this specific defect. On a larger picture, arguably, the biggest architecture problem in 3.x are multiple ways of doing the same thing that are "almost" the same. We already have 2 ways to specify decorator enablement, this will create a 3rd way. To me, this would be a gain for the specific problem vs. making overall picture more convoluted.
Comment 10 Paul Webster CLA 2011-08-19 12:04:27 EDT
(In reply to comment #9)
> Yes, it could be done this way and it will solve this specific defect. On a
> larger picture, arguably, the biggest architecture problem in 3.x are multiple
> ways of doing the same thing that are "almost" the same. We already have 2 ways
> to specify decorator enablement,

What are the 2 ways, ActionExpressions and something else?

For going forward, core expressions and the IEvaluationService is the supported enablement story for 4.x.  If something is to be done, it should be brought in line with that.

PW
Comment 11 Gary Phung CLA 2012-01-29 23:23:39 EST
Any news on whether we should expect "a new way of doing this" in maybe, Juno? Or are we looking to work with the greater picture for 4.x? Just looking to see if we could get some sort of plan for this bug instead of losing track of it.

Gary
Comment 12 Eclipse Genie CLA 2019-09-09 18:23:50 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.