Eclipse RCP Plugin.xml命令绑定启用,选择计数大于1

时间:2013-06-28 14:45:34

标签: java xml eclipse eclipse-plugin eclipse-rcp

我正在尝试在选择2个或更多元素时启用此命令。这是我的plugin.xml片段:

<binding
  commandId="com.stackoverflow.commands.myCommand"
  rank="100">
 <enablement>
  <and>
   <count
    value="2">
   </count>
  </and>
 </enablement>
</binding>

这显然只有在选择了2个元素时才有效。有什么想法吗?

1 个答案:

答案 0 :(得分:1)

<not><or>一起使用:

<binding
    commandId="com.stackoverflow.commands.myCommand"
    rank="100">
<enablement>
<not>
    <or>
        <count value="0" />   
        <count value="1" />
    </or>
</not>
</enablement>

我没有尝试过,但它应该有用。

相关问题