|
Re: Headless facet installation [message #548700 is a reply to message #548693] |
Thu, 22 July 2010 17:00 |
Konstantin Komissarchik Messages: 1077 Registered: July 2009 |
Senior Member |
|
|
Hi Barry,
You haven't indicated what you have tried or what failures you are getting. Note that the Dynamic Web Module facet (id jst.web) requires Java facet (id jst.java).
Here is a standalone snippet...
IProjectFacet javaFacet = ProjectFacetsManager.getProjectFacet( "jst.java" );
IProjectFacet webFacet = ProjectFacetsManager.getProjectFacet( "jst.web" );
Set<IProjectFacet> fixedFacets = new HashSet<IProjectFacet>();
fixedFacets.add( javaFacet );
fixedFacets.add( webFacet );
IFacetedProject fproj = ProjectFacetsManager.create( "my-project", null, null );
fproj.addTargetedRuntime( ..., null );
fproj.installProjectFacet( javaFacet.getVersion( "1.4" ) );
fproj.installProjectFacet( webFacet.getVersion( "2.4" ) );
fproj.setFixedProjectFacets( fixedFacets );
There are various versions of ProjectFacetsManager.create() method that are appropriate for different cases. There is no need to call WtpUtils.addNatures(). That's encapsulated in installation of the web facet.
You can substitute constants for appropriate IProjectFacet and IProjectFacetVersion objects from IJ2EEFacetConstants class.
Hope that helps. Let us know here if you have further questions.
- Konstantin
[Updated on: Thu, 22 July 2010 17:02] Report message to a moderator
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04647 seconds