开发者

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

开发者 https://www.devze.com 2023-03-28 09:31 出处:网络
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&g

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

精彩评论

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

关注公众号