I have just implemented facets for my plugins. But now I want to perform
some extra tasks programmaticaly:
1. to change a certain facet on a project based on the user actions. For
example, my projects have an interpreter (DLTK model) and when the user
chooses a particular interpreter type I want to change/set one of the
facets the project has.
2. is there an API to work with project facets and with the
org.eclipse.wst.common.project.facet.core.xml file. Is there a facet
registry?
The framework API entry point is ProjectFacetsManager class. You will be able to use this class to browse through available facets and to create IFacetedProject objects which let you manipulate specific projects.
Here is a small snippet that installs a facet on an existing faceted project:
You may also want to take a look at IFacetedProjectWorkingCopy (accessible via IFacetedProject.createWorkingCopy() among other means). That interface gives you more control in manipulating various aspects of project's configuration before applying all of the changes in bulk.
Hope this helps and don't hesitate to ask more questions.
The framework API entry point is ProjectFacetsManager class. You will be able to use this class to browse through available facets and to create IFacetedProject objects which let you manipulate specific projects.
Here is a small snippet that installs a facet on an existing faceted project:
You may also want to take a look at IFacetedProjectWorkingCopy (accessible via IFacetedProject.createWorkingCopy() among other means). That interface gives you more control in manipulating various aspects of project's configuration before applying all of the changes in bulk.
Hope this helps and don't hesitate to ask more questions.