visibleWhen 项目有一个特定的方面

visibleWhen project has a particular facet

我需要在项目资源管理器中添加一个菜单项,并且应该仅在项目具有特定方面时才可见。添加了菜单项,但可见性步骤不起作用。

我该怎么做?

plugin.xml:

<menuContribution
    locationURI="popup:myMenu?after=additions">
    <command
        commandId="someCommandID"
        label="SomeCommandLabel"
        style="push">
<visibleWhen>
  <with variable="selection">
    <iterate operator="and" ifEmpty="false">
      <test property="org.eclipse.wst.common.project.facet.core.facets" 
              value="SomeFacet" />
    </iterate>
 </with>
</visibleWhen>
    </command>
</menuContribution>

谢谢!

项目方面的正确 test 是:

<test 
  forcePluginActivation="true"
  property="org.eclipse.wst.common.project.facet.core.projectFacet"
  value="facet id"/>