0

2 つ以上の要素が選択されているときに、このコマンドを有効にしようとしています。これが私の plugin.xml のスニペットです:

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

これは明らかに、ちょうど 2 つの要素が選択されている場合にのみ機能します。何か案が?

4

1 に答える 1

1

そのように使用<not><or>ます:

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

試したことはありませんが、うまくいくはずです。

于 2013-06-28T15:02:02.257 に答える