I have a tree created using TreeViewer
. I want to disable a menu item say "Expand All" when user right clicks on the last tree item (i.e., tree item does not have a child). Using PropertyTester
i am able to achieve this.
plugin.xml code:
<enabledWhen>
<with
variable="selection">
<iterate
ifEmpty="false">
<instanceof
value="com.xxx.automation.touchstone.model.GUIObject">
</instanceof>
</iterate>
<test
forcePluginActivation="true"
property="com.xxx.automation.touchstone.testers.GUIObjects.canExpandAll"
value="true">
</test>
</with>
</enabledWhen>
I want to know if we can achieve the same without using property tester class. I mean using ContentProvider
's hasChildren
method within the plugin xml .
Thoughts