Default Facets Extension Point

Identifier:
org.eclipse.wst.common.project.facet.core.defaultFacets

Description:
Used to specify which facets (and which versions of those facets) should be considered part of the default configuration for a project. The optional context element allows the extender to control the situations when the provided facets should be contributed to the default configuration. The context can restrict applicability to specific runtime types and/or specific fixed facets. If multiple extensions are applicable in a given situations, the facets specified in these extensions will be merged to form a unified default configuration.

Configuration Markup:

<!ELEMENT extension (default-facets+)>

<!ATTLIST extension

point CDATA #REQUIRED

id    CDATA #IMPLIED

name  CDATA #IMPLIED>

(no description available)



<!ELEMENT default-facets (context? , runtime-component* , facet+)>

The root element of the extension.



<!ELEMENT runtime-component EMPTY>

<!ATTLIST runtime-component

id      CDATA #REQUIRED

version CDATA #IMPLIED>

Indicates the the primary targeted runtime for the project is required to have a runtime component of specified type in order for these default facets to apply.



<!ELEMENT facet EMPTY>

<!ATTLIST facet

id      CDATA #REQUIRED

version CDATA #REQUIRED>

Specifies project facet id and version



<!ELEMENT context (runtime-component* , fixed-facet*)>

Describes the situation when the specified facets should be added to the default set.



<!ELEMENT fixed-facet EMPTY>

<!ATTLIST fixed-facet

id CDATA #REQUIRED>

Indicates that the specified facet needs to be one of the project's fixed facets in order for these default facets to apply.



Examples:

The following example declares facet1 (version 1.3) and facet2 (version 5.0) as default facets for runtime component MyRuntimeComponent.


<extension point="org.eclipse.wst.common.project.facet.core.defaultFacets">
  <default-facets>
    <context>
      <runtime-component id="MyRuntimeComponent"/>
    </context>
    <facet id="facet1" version="1.3"/>
    <facet id="facet2" version="5.0"/>
  </default-facets>
</extension>

Multiple plugins can contribute to the set of the default facets for a given runtime component. If the following example is combined with the first one, there will be three default facets associated with MyRuntimeComponent.


<extension point="org.eclipse.wst.common.project.facet.core.defaultFacets">
  <default-facets>
    <context>
      <runtime-component id="MyRuntimeComponent"/>
    </context>
    <facet id="facet3" version="1.2"/>
  </default-facets>
</extension>

Further context information can be specified to control when the specified default facets should be used. Consider the situation where a particular facet should only be enabled by default for a specific project type (as represented by fixed facets). In the following example, facet4 will be only enabled by default if one of the project's fixed facets is fixed.facet1.


<extension point="org.eclipse.wst.common.project.facet.core.defaultFacets">
  <default-facets>
    <context>
      <runtime-component id="MyRuntimeComponent"/>
      <fixed-facet id="fixed.facet1"/>
    </context>
    <facet id="facet4" version="1.0"/>
  </default-facets>
</extension>


Copyright (c) 2008 BEA Systems, Inc. and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html