1

Please read with patience, I tried my best to explain the situation, if not please comment -

I have two plugins say A, B. In both of the plugins I defined an "and" expression for a command. One of the conditions in the "and" expression is to test a property lets say myprop. A doesn't depend on B and B doesn't depend on A.

There is a property tester defined in a third plugin lets say C. A , B both depend on C.

And in a fourth plugin D, the extension point for org.eclipse.core.expressions.propertyTesters is defined and the list of properties to be tested by tester defined in plugin C.

A, B depends on plugin D too.

I see a strange behavior in eclipse - Only when perspective defined by plugin B is active the property tester for myprop is called. So when RCP starts if plugin B is not already active, property tester doesn't test the property myprop and it returns unexpected value when I am in perspective of plugin A.

Later when I bring up perspective of plugin B, the property tester tests myprop and the plugin A then starts working properly.

Question : Why the property tester needs plugin B to be active ? How are properties evaluated by eclipse framework, is there an order ? or actually I should ask : When and how is a property tester for a particular property triggered ? Is there any documentation about it?

SomeDude
  • 13,876
  • 5
  • 21
  • 44

1 Answers1

1

You probably need to specify forcePluginActivation="true" on the test element of your expression as it sounds like the plugin containing the property tester has not activated by anything.

greg-449
  • 109,219
  • 232
  • 102
  • 145
  • minutes before I figured out you answered it. Yes I had to specify `forcePluginActivation="true"` to make it work. But I will accept your answer. I have one question though. Is `forcePluginActivation` applied to plugin `D` where my property tester class is defined or to plugin `C` where the extension point is defined in which list of properties to be tested are specified ? I think it should have been applied to `C` because the property tester is hit for other properties. – SomeDude Sep 29 '16 at 20:08
  • It will be the plugin containing the tester class that is activated. – greg-449 Sep 30 '16 at 06:29
  • Actually it is not what I found, when I set a breakpoint in my tester class before I specified `forcePluginActivation` as `true`, the breakpoint was hit which suggests me that the plugin containing the tester class was activated already but it doesn't know about the property that plugin `D` specifies in the `propertyTester` extension. – SomeDude Sep 30 '16 at 14:32