开发者

javascript project facet name?

开发者 https://www.devze.com 2023-01-31 16:53 出处:网络
Would somebody let me know what is the name of JavaScript facet (not nature) in Eclipse? I found name of \"Dynamic Web Module\" facet i.e, \"jst.web\" but could not find for JavaScript. I have to add

Would somebody let me know what is the name of JavaScript facet (not nature) in Eclipse? I found name of "Dynamic Web Module" facet i.e, "jst.web" but could not find for JavaScript. I have to add it as required facets in my facet.

Here is relevant fragment开发者_如何转开发 of my plugin.xml:

<project-facet-version facet="mytool" version="1.0">
    <constraint>
        <requires facet="jst.web" version="3.0"/> <!-- Dynamic Web Module -->
        <requires facet="???????" version="1.0"/> <!-- JavaScript Project -->
    </constraint>
    <action type="INSTALL" id="mytool.install">
        <config-factory class="mytool.MyFacetInstallConfig$Factory"/>
        <delegate class="mytool.MyFacetInstallDelegate"/>
    </action>
</project-facet-version>


Do you mean the JavaScript nature? That's "org.eclipse.wst.jsdt.core.jsNature".

To add a given nature, you need the IProject for a given projject, and then get its IProjectDescription. Create a String array with all the existing natures plus your new one[s], and set that back into the project description. Finally, set the description back into the project (which triggers an update IIRC, even though you're using the exact same object).


Got it. It's wst.jsdt.web.
Thank you everybody who has spent time to find the answer.

0

精彩评论

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