| Summary: | [Commands] Regression in 3.6.2 handler enabledWhen core expression | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Adriaan Peeters <apeeters> |
| Component: | UI | Assignee: | Platform UI Triaged <platform-ui-triaged> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | prakash, pwebster, remy.suen |
| Version: | 3.6.2 | ||
| Target Milestone: | --- | ||
| Hardware: | Macintosh | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | stalebug | ||
In 3.6.2 case that isn't working correctly, can you confirm that your first <test/> is being called and you return false? Is your second <test/> being called? in 3.6.1 vs 3.6.2? PW I can _not_ confirm that the first test is being called (nor on 3.6.1, nor on 3.6.2). I include more information missing from my initial bug report.
<propertyTester ...
properties="dirty"
type="org.eclipse.jface.viewers.ISelection">
</propertyTester>
<propertyTester ...
properties="dirtyEditor"
type="EditorContentProvider">
</propertyTester>
So, the 'dirty' property tester expects a ISelection while the dirtyEditor expects our own EditorContentProvider.
In both 3.6.1 and 3.6.2 _only_ the correct test is called (a number of times) and returns true. The number of times the test is called when clicking between viewparts seems to be different between both versions though.
(In reply to comment #2) > I can _not_ confirm that the first test is being called (nor on 3.6.1, nor on > 3.6.2). I include more information missing from my initial bug report. So you are saying that your dirty property tester is not being called, even in the case that works in 3.6.1? PW (In reply to comment #3) > (In reply to comment #2) > > I can _not_ confirm that the first test is being called (nor on 3.6.1, nor on > > 3.6.2). I include more information missing from my initial bug report. > > So you are saying that your dirty property tester is not being called, even in > the case that works in 3.6.1? Yes, when the focus is on an editor, the 'dirty' property tester is never called. (In reply to comment #4) > Yes, when the focus is on an editor, the 'dirty' property tester is never > called. "The following code results in an enabled handler when the first test fails and the second succeeds on 3.6.1. On 3.6.2 the handler is disabled in the same situation." So you're saying dirty is *never* called in either case, but in 3.6.1 dirtyEditor is checked and in 3.6.2 dirtyEditor is never checked? "I can _not_ confirm that the first test is being called" <- you mean you can confirm the first test is never called? PW (In reply to comment #5) > (In reply to comment #4) > > Yes, when the focus is on an editor, the 'dirty' property tester is never > > called. > > "The following code results in an enabled handler when the first test fails and > the second succeeds on 3.6.1. On 3.6.2 the handler is disabled in the same > situation." I wrote this sentence before I noticed that the test being called depends on the current focus. The regression only arises when an editor is in focus (which implements EditorContentProvider), so let's stick to this case in the remainder of this comment. > So you're saying dirty is *never* called in either case, but in 3.6.1 > dirtyEditor is checked and in 3.6.2 dirtyEditor is never checked? 'dirty' is indeed never called when the focus is on an editor (EditorContentProvider), this seems to be correct behaviour (at least it is not a regression). On 3.6.1 and 3.6.2 'dirtyEditor' is always called when the editor is in focus. The difference/regression is in the result of the 'enabledWhen' section which enables/disables the handler. In 3.6.1 the handler is enabled, on 3.6.2 it is disabled. It seems as if the 'true' result of the dirtyEditor propertytester is ignored. > "I can _not_ confirm that the first test is being called" <- you mean you can > confirm the first test is never called? Yes, I can confirm the first test is never called when the focus is on an editor. My apologies for the fuzzy description, my understanding of the issue is evolving with your questions :) Adriaan 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. |
Build Identifier: 20110203-1100 I noticed a regression between 3.6.1 and 3.6.2 regarding the evaluation of a core expression in the enabledWhen element of a handler. (Might be a more general bug, have not yet been able to test) The following code results in an enabled handler when the first test fails and the second succeeds on 3.6.1. On 3.6.2 the handler is disabled in the same situation. <handler class="...Handler" commandId="..."> <enabledWhen> <or> <with variable="selection"> <test property="dirty"> </test> </with> <with variable="activePart"> <adapt type="EditorContentProvider"> <test property="dirtyEditor"> </test> </adapt> </with> </or> </enabledWhen> </handler> When the with elements are interchanged, it works on both 3.6.1 and 3.6.2. Reproducible: Always