Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Faceted Project Framework » Re: Headless facet installation
Re: Headless facet installation [message #572678] Thu, 22 July 2010 17:00
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
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.

- Konstantin
Previous Topic:Headless facet installation
Next Topic:Headless facet installation
Goto Forum:
  


Current Time: Fri Jan 17 12:42:58 GMT 2025

Powered by FUDForum. Page generated in 0.03239 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top