我有一棵使用TreeViewer
. 当用户右键单击最后一个树项(即树项没有子项)时,我想禁用菜单项“全部展开”。使用PropertyTester
我能够做到这一点。plugin.xml 代码:
<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>
我想知道我们是否可以在不使用属性测试器类的情况下实现相同的目标。我的意思是在插件 xml 中使用ContentProvider
'方法。hasChildren
想法