Search code examples
eclipseeclipse-rcprcp

RCP handler enabledwhen for multiple 'with' elements


How can I add multiple 'with' elements for enabledwhen? Here's my plugin.xml file

<handler
         class="com.myClass"
         commandId="com.myid">
         <enabledWhen>
           <with variable="menu.enablement">
                   <equals
                         value="true">
                   </equals>
            </with>
            <with variable="menu.request.state">
                   <equals
                         value="true">
                   </equals>
            </with>
         </enabledWhen>
</handler>

I want the enalbledWhen to be true only IF both the with elements evaluate to true but can I add two 'with' elements under the same enabledWhen?


Solution

  • Yes. Use an <and> element as the common parent of both <with>s.