我正在尝试在选择2个或更多元素时启用此命令。这是我的plugin.xml片段:
<binding
commandId="com.stackoverflow.commands.myCommand"
rank="100">
<enablement>
<and>
<count
value="2">
</count>
</and>
</enablement>
</binding>
这显然只有在选择了2个元素时才有效。有什么想法吗?
答案 0 :(得分:1)
将<not>
与<or>
一起使用:
<binding
commandId="com.stackoverflow.commands.myCommand"
rank="100">
<enablement>
<not>
<or>
<count value="0" />
<count value="1" />
</or>
</not>
</enablement>
我没有尝试过,但它应该有用。