开发者

How to use more than one <instanceof> condition in <visibleWhen>?

There are two conditions for a popup menu to appear, I am using the <instanceof..> inside a <visibleWhen> tag in my plugin.xml? I have used the <or>...<instance of>...</or> but It doesn't seem to work. Below is the code

 <visibleWhen>
                 <with  variable="selection">
                            <iterate ifEmpty="false" operator="or">

                         <instanceof value="org.eclipse.core.resources.IFolder"/>
                         <test property="org.eclipse.core.resources.projectNature" 
                           value="org.eclipse.w开发者_运维技巧st.jsdt.core.jsNature"/>
                           <or>
                            <instanceof value="org.eclipse.core.resources.IProject"/>
                             <test property="org.eclipse.core.resources.projectNature" 
                             value="org.eclipse.wst.jsdt.core.jsNature"/>
                           </or>
                  </iterate>
                  </with>
               </visibleWhen>

Any inputs would be really helpful !

Thanks, Abbas


I think you are using <or> wrong (see http://wiki.eclipse.org/Command_Core_Expressions):

<with variable="selection">
    <iterate ifEmpty="false" operator="or">
        <or>
            <and>
                 <instanceof value="org.eclipse.core.resources.IFolder"/>
                 <test property="org.eclipse.core.resources.projectNature" 
                       value="org.eclipse.wst.jsdt.core.jsNature"/>
            </and>
            <and>
                 <instanceof value="org.eclipse.core.resources.IProject"/>
                 <test property="org.eclipse.core.resources.projectNature" 
                       value="org.eclipse.wst.jsdt.core.jsNature"/>
            </and>
       </or>
   </iterate>
</with>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜