* @throws CoreException
*/
public static void createFacetedProject(IProject project,
PHPVersion phpVersion, IProgressMonitor monitor)
throws CoreException {
final IFacetedProject facetedProject = ProjectFacetsManager.create(
project, true, monitor);
// set the fixed facets (they will not be removable by the user)
// the php.component facet will be set to the correct version
// programmatically
final Set<IProjectFacet> fixedFacets = new HashSet<IProjectFacet>();
IProjectFacet coreFacet = ProjectFacetsManager
.getProjectFacet(PHPFacetsConstants.PHP_CORE_COMPONENT);
fixedFacets.add(coreFacet);
IProjectFacet phpFacet = ProjectFacetsManager
.getProjectFacet(PHPFacetsConstants.PHP_COMPONENT);
fixedFacets.add(phpFacet);
facetedProject.setFixedProjectFacets(fixedFacets);
// install the fixed facets
facetedProject.installProjectFacet(coreFacet.getDefaultVersion(), null,
monitor);
facetedProject.installProjectFacet(convertToFacetVersion(phpVersion),
null, monitor);
}