Faceted Project Presets

org.eclipse.wst.common.project.facet.core.presets

2.0

A preset represents a common configuration of facets and their versions that give a user a starting point when configuring a project. Presets can either be static or dynamic. Static presets are fully specified in this extension point. Dynamic presets are created using an extender-supplied factory that can take into account the context in which the preset will be used in. Static presets can also extend other presets.

To programmatically define a preset, use the ProjectFacetsManager.definePreset() methods.

<!ELEMENT extension (static-preset* , dynamic-preset*)>

<!ATTLIST extension

point CDATA #REQUIRED

id    CDATA #IMPLIED

name  CDATA #IMPLIED>


<!ELEMENT static-preset (label? , description? , facet*)>

<!ATTLIST static-preset

id      CDATA #REQUIRED

extends CDATA #IMPLIED>

Defines a static preset. A static preset is fully specified in the extension point.



<!ELEMENT label (#PCDATA)>

The localizable name that is presented to the user. If not specified, the id will be used for a label.



<!ELEMENT description (#PCDATA)>

The description text.



<!ELEMENT facet EMPTY>

<!ATTLIST facet

id      CDATA #REQUIRED

version CDATA #REQUIRED>

Specifies the facet that is part of this preset.



<!ELEMENT dynamic-preset (factory)>

<!ATTLIST dynamic-preset

id CDATA #IMPLIED>

Defines a dynamic preset. A dynamic preset uses a factory to synthesize the preset definition on the fly based on the context in which it will be used.



<!ELEMENT factory EMPTY>

<!ATTLIST factory

class CDATA #REQUIRED>

Specifies the factory.



<extension point=

"org.eclipse.wst.common.project.facet.core.presets"

>

<!-- Defines a dynamic preset which will be synthesized by the provided factory. This particular preset is actually supplied by the Faceted Project Framework. What it resolves to depends on the context. If project does not target a runtime, it will contain only the fixed facets with their default versions. If project targets one or more runtime, this preset will contain facets that are specified to be the default for the primary runtime. -->

<preset id=

"default.configuration"

>

<factory class=

"org.eclipse.wst.common.project.facet.core.internal.DefaultConfigurationPresetFactory"

/>

</preset>

<!-- Creates a preset which extends the

"default.configuration"

preset and adds two facets. -->

<preset id=

"my.favorite.preset"

extends=

"default.configuration"

>

<label>

My Favorite Configuration

</label>

<description>

Here is the description of my favorite configuration.

</description>

<facet id=

"facet_a"

version=

"1.2"

/>

<facet id=

"facet_b"

version=

"2.0"

/>

</preset>

</extension>