|
From: <max...@jb...> - 2006-07-07 10:00:25
|
Facet tutorial with code and slides: http://www.eclipsecon.org/2006/Sub.do?id=241 And here is a snippet from Konstantin (the guy behind the facets) on how to enable facets for non-WTP projects. There exists an api for converting an existing project into a faceted project. That api is... import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager; import org.eclipse.wst.common.project.facet.core.IFacetedProject; final IFacetedProject fpj = ProjectFacetsManager.create( , true, <IProgressMonitor ) That will make the project "facet-enabled", but will not install any facets, set any facets as fixed, or associate the project with a runtime. To then install a java facet, you can do this: import org.eclipse.jst.common.project.facet.JavaFacetUtils; fpj.installProjectFacet( JavaFacetUtils.JAVA_50, null, ) Adjust appropriately depending on which version of the java facet you want. Converting an existing project into a faceted project and auto-detecting which facets should be install is not a typical WTP usecase, so we have no neat api for doing all of this or the associated ui. Thus, if you roll out this functionality, you would not be duplicating anything. Depending on how generic you make it, it may be appropriate to push it down into WTP. Hope that answers your questions. Let me know if you have any other. Thanks, - Konstantin View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3956127#3956127 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3956127 |