Managing Project Facet Preferences

Question: What is the best way for managing workspace and project preferences associated with a project facet?

Faceted Project Framework can help you manage preferences associated with your facet. Two scopes are supported. You can store "global" preferences in workspace metadata and project-specific preferences in project metadata. Preferences stored at workspace level will never be deleted, while project-level preferences will be automatically removed when facet is uninstalled.

To access workspace-level preferences, use the following API:

    FacetedProjectFramework.getPreferences( IProjectFacet facet );

To access project-level preferences, use the following API:

    IFacetedProject.getPreferences( IProjectFacet facet );

Regardless of the scope, make sure to call flush() after making the changes to make sure that changes are persisted to disk.