Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Can a handler be enabled without being active?
Can a handler be enabled without being active? [message #480614] Mon, 17 August 2009 18:37 Go to next message
Eclipse UserFriend
If not: Why does Eclipse bother to evaluate enabledWhen even when
activeWhen is false?

(handler)
(activeWhen)
activeEditorId (with)
fooEditor
(enabledWhen)
activeEditor (with)
bar (test)

I'd expect the "receiver" in the bar PropertyTester to always be fooEditor
instances, but the test method is invoked for other editors as well!
Re: Can a handler be enabled without being active? [message #480702 is a reply to message #480614] Tue, 18 August 2009 05:44 Go to previous messageGo to next message
Eclipse UserFriend
If the expressions are given to the IEvaluationService they will be evaluated on variable change. The IEvaluationService doesn't know active vs enabled.

1) your property type determines what the receiver will be ... if you make it IEditorPart instead of your concrete instance, for example.

2) as an optimization (especially for expressions that would be called a lot) you can use properties like:

<and>
<instanceof value="org.example.MyEditor"/>
<test property="org.example.bar" .../>
</and>

PW
Re: Can a handler be enabled without bein g active? [message #481175 is a reply to message #480702] Wed, 19 August 2009 19:58 Go to previous messageGo to next message
Eclipse UserFriend
Paul Webster wrote:
> <and>
> <instanceof value="org.example.MyEditor"/>
> <test property="org.example.bar" .../>
> </and>

The additional instanceof here is equivalent to having a propertyTester
with type=org.example.MyEditor, right?
Re: Can a handler be enabled without bein g active? [message #481596 is a reply to message #481175] Fri, 21 August 2009 13:17 Go to previous message
Eclipse UserFriend
Yes you should type your property testers as much as feasible. But because a property test with a type that doesn't match the current variable type throws an exception, it is often just better to use AND (instanceof, test) so that the tester won't be called if the type doesn't match.

PW
Previous Topic:[CVS] tags and branch
Next Topic:JSP editor detects java errors and warnings, but offers no fixes
Goto Forum:
  


Current Time: Wed Jul 23 16:03:57 EDT 2025

Powered by FUDForum. Page generated in 0.56689 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top