[132192] Facets: Support wizard pages for the version change action
[132569] NPE/Web project wizard silent failure when (mis?)using ...
[133353] WebApp Libraries container doesn't recognize ZIP file
[134315] unsupported escaped characters found in ECLIPSE\PLUGINS...
[134380] [project creation] Infopops on page 2 of Dynamic Web pa...
[134615] Facets extension point class attributes should be type ...
diff --git a/plugins/org.eclipse.wst.common.project.facet.core/schemas/facets.exsd b/plugins/org.eclipse.wst.common.project.facet.core/schemas/facets.exsd
index 8904974..09feb23 100644
--- a/plugins/org.eclipse.wst.common.project.facet.core/schemas/facets.exsd
+++ b/plugins/org.eclipse.wst.common.project.facet.core/schemas/facets.exsd
@@ -206,6 +206,9 @@
                <documentation>
                   
                </documentation>
+               <appInfo>
+                  <meta.attribute kind="java" basedOn="java.util.Comparator"/>
+               </appInfo>
             </annotation>
          </attribute>
       </complexType>
@@ -343,6 +346,13 @@
                </documentation>
             </annotation>
          </attribute>
+         <attribute name="id" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
       </complexType>
    </element>
 
@@ -353,6 +363,9 @@
                <documentation>
                   
                </documentation>
+               <appInfo>
+                  <meta.attribute kind="java" basedOn="org.eclipse.wst.common.project.facet.core.IActionConfigFactory"/>
+               </appInfo>
             </annotation>
          </attribute>
       </complexType>
@@ -365,6 +378,9 @@
                <documentation>
                   
                </documentation>
+               <appInfo>
+                  <meta.attribute kind="java" basedOn="org.eclipse.wst.common.project.facet.core.IDelegate"/>
+               </appInfo>
             </annotation>
          </attribute>
       </complexType>
diff --git a/plugins/org.eclipse.wst.common.project.facet.core/schemas/runtimeBridges.exsd b/plugins/org.eclipse.wst.common.project.facet.core/schemas/runtimeBridges.exsd
index 5d51c1e..67c7ad9 100644
--- a/plugins/org.eclipse.wst.common.project.facet.core/schemas/runtimeBridges.exsd
+++ b/plugins/org.eclipse.wst.common.project.facet.core/schemas/runtimeBridges.exsd
@@ -53,6 +53,9 @@
                <documentation>
                   
                </documentation>
+               <appInfo>
+                  <meta.attribute kind="java" basedOn="org.eclipse.wst.common.project.facet.core.runtime.IRuntimeBridge"/>
+               </appInfo>
             </annotation>
          </attribute>
       </complexType>
diff --git a/plugins/org.eclipse.wst.common.project.facet.core/schemas/runtimes.exsd b/plugins/org.eclipse.wst.common.project.facet.core/schemas/runtimes.exsd
index b0fad88..132494e 100644
--- a/plugins/org.eclipse.wst.common.project.facet.core/schemas/runtimes.exsd
+++ b/plugins/org.eclipse.wst.common.project.facet.core/schemas/runtimes.exsd
@@ -54,7 +54,6 @@
       <complexType>
          <sequence>
             <element ref="version-comparator" minOccurs="0" maxOccurs="1"/>
-            <element ref="icon" minOccurs="0" maxOccurs="1"/>
          </sequence>
          <attribute name="id" type="string" use="required">
             <annotation>
@@ -78,19 +77,14 @@
                <documentation>
                   The class name.
                </documentation>
+               <appInfo>
+                  <meta.attribute kind="java" basedOn="java.util.Comparator"/>
+               </appInfo>
             </annotation>
          </attribute>
       </complexType>
    </element>
 
-   <element name="icon" type="string">
-      <annotation>
-         <documentation>
-            Specifies the location of the icon that should be used with this runtime component type.
-         </documentation>
-      </annotation>
-   </element>
-
    <element name="runtime-component-version">
       <annotation>
          <documentation>
@@ -173,6 +167,9 @@
                <documentation>
                   The class name.
                </documentation>
+               <appInfo>
+                  <meta.attribute kind="java" basedOn="org.eclipse.core.runtime.IAdapterFactory"/>
+               </appInfo>
             </annotation>
          </attribute>
       </complexType>
@@ -190,6 +187,9 @@
                <documentation>
                   The class name.
                </documentation>
+               <appInfo>
+                  <meta.attribute kind="java"/>
+               </appInfo>
             </annotation>
          </attribute>
       </complexType>
diff --git a/plugins/org.eclipse.wst.common.project.facet.core/schemas/validators.exsd b/plugins/org.eclipse.wst.common.project.facet.core/schemas/validators.exsd
index 3dc830b..c72eafe 100644
--- a/plugins/org.eclipse.wst.common.project.facet.core/schemas/validators.exsd
+++ b/plugins/org.eclipse.wst.common.project.facet.core/schemas/validators.exsd
@@ -42,7 +42,7 @@
          <attribute name="version" type="string">
             <annotation>
                <documentation>
-                  Specifies the match expression for the runtime component version. The expression should be of the form "2.2,2.5,[3.0-5.3],(7.3", where the comas function as an OR. Brackets and parenthesis are used as part of the range notation. A bracket means inclusive while a parenthesis means exclusive.
+                  Specifies the match expression for the runtime component version. The expression should be of the form &quot;2.2,2.5,[3.0-5.3],(7.3&quot;, where the comas function as an OR. Brackets and parenthesis are used as part of the range notation. A bracket means inclusive while a parenthesis means exclusive.
                </documentation>
             </annotation>
          </attribute>
@@ -59,6 +59,9 @@
                <documentation>
                   
                </documentation>
+               <appInfo>
+                  <meta.attribute kind="java" basedOn="org.eclipse.wst.common.project.facet.core.IFacetedProjectValidator"/>
+               </appInfo>
             </annotation>
          </attribute>
       </complexType>
diff --git a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/IActionDefinition.java b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/IActionDefinition.java
new file mode 100644
index 0000000..816538e
--- /dev/null
+++ b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/IActionDefinition.java
@@ -0,0 +1,33 @@
+/******************************************************************************
+ * Copyright (c) 2006 BEA Systems, Inc.
+ * 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
+ *
+ * Contributors:
+ *    Konstantin Komissarchik - initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.wst.common.project.facet.core;
+
+import org.eclipse.wst.common.project.facet.core.IFacetedProject.Action;
+
+/**
+ * An action is an operation on a single facet within a faceted project to
+ * install, uninstall, or change the version of the facet. An action definition
+ * represents the information supplied by the facet author regarding the
+ * implementation of an action. A single action definition can apply to multiple
+ * facet versions. For instance, the facet author may choose to supply one
+ * action definition for all versions of his facet. 
+ * 
+ * @author <a href="mailto:kosta@bea.com">Konstantin Komissarchik</a>
+ */
+
+public interface IActionDefinition
+{
+    String getId();
+    IProjectFacet getProjectFacet();
+    IVersionExpr getVersionExpr();
+    Action.Type getActionType();
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/IProjectFacetVersion.java b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/IProjectFacetVersion.java
index a1f719e..517e8a4 100644
--- a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/IProjectFacetVersion.java
+++ b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/IProjectFacetVersion.java
@@ -70,6 +70,23 @@
     boolean supports( Action.Type type );
     
     /**
+     * Returns the action definition corresponding to a particular action type
+     * over this project facet version. The {@link supports( Action.Type )} 
+     * method can be used to check whether the action is supported prior to
+     * calling this method.
+     * 
+     * @param type action type
+     * @return the action definition corresponding to a particular action type
+     *   over this project facet version
+     * @throws CoreException if this project facet version does not support the
+     *   provided action type
+     */
+    
+    IActionDefinition getActionDefinition( Action.Type type )
+    
+        throws CoreException;
+    
+    /**
      * Creates a new instance of the config object associated with the specified
      * action on this facet. Will return <code>null</code> if the action 
      * requires no config.
diff --git a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/ProjectFacetsManager.java b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/ProjectFacetsManager.java
index adede7d..88d6d7d 100644
--- a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/ProjectFacetsManager.java
+++ b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/ProjectFacetsManager.java
@@ -82,6 +82,45 @@
     }
     
     /**
+     * Returns all of the available project facet action definitions.
+     * 
+     * @return a set containing all of the available project facets action
+     *   definitions (element type: {@link IActionDefinition})
+     */
+    
+    public static Set getActionDefinitions()
+    {
+        return impl.getActionDefinitions();
+    }
+    
+    /**
+     * Determines whether a given project facet action id is recognized.
+     * 
+     * @param id the id of the project facet action
+     * @return <code>true</code> if the project facet action id is recognized, 
+     *   <code>false</code> otherwise 
+     */
+    
+    public static boolean isActionDefined( final String id )
+    {
+        return impl.isActionDefined( id );
+    }
+    
+    /**
+     * Returns the project facet action definition corresponding to the 
+     * specified action id.
+     * 
+     * @param id the id of the project facet action
+     * @return the project facet action definition
+     * @throws IllegalArgumentException if id is not found
+     */
+    
+    public static IActionDefinition getActionDefinition( final String id )
+    {
+        return impl.getActionDefinition( id );
+    }
+
+    /**
      * Returns all of the categories.
      * 
      * @return a set containing all of the categories (element type: {@link 
diff --git a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/ActionDefinition.java b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/ActionDefinition.java
new file mode 100644
index 0000000..1c8d5d9
--- /dev/null
+++ b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/ActionDefinition.java
@@ -0,0 +1,97 @@
+/******************************************************************************
+ * Copyright (c) 2006 BEA Systems, Inc.
+ * 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
+ *
+ * Contributors:
+ *    Konstantin Komissarchik - initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.wst.common.project.facet.core.internal;
+
+import org.eclipse.wst.common.project.facet.core.IActionDefinition;
+import org.eclipse.wst.common.project.facet.core.IProjectFacet;
+import org.eclipse.wst.common.project.facet.core.IVersionExpr;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject.Action;
+
+/**
+ * The implementation of the <code>IActionDefinition</code> interface.
+ * 
+ * @author <a href="mailto:kosta@bea.com">Konstantin Komissarchik</a>
+ */
+
+public final class ActionDefinition
+
+    implements IActionDefinition
+    
+{
+    private String id;
+    private IProjectFacet facet;
+    private IVersionExpr versionMatchExpr;
+    private Action.Type type;
+    private String delegateClassName;
+    private String configFactoryClassName;
+    
+    public String getId()
+    {
+        return this.id;
+    }
+    
+    void setId( final String id )
+    {
+        this.id = id;
+    }
+    
+    public IProjectFacet getProjectFacet()
+    {
+        return this.facet;
+    }
+    
+    void setProjectFacet( final IProjectFacet facet )
+    {
+        this.facet = facet;
+    }
+    
+    public IVersionExpr getVersionExpr()
+    {
+        return this.versionMatchExpr;
+    }
+    
+    void setVersionExpr( final IVersionExpr expr )
+    {
+        this.versionMatchExpr = expr;
+    }
+    
+    public Action.Type getActionType()
+    {
+        return this.type;
+    }
+    
+    void setActionType( final Action.Type type )
+    {
+        this.type = type;
+    }
+    
+    String getDelegateClassName()
+    {
+        return this.delegateClassName;
+    }
+    
+    void setDelegateClassName( final String delegateClassName )
+    {
+        this.delegateClassName = delegateClassName;
+    }
+    
+    String getConfigFactoryClassName()
+    {
+        return this.configFactoryClassName;
+    }
+    
+    void setConfigFactoryClassName( final String configFactoryClassName )
+    {
+        this.configFactoryClassName = configFactoryClassName;
+    }
+    
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/FacetedProject.properties b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/FacetedProject.properties
index da98ce2..18819ee 100644
--- a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/FacetedProject.properties
+++ b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/FacetedProject.properties
@@ -7,7 +7,7 @@
 facetNotSupported = Runtime {0} does not support project facet {1}.
 illegalModificationMsg = Cannot modify faceted project from within a facet delegate.
 tracingDelegateStarting = \
-\Calling project facet delegate:\n\
+Calling project facet delegate:\n\
 \  facet: {0} : {1}\n\
 \  type:  {2}\n\
 \  class: {3}
diff --git a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/ProjectFacet.java b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/ProjectFacet.java
index e976600..6c819a5 100644
--- a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/ProjectFacet.java
+++ b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/ProjectFacet.java
@@ -191,8 +191,8 @@
         {
             final ActionDefinition def = (ActionDefinition) itr.next();
             
-            if( def.type == type && 
-                def.versionMatchExpr.evaluate( (IVersion) fv ) )
+            if( def.getActionType() == type && 
+                ( (VersionExpr) def.getVersionExpr() ).evaluate( (IVersion) fv ) )
             {
                 if( result == null )
                 {
@@ -252,14 +252,6 @@
         this.eventHandlers.add( h );
     }
     
-    static final class ActionDefinition
-    {
-        public Action.Type type;
-        public VersionExpr versionMatchExpr;
-        public String delegateClassName;
-        public String configFactoryClassName;
-    }
-
     public static final class Resources
     
         extends NLS
diff --git a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/ProjectFacetVersion.java b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/ProjectFacetVersion.java
index faff1b1..72617d5 100644
--- a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/ProjectFacetVersion.java
+++ b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/ProjectFacetVersion.java
@@ -22,13 +22,13 @@
 import org.eclipse.osgi.util.NLS;
 import org.eclipse.wst.common.project.facet.core.IActionConfig;
 import org.eclipse.wst.common.project.facet.core.IActionConfigFactory;
+import org.eclipse.wst.common.project.facet.core.IActionDefinition;
 import org.eclipse.wst.common.project.facet.core.IConstraint;
 import org.eclipse.wst.common.project.facet.core.IDelegate;
 import org.eclipse.wst.common.project.facet.core.IGroup;
 import org.eclipse.wst.common.project.facet.core.IProjectFacet;
 import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
 import org.eclipse.wst.common.project.facet.core.IFacetedProject.Action;
-import org.eclipse.wst.common.project.facet.core.internal.ProjectFacet.ActionDefinition;
 import org.osgi.framework.Bundle;
 
 /**
@@ -99,7 +99,7 @@
     {
         try
         {
-            return this.facet.getActionDefinition( this, type ) != null;
+            return getActionDefinition( type ) != null;
         }
         catch( CoreException e )
         {
@@ -108,6 +108,14 @@
         }
     }
     
+    public IActionDefinition getActionDefinition( final Action.Type type )
+    
+        throws CoreException
+        
+    {
+        return this.facet.getActionDefinition( this, type );
+    }
+    
     public Object createActionConfig( final Action.Type type,
                                       final String pjname )
     
@@ -126,13 +134,13 @@
         final ActionDefinition def
             = this.facet.getActionDefinition( this, type );
         
-        if( def == null || def.configFactoryClassName == null )
+        if( def == null || def.getConfigFactoryClassName() == null )
         {
             return null;
         }
         else
         {
-            final String clname = def.configFactoryClassName;
+            final String clname = def.getConfigFactoryClassName();
             final Object temp = create( clname );
             
             if( ! ( temp instanceof IActionConfigFactory ) )
@@ -364,7 +372,7 @@
                 return null;
             }
             
-            final String clname = def.delegateClassName;
+            final String clname = def.getDelegateClassName();
             delegate = create( clname );
             
             if( ! ( delegate instanceof IDelegate ) )
diff --git a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/ProjectFacetsManagerImpl.java b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/ProjectFacetsManagerImpl.java
index c0b78c8..21a235c 100644
--- a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/ProjectFacetsManagerImpl.java
+++ b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/ProjectFacetsManagerImpl.java
@@ -42,6 +42,7 @@
 import org.eclipse.core.runtime.preferences.IEclipsePreferences;
 import org.eclipse.core.runtime.preferences.InstanceScope;
 import org.eclipse.osgi.util.NLS;
+import org.eclipse.wst.common.project.facet.core.IActionDefinition;
 import org.eclipse.wst.common.project.facet.core.ICategory;
 import org.eclipse.wst.common.project.facet.core.IConstraint;
 import org.eclipse.wst.common.project.facet.core.IFacetedProject;
@@ -51,7 +52,6 @@
 import org.eclipse.wst.common.project.facet.core.IProjectFacet;
 import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
 import org.eclipse.wst.common.project.facet.core.IFacetedProject.Action;
-import org.eclipse.wst.common.project.facet.core.internal.ProjectFacet.ActionDefinition;
 import org.osgi.service.prefs.BackingStoreException;
 import org.osgi.service.prefs.Preferences;
 
@@ -91,6 +91,7 @@
     private static final Set facetsReportedMissing = new HashSet();
     
     private final IndexedSet facets;
+    private final IndexedSet actions;
     private final IndexedSet categories;
     private final IndexedSet presets;
     private final IndexedSet templates;
@@ -100,6 +101,7 @@
     public ProjectFacetsManagerImpl()
     {
         this.facets = new IndexedSet();
+        this.actions = new IndexedSet();
         this.categories = new IndexedSet();
         this.presets = new IndexedSet();
         this.templates = new IndexedSet();
@@ -138,6 +140,30 @@
         return f;
     }
     
+    public Set getActionDefinitions()
+    {
+        return this.actions.getUnmodifiable();
+    }
+    
+    public boolean isActionDefined( final String id )
+    {
+        return this.actions.containsKey( id );
+    }
+    
+    public IActionDefinition getActionDefinition( final String id )
+    {
+        final IActionDefinition adef
+            = (IActionDefinition) this.actions.get( id );
+        
+        if( adef == null )
+        {
+            final String msg = NLS.bind( Resources.actionNotDefined, id );
+            throw new IllegalArgumentException( msg );
+        }
+        
+        return adef;
+    }
+    
     public Set getCategories()
     {
         return this.categories.getUnmodifiable();
@@ -1177,6 +1203,11 @@
             }
         }
         
+        if( descriptor.getLabel() == null )
+        {
+            descriptor.setLabel( id );
+        }
+        
         this.facets.add( id, descriptor );
     }
     
@@ -1329,9 +1360,9 @@
         
         // End of backwards compatibility code.
         
-        def.type = Action.Type.valueOf( type ); 
+        def.setActionType( Action.Type.valueOf( type ) ); 
 
-        if( def.type == null )
+        if( def.getActionType() == null )
         {
             final String msg
                 = NLS.bind( Resources.invalidActionType, type ) +
@@ -1344,7 +1375,7 @@
         
         try
         {
-            def.versionMatchExpr = new VersionExpr( f, version, pluginId );
+            def.setVersionExpr( new VersionExpr( f, version, pluginId ) );
         }
         catch( CoreException e )
         {
@@ -1369,7 +1400,7 @@
                     return;
                 }
                 
-                def.configFactoryClassName = clname;
+                def.setConfigFactoryClassName( clname );
             }
             else if( childName.equals( EL_DELEGATE ) )
             {
@@ -1381,11 +1412,32 @@
                     return;
                 }
                 
-                def.delegateClassName = clname;
+                def.setDelegateClassName( clname );
             }
         }
         
-        f.addActionDefinition( def );
+        String id = config.getAttribute( ATTR_ID );
+        
+        if( id == null )
+        {
+            id = f.getId() + "#" + version + "#" //$NON-NLS-1$ //$NON-NLS-2$ 
+                 + def.getActionType().name();
+        }
+        
+        def.setId( id );
+        
+        if( isActionDefined( id ) )
+        {
+            final String msg
+                = NLS.bind( Resources.actionAlreadyDefined, id, pluginId );
+            
+            FacetCorePlugin.logError( msg );
+        }
+        else
+        {
+            this.actions.add( def.getId(), def );
+            f.addActionDefinition( def );
+        }
     }
     
     private void readEventHandler( final IConfigurationElement config )
@@ -2022,6 +2074,8 @@
         public static String categoryNotDefined;
         public static String facetNotDefined;
         public static String facetVersionNotDefined;
+        public static String actionNotDefined;
+        public static String actionAlreadyDefined;
         public static String groupNotDefined;
         public static String presetNotDefined;
         public static String templateNotDefined;
diff --git a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/ProjectFacetsManagerImpl.properties b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/ProjectFacetsManagerImpl.properties
index a118283..1fbf9be 100644
--- a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/ProjectFacetsManagerImpl.properties
+++ b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/ProjectFacetsManagerImpl.properties
@@ -4,6 +4,8 @@
 categoryNotDefined = Category {0} has not been defined.
 facetNotDefined = Project facet {0} has not been defined.
 facetVersionNotDefined = Version {1} of project facet {0} has not been defined.
+actionNotDefined = Project facet action {0} has not been defined.
+actionAlreadyDefined = Attempt to redefine project facet action "{0}" in plugin {1}.
 groupNotDefined = Project facet group {0} has not been defined.
 presetNotDefined = Preset {0} has not been defined.
 templateNotDefined = Template {0} has not been defined.
@@ -14,13 +16,13 @@
 invalidConflictsConstraint = The conflicts constraint can specify either a "group" attribute or a "facet" attribute and a "version" attribute. The problem was found in plugin {0}.
 
 deprecatedRuntimeChangedAction = \
-\The project facet action "runtime-changed" has been deprecated. It is used in \
-\plugin {0}. Similar functionality is available via the "RUNTIME_CHANGED" \
-\event handler. See extension point org.eclipse.wst.common.project.facet.core.facets \
-\for more information. 
+The project facet action "runtime-changed" has been deprecated. It is used in \
+plugin {0}. Similar functionality is available via the "RUNTIME_CHANGED" \
+event handler. See extension point org.eclipse.wst.common.project.facet.core.facets \
+for more information. 
 
 tracingActionSorting = \
-\Finished sorting faceted project actions.\n\
+Finished sorting faceted project actions.\n\
 \  base = {0}\n\
 \  unsorted = {1}\n\
 \  sorted = {2}\n\
diff --git a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/VersionExpr.properties b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/VersionExpr.properties
index 5d9df28..978d2fb 100644
--- a/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/VersionExpr.properties
+++ b/plugins/org.eclipse.wst.common.project.facet.core/src/org/eclipse/wst/common/project/facet/core/internal/VersionExpr.properties
@@ -1,19 +1,19 @@
 invalidVersionExpr = Version expression "{0}" is invalid.
 
 deprecatedSyntax = \
-\The ">", ">=", "<", and "<=" notation in version expressions has been\
-\ deprecated. It used in plugin {0}. Note that the angle brackets are\
-\ represented via "&lt;" and "&gt;" in the plugin.xml files. The functionality\
-\ has been replaced with range notation. For instance "[X-Y)" means all\
-\ versions greater or equals to X and less than Y. Open ranges such as "(X" or\
-\ "Y]" are also allowed.
+The ">", ">=", "<", and "<=" notation in version expressions has been \
+deprecated. It used in plugin {0}. Note that the angle brackets are \
+represented via "&lt;" and "&gt;" in the plugin.xml files. The functionality \
+has been replaced with range notation. For instance "[X-Y)" means all \
+versions greater or equals to X and less than Y. Open ranges such as "(X" or \
+"Y]" are also allowed.
 
 deprecatedSyntaxNoPlugin = \
-\The ">", ">=", "<", and "<=" notation in version expressions has been\
-\ deprecated. Note that the angle brackets are\
-\ represented via "&lt;" and "&gt;" in the plugin.xml files. The functionality\
-\ has been replaced with range notation. For instance "[X-Y)" means all\
-\ versions greater or equals to X and less than Y. Open ranges such as "(X" or\
-\ "Y]" are also allowed.
+The ">", ">=", "<", and "<=" notation in version expressions has been \
+deprecated. Note that the angle brackets are \
+represented via "&lt;" and "&gt;" in the plugin.xml files. The functionality \
+has been replaced with range notation. For instance "[X-Y)" means all \
+versions greater or equals to X and less than Y. Open ranges such as "(X" or \
+"Y]" are also allowed.
 
 versionOrNewer = {0} or newer
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.project.facet.core/whatsnew.txt b/plugins/org.eclipse.wst.common.project.facet.core/whatsnew.txt
new file mode 100644
index 0000000..0fe415f
--- /dev/null
+++ b/plugins/org.eclipse.wst.common.project.facet.core/whatsnew.txt
@@ -0,0 +1,59 @@
+New API:
+
+org.eclipse.wst.common.project.facet.core:
+
+1. IActionDefinition
+2. IProjectFacetVersion.getActionDefinition( Action.Type type )
+3. ProjectFacetsManager.getActionDefinitions()
+4. ProjectFacetsManager.isActionDefined( final String id )
+5. ProjectFacetsManager.getActionDefinition( final String id )
+
+org.eclipse.wst.common.project.facet.ui:
+
+1. ProjectFacetsUiManager.getWizardPages( String actionId )
+
+Deprecated API:
+
+The following describes API that was deprecated in this release as well as the
+replacement API to use going forward. All of the API deprecated in the 1.5
+release is still fully supported in this release, but it will be removed in the
+next major release of WTP.
+
+1. The extension point schema for defining wizard pages associated with the
+   project facet actions has been revised to be more flexible.
+   
+   Deprecated extension point:
+   
+   <extension point="org.eclipse.wst.common.project.facet.ui.wizard">
+     <wizard-pages facet="...">
+       <install> (0 or 1)
+        <page class="..."/> (1 or more)
+       </install>
+       <uninstall> (0 or 1)
+        <page class="..."/> (1 or more)
+       </uninstall>
+     </wizard-pages>
+   </extension>
+   
+   New extension point:
+   
+   <extension point="org.eclipse.wst.common.project.facet.ui.wizardPages">
+     <wizard-pages action="..."> (1 or more)
+       <page class="..."/> (1 or more)
+     </wizard-pages>
+   </extension>
+   
+   Note the new extension point id. The "action" attribute should contain the
+   action that these pages are to be associated with. The action id can
+   be explicitly specified via the new "id" attribute available on the "action"
+   element of the core facets extension point. If not specified, the default id
+   is generated using the "[facet-id]#[version-expression]#[action-type]" 
+   pattern.
+   
+   Also, the following method has been deprecated and replaced:
+   
+   org.eclipse.wst.common.project.facet.ui.ProjectFacetsUiManager:
+   
+     deprecated: getWizardPages( Action.Type type, IProjectFacetVersion fv )
+     new: getWizardPages( String actionId )
+   
diff --git a/plugins/org.eclipse.wst.common.project.facet.ui/images/facets-page-wizban.png b/plugins/org.eclipse.wst.common.project.facet.ui/images/facets-page-wizban.png
new file mode 100644
index 0000000..b91c116
--- /dev/null
+++ b/plugins/org.eclipse.wst.common.project.facet.ui/images/facets-page-wizban.png
Binary files differ
diff --git a/plugins/org.eclipse.wst.common.project.facet.ui/plugin.xml b/plugins/org.eclipse.wst.common.project.facet.ui/plugin.xml
index f6700dd..8b3b755 100644
--- a/plugins/org.eclipse.wst.common.project.facet.ui/plugin.xml
+++ b/plugins/org.eclipse.wst.common.project.facet.ui/plugin.xml
@@ -5,6 +5,11 @@
 
   <extension-point 
     id="wizard"
+    name="Project Facet Wizard Pages Extension Point (Deprecated)"
+    schema="schemas/wizard-pages-old.exsd"/>
+
+  <extension-point 
+    id="wizardPages"
     name="Project Facet Wizard Pages Extension Point"
     schema="schemas/wizard-pages.exsd"/>
 
diff --git a/plugins/org.eclipse.wst.common.project.facet.ui/schemas/wizard-pages-old.exsd b/plugins/org.eclipse.wst.common.project.facet.ui/schemas/wizard-pages-old.exsd
new file mode 100644
index 0000000..7b1aacb
--- /dev/null
+++ b/plugins/org.eclipse.wst.common.project.facet.ui/schemas/wizard-pages-old.exsd
@@ -0,0 +1,185 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.wst.common.project.facet.ui">
+<annotation>
+      <appInfo>
+         <meta.schema plugin="org.eclipse.wst.common.project.facet.ui" id="wizard" name="Project Facet Wizard Pages Extension Point"/>
+      </appInfo>
+      <documentation>
+         
+      </documentation>
+   </annotation>
+
+   <element name="extension">
+      <annotation>
+         <appInfo>
+            <meta.element deprecated="true"/>
+         </appInfo>
+      </annotation>
+      <complexType>
+         <sequence>
+            <element ref="wizard-pages" minOccurs="1" maxOccurs="unbounded"/>
+         </sequence>
+         <attribute name="point" type="string" use="required">
+            <annotation>
+               <documentation>
+                  a fully qualified identifier of the target extension point
+               </documentation>
+               <appInfo>
+                  <meta.attribute deprecated="true"/>
+               </appInfo>
+            </annotation>
+         </attribute>
+         <attribute name="id" type="string">
+            <annotation>
+               <documentation>
+                  an optional identifier of the extension instance
+               </documentation>
+               <appInfo>
+                  <meta.attribute deprecated="true"/>
+               </appInfo>
+            </annotation>
+         </attribute>
+         <attribute name="name" type="string">
+            <annotation>
+               <documentation>
+                  an optional name of the extension instance
+               </documentation>
+               <appInfo>
+                  <meta.attribute translatable="true" deprecated="true"/>
+               </appInfo>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <element name="wizard-pages">
+      <annotation>
+         <appInfo>
+            <meta.element deprecated="true"/>
+         </appInfo>
+      </annotation>
+      <complexType>
+         <sequence>
+            <element ref="install" minOccurs="0" maxOccurs="1"/>
+            <element ref="uninstall" minOccurs="0" maxOccurs="1"/>
+         </sequence>
+         <attribute name="facet" type="string" use="required">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+               <appInfo>
+                  <meta.attribute deprecated="true"/>
+               </appInfo>
+            </annotation>
+         </attribute>
+         <attribute name="version" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+               <appInfo>
+                  <meta.attribute deprecated="true"/>
+               </appInfo>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <element name="install">
+      <annotation>
+         <appInfo>
+            <meta.element deprecated="true"/>
+         </appInfo>
+      </annotation>
+      <complexType>
+         <sequence>
+            <element ref="page" minOccurs="1" maxOccurs="unbounded"/>
+         </sequence>
+      </complexType>
+   </element>
+
+   <element name="uninstall">
+      <annotation>
+         <appInfo>
+            <meta.element deprecated="true"/>
+         </appInfo>
+      </annotation>
+      <complexType>
+         <sequence>
+            <element ref="page" minOccurs="1" maxOccurs="unbounded"/>
+         </sequence>
+      </complexType>
+   </element>
+
+   <element name="page">
+      <annotation>
+         <appInfo>
+            <meta.element deprecated="true"/>
+         </appInfo>
+      </annotation>
+      <complexType>
+         <attribute name="class" type="string" use="required">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+               <appInfo>
+                  <meta.attribute kind="java" basedOn="org.eclipse.wst.common.project.facet.ui.IFacetWizardPage"/>
+               </appInfo>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="since"/>
+      </appInfo>
+      <documentation>
+         &lt;b&gt;This extension point is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.&lt;/b&gt;
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="examples"/>
+      </appInfo>
+      <documentation>
+         
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="apiInfo"/>
+      </appInfo>
+      <documentation>
+         
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="implementation"/>
+      </appInfo>
+      <documentation>
+         
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="copyright"/>
+      </appInfo>
+      <documentation>
+         Copyright (c) 2005 BEA Systems, Inc. and others.&lt;br&gt;
+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 &lt;a
+href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
+      </documentation>
+   </annotation>
+
+</schema>
diff --git a/plugins/org.eclipse.wst.common.project.facet.ui/schemas/wizard-pages.exsd b/plugins/org.eclipse.wst.common.project.facet.ui/schemas/wizard-pages.exsd
index d329456..18cb0ba 100644
--- a/plugins/org.eclipse.wst.common.project.facet.ui/schemas/wizard-pages.exsd
+++ b/plugins/org.eclipse.wst.common.project.facet.ui/schemas/wizard-pages.exsd
@@ -13,8 +13,7 @@
    <element name="extension">
       <complexType>
          <sequence>
-            <element ref="wizard-pages" minOccurs="0" maxOccurs="unbounded"/>
-            <element ref="decorations" minOccurs="0" maxOccurs="unbounded"/>
+            <element ref="wizard-pages" minOccurs="1" maxOccurs="unbounded"/>
          </sequence>
          <attribute name="point" type="string" use="required">
             <annotation>
@@ -46,41 +45,15 @@
    <element name="wizard-pages">
       <complexType>
          <sequence>
-            <element ref="install" minOccurs="0" maxOccurs="1"/>
-            <element ref="uninstall" minOccurs="0" maxOccurs="1"/>
+            <element ref="page" minOccurs="1" maxOccurs="unbounded"/>
          </sequence>
-         <attribute name="facet" type="string" use="required">
+         <attribute name="action" type="string" use="required">
             <annotation>
                <documentation>
-                  
+                  The action id. If the action does not specify an explicit id, the default id is created using the following format: &quot;[facet-id]#[version-expression]#[action-type]&quot;.
                </documentation>
             </annotation>
          </attribute>
-         <attribute name="version" type="string" use="required">
-            <annotation>
-               <documentation>
-                  
-               </documentation>
-            </annotation>
-         </attribute>
-      </complexType>
-   </element>
-
-   <element name="install">
-      <complexType>
-         <sequence>
-            <element ref="config"/>
-            <element ref="page" minOccurs="1" maxOccurs="unbounded"/>
-         </sequence>
-      </complexType>
-   </element>
-
-   <element name="uninstall">
-      <complexType>
-         <sequence>
-            <element ref="config"/>
-            <element ref="page" minOccurs="1" maxOccurs="unbounded"/>
-         </sequence>
       </complexType>
    </element>
 
@@ -91,6 +64,9 @@
                <documentation>
                   
                </documentation>
+               <appInfo>
+                  <meta.attribute kind="java" basedOn="org.eclipse.wst.common.project.facet.ui.IFacetWizardPage"/>
+               </appInfo>
             </annotation>
          </attribute>
       </complexType>
diff --git a/plugins/org.eclipse.wst.common.project.facet.ui/src/org/eclipse/wst/common/project/facet/ui/AddRemoveFacetsWizard.java b/plugins/org.eclipse.wst.common.project.facet.ui/src/org/eclipse/wst/common/project/facet/ui/AddRemoveFacetsWizard.java
index d13c79e..9ea28b9 100644
--- a/plugins/org.eclipse.wst.common.project.facet.ui/src/org/eclipse/wst/common/project/facet/ui/AddRemoveFacetsWizard.java
+++ b/plugins/org.eclipse.wst.common.project.facet.ui/src/org/eclipse/wst/common/project/facet/ui/AddRemoveFacetsWizard.java
@@ -33,6 +33,7 @@
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Listener;
+import org.eclipse.wst.common.project.facet.core.IActionDefinition;
 import org.eclipse.wst.common.project.facet.core.IFacetedProject;
 import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
 import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
@@ -416,13 +417,25 @@
         for( Iterator itr1 = sortedActions.iterator(); itr1.hasNext(); )
         {
             final Action action = (Action) itr1.next();
-            final IProjectFacetVersion f = action.getProjectFacetVersion();
+            final IProjectFacetVersion fv = action.getProjectFacetVersion();
             FacetPages fp = findFacetPages( action, markers );
             
             if( fp == null )
             {
+                final IActionDefinition actiondef;
+                
+                try
+                {
+                    actiondef = fv.getActionDefinition( action.getType() );
+                }
+                catch( CoreException e )
+                {
+                    FacetUiPlugin.log( e );
+                    continue;
+                }
+                
                 final List pages
-                    = ProjectFacetsUiManager.getWizardPages( action.getType(), f );
+                    = ProjectFacetsUiManager.getWizardPages( actiondef.getId() );
                 
                 if( ! pages.isEmpty() )
                 {
@@ -484,7 +497,7 @@
     }
     
     private FacetPages findFacetPages( final Action action,
-                                           final boolean[] markers )
+                                       final boolean[] markers )
     {
         for( int i = 0; i < this.facetPages.length; i++ )
         {
diff --git a/plugins/org.eclipse.wst.common.project.facet.ui/src/org/eclipse/wst/common/project/facet/ui/FacetUiHelpContextIds.java b/plugins/org.eclipse.wst.common.project.facet.ui/src/org/eclipse/wst/common/project/facet/ui/FacetUiHelpContextIds.java
new file mode 100644
index 0000000..358f769
--- /dev/null
+++ b/plugins/org.eclipse.wst.common.project.facet.ui/src/org/eclipse/wst/common/project/facet/ui/FacetUiHelpContextIds.java
@@ -0,0 +1,40 @@
+/******************************************************************************
+ * Copyright (c) 2006 BEA Systems, Inc.
+ * 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
+ *
+ * Contributors:
+ *    Konstantin Komissarchik - initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.wst.common.project.facet.ui;
+
+import org.eclipse.wst.common.project.facet.ui.internal.FacetUiPlugin;
+
+/**
+ * Contains the help context ids defined in the facet UI plugin.
+ * 
+ * <p><i>This class is part of an interim API that is still under development 
+ * and expected to change significantly before reaching stability. It is being 
+ * made available at this early stage to solicit feedback from pioneering 
+ * adopters on the understanding that any code that uses this API will almost 
+ * certainly be broken (repeatedly) as the API evolves.</i></p>
+ * 
+ * @author <a href="mailto:kosta@bea.com">Konstantin Komissarchik</a>
+ */
+
+public final class FacetUiHelpContextIds
+{
+    /**
+     * The help context id for the overall facets selection page:  
+     * "org.eclipse.wst.common.project.facet.ui.facetsSelectionPage".
+     */
+    
+    public static final String FACETS_SELECTION_PAGE
+        = FacetUiPlugin.PLUGIN_ID + ".facetsSelectionPage"; //$NON-NLS-1$
+    
+    private FacetUiHelpContextIds() {}
+    
+}
diff --git a/plugins/org.eclipse.wst.common.project.facet.ui/src/org/eclipse/wst/common/project/facet/ui/ProjectFacetsUiManager.java b/plugins/org.eclipse.wst.common.project.facet.ui/src/org/eclipse/wst/common/project/facet/ui/ProjectFacetsUiManager.java
index 3d33143..7d89841 100644
--- a/plugins/org.eclipse.wst.common.project.facet.ui/src/org/eclipse/wst/common/project/facet/ui/ProjectFacetsUiManager.java
+++ b/plugins/org.eclipse.wst.common.project.facet.ui/src/org/eclipse/wst/common/project/facet/ui/ProjectFacetsUiManager.java
@@ -35,6 +35,16 @@
      * @return (element type: {@see IFacetWizardPage})
      */
     
+    public static List getWizardPages( final String actionId )
+    {
+        return ProjectFacetsUiManagerImpl.getWizardPages( actionId );
+    }
+
+    /**
+     * @return (element type: {@see IFacetWizardPage})
+     * @deprecated
+     */
+    
     public static List getWizardPages( final Action.Type actionType,
                                        final IProjectFacetVersion f )
     {
diff --git a/plugins/org.eclipse.wst.common.project.facet.ui/src/org/eclipse/wst/common/project/facet/ui/internal/FacetUiPlugin.java b/plugins/org.eclipse.wst.common.project.facet.ui/src/org/eclipse/wst/common/project/facet/ui/internal/FacetUiPlugin.java
index 7e6c575..bc2957d 100644
--- a/plugins/org.eclipse.wst.common.project.facet.ui/src/org/eclipse/wst/common/project/facet/ui/internal/FacetUiPlugin.java
+++ b/plugins/org.eclipse.wst.common.project.facet.ui/src/org/eclipse/wst/common/project/facet/ui/internal/FacetUiPlugin.java
@@ -11,8 +11,12 @@
 
 package org.eclipse.wst.common.project.facet.ui.internal;
 
+import java.util.HashSet;
+import java.util.Set;
+
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
 
 /**
@@ -28,6 +32,7 @@
         = "org.eclipse.wst.common.project.facet.ui"; //$NON-NLS-1$
     
     private static FacetUiPlugin plugin;
+    private static final Set messagesLogged = new HashSet();
     
     public FacetUiPlugin() 
     {
@@ -40,6 +45,11 @@
         return plugin;
     }
     
+    public static ImageDescriptor getImageDescriptor( final String path )
+    {
+        return imageDescriptorFromPlugin( PLUGIN_ID, path );
+    }
+    
     public static void log( final Exception e )
     {
         final String msg = e.getMessage();
@@ -56,6 +66,42 @@
         log( new Status( IStatus.ERROR, PLUGIN_ID, IStatus.OK, msg, null ) );
     }
     
+    public static void logError( final String msg )
+    {
+        logError( msg, false );
+    }
+    
+    public static void logError( final String msg,
+                                 final boolean suppressDuplicates )
+    {
+        if( suppressDuplicates && messagesLogged.contains( msg ) )
+        {
+            return;
+        }
+        
+        messagesLogged.add( msg );
+        
+        log( new Status( IStatus.ERROR, PLUGIN_ID, IStatus.OK, msg, null ) );
+    }
+
+    public static void logWarning( final String msg )
+    {
+        logWarning( msg, false );
+    }
+    
+    public static void logWarning( final String msg,
+                                   final boolean suppressDuplicates )
+    {
+        if( suppressDuplicates && messagesLogged.contains( msg ) )
+        {
+            return;
+        }
+        
+        messagesLogged.add( msg );
+        
+        log( new Status( IStatus.WARNING, PLUGIN_ID, IStatus.OK, msg, null ) );
+    }
+    
     public static IStatus createErrorStatus( final String msg,
                                              final Exception e )
     {
diff --git a/plugins/org.eclipse.wst.common.project.facet.ui/src/org/eclipse/wst/common/project/facet/ui/internal/FacetsSelectionPage.java b/plugins/org.eclipse.wst.common.project.facet.ui/src/org/eclipse/wst/common/project/facet/ui/internal/FacetsSelectionPage.java
index 5c0f5f0..be86d48 100644
--- a/plugins/org.eclipse.wst.common.project.facet.ui/src/org/eclipse/wst/common/project/facet/ui/internal/FacetsSelectionPage.java
+++ b/plugins/org.eclipse.wst.common.project.facet.ui/src/org/eclipse/wst/common/project/facet/ui/internal/FacetsSelectionPage.java
@@ -27,6 +27,8 @@
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Listener;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.help.IWorkbenchHelpSystem;
 import org.eclipse.wst.common.project.facet.core.IActionConfig;
 import org.eclipse.wst.common.project.facet.core.ICategory;
 import org.eclipse.wst.common.project.facet.core.IPreset;
@@ -34,6 +36,7 @@
 import org.eclipse.wst.common.project.facet.core.IFacetedProject.Action;
 import org.eclipse.wst.common.project.facet.core.runtime.IRuntime;
 import org.eclipse.wst.common.project.facet.ui.AddRemoveFacetsWizard;
+import org.eclipse.wst.common.project.facet.ui.FacetUiHelpContextIds;
 import org.eclipse.wst.common.project.facet.ui.IWizardContext;
 
 /**
@@ -45,6 +48,9 @@
     extends WizardPage
 
 {
+    private static final String IMG_PATH_WIZBAN
+        = "images/facets-page-wizban.png"; //$NON-NLS-1$
+    
     private IWizardContext context;
     private Set base;
     private IPreset initialPreset;
@@ -61,6 +67,7 @@
 
         setTitle( Resources.pageTitle );
         setDescription( Resources.pageDescription );
+        setImageDescriptor( FacetUiPlugin.getImageDescriptor( IMG_PATH_WIZBAN ) );
 
         this.context = context;
         this.base = base;
@@ -180,6 +187,9 @@
             }
         );
         
+        final IWorkbenchHelpSystem h = PlatformUI.getWorkbench().getHelpSystem();
+        h.setHelp( this.panel, FacetUiHelpContextIds.FACETS_SELECTION_PAGE );
+        
         setControl( this.panel );
     }
 
diff --git a/plugins/org.eclipse.wst.common.project.facet.ui/src/org/eclipse/wst/common/project/facet/ui/internal/ProjectFacetsUiManagerImpl.java b/plugins/org.eclipse.wst.common.project.facet.ui/src/org/eclipse/wst/common/project/facet/ui/internal/ProjectFacetsUiManagerImpl.java
index 1a94fbb..2102e50 100644
--- a/plugins/org.eclipse.wst.common.project.facet.ui/src/org/eclipse/wst/common/project/facet/ui/internal/ProjectFacetsUiManagerImpl.java
+++ b/plugins/org.eclipse.wst.common.project.facet.ui/src/org/eclipse/wst/common/project/facet/ui/internal/ProjectFacetsUiManagerImpl.java
@@ -27,6 +27,7 @@
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.osgi.util.NLS;
+import org.eclipse.wst.common.project.facet.core.IActionDefinition;
 import org.eclipse.wst.common.project.facet.core.IProjectFacet;
 import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
 import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
@@ -40,7 +41,8 @@
 
 public final class ProjectFacetsUiManagerImpl 
 {
-    private static final String EXTENSION_ID = "wizard"; //$NON-NLS-1$
+    private static final String WIZARD_PAGES_EXTENSION_ID = "wizardPages"; //$NON-NLS-1$
+    private static final String WIZARD_PAGES_EXTENSION_ID_OLD = "wizard"; //$NON-NLS-1$
     private static final String IMAGES_EXTENSION_ID = "images"; //$NON-NLS-1$
     
     private static final String EL_WIZARD_PAGES = "wizard-pages"; //$NON-NLS-1$
@@ -52,8 +54,9 @@
     private static final String ATTR_CLASS = "class"; //$NON-NLS-1$
     private static final String ATTR_VERSION = "version"; //$NON-NLS-1$
     private static final String ATTR_FACET = "facet"; //$NON-NLS-1$
+    private static final String ATTR_ACTION = "action"; //$NON-NLS-1$
 
-    private static final HashMap metadata;
+    private static final HashMap wizardPages;
     
     /**
      * Maps either IProjectFacet or IRuntimeComponentType to an ImageDescriptor.
@@ -69,13 +72,14 @@
         ProjectFacetsManager.getProjectFacets();
         RuntimeManager.getRuntimeComponentTypes();
         
-        metadata = new HashMap();
+        wizardPages = new HashMap();
         
         final Bundle bundle = Platform.getBundle( FacetUiPlugin.PLUGIN_ID );
         final URL url = bundle.getEntry( "images/unknown.gif" ); //$NON-NLS-1$
         defaultIcon = ImageDescriptor.createFromURL( url );
         
-        readExtensions();
+        readWizardPagesExtensions();
+        readWizardPagesExtensionsOld();
         readImagesExtensions();
     }
     
@@ -91,24 +95,42 @@
      * @return (element type: {@see IFacetWizardPage})
      */
     
-    public static List getWizardPages( final Action.Type actionType,
-                                       final IProjectFacetVersion f )
+    public static List getWizardPages( final String actionId )
     {
-        final WizardPagesInfo info = (WizardPagesInfo) metadata.get( f );
+        final WizardPagesInfo info = (WizardPagesInfo) wizardPages.get( actionId );
         
         if( info != null )
         {
-            final List clnames = (List) info.pagesets.get( actionType );
-            
-            if( clnames != null )
-            {
-                return getWizardPages( info.plugin, clnames );
-            }
+            return getWizardPages( info.plugin, info.pages );
         }
         
         return Collections.EMPTY_LIST;
     }
 
+    /**
+     * @return (element type: {@see IFacetWizardPage})
+     * @deprecated
+     */
+    
+    public static List getWizardPages( final Action.Type actionType,
+                                       final IProjectFacetVersion fv )
+    {
+        if( fv.supports( actionType ) )
+        {
+            try
+            {
+                final IActionDefinition def = fv.getActionDefinition( actionType );
+                return getWizardPages( def.getId() );
+            }
+            catch( CoreException e )
+            {
+                FacetUiPlugin.log( e );
+            }
+        }
+
+        return Collections.EMPTY_LIST;
+    }
+
     private static List getWizardPages( final String plugin,
                                         final List clnames )
     {
@@ -153,13 +175,13 @@
         }
     }
     
-    private static void readExtensions()
+    private static void readWizardPagesExtensions()
     {
         final IExtensionRegistry registry = Platform.getExtensionRegistry();
         
         final IExtensionPoint point 
             = registry.getExtensionPoint( FacetUiPlugin.PLUGIN_ID, 
-                                          EXTENSION_ID );
+                                          WIZARD_PAGES_EXTENSION_ID );
         
         if( point == null )
         {
@@ -180,14 +202,80 @@
                 
                 if( ename.equals( EL_WIZARD_PAGES ) )
                 {
-                    readWizardPagesInfo( config );
+                    final String action = config.getAttribute( ATTR_ACTION );
+
+                    if( action == null )
+                    {
+                        reportMissingAttribute( config, ATTR_ACTION );
+                        return;
+                    }
+                    
+                    final String pluginId = config.getContributor().getName();
+                    
+                    if( ProjectFacetsManager.isActionDefined( action ) )
+                    {
+                        final WizardPagesInfo pagesInfo = new WizardPagesInfo();
+                        
+                        pagesInfo.plugin = pluginId;
+                        pagesInfo.pages = readPageList( config );
+                        
+                        wizardPages.put( action, pagesInfo );
+                    }
+                    else
+                    {
+                        final String msg
+                            = NLS.bind( Resources.actionNotDefined, pluginId,
+                                        action );
+                        
+                        FacetUiPlugin.logError( msg );
+                    }
                 }
             }
         }
     }
     
-    private static void readWizardPagesInfo( final IConfigurationElement config )
+    private static void readWizardPagesExtensionsOld()
     {
+        final IExtensionRegistry registry = Platform.getExtensionRegistry();
+        
+        final IExtensionPoint point 
+            = registry.getExtensionPoint( FacetUiPlugin.PLUGIN_ID, 
+                                          WIZARD_PAGES_EXTENSION_ID_OLD );
+        
+        if( point == null )
+        {
+            throw new RuntimeException( "Extension point not found!" ); //$NON-NLS-1$
+        }
+        
+        final IExtension[] extensions = point.getExtensions();
+        
+        for( int i = 0; i < extensions.length; i++ )
+        {
+            final IConfigurationElement[] elements 
+                = extensions[ i ].getConfigurationElements();
+            
+            for( int j = 0; j < elements.length; j++ )
+            {
+                final IConfigurationElement config = elements[ j ];
+                final String ename = config.getName();
+                
+                if( ename.equals( EL_WIZARD_PAGES ) )
+                {
+                    readWizardPagesOld( config );
+                }
+            }
+        }
+    }
+    
+    private static void readWizardPagesOld( final IConfigurationElement config )
+    {
+        final String pluginId = config.getContributor().getName();
+
+        final String depMsg 
+            = NLS.bind( Resources.wizardExtensionPointDeprecated, pluginId );
+        
+        FacetUiPlugin.logWarning( depMsg, true );
+        
         final String id = config.getAttribute( ATTR_FACET );
 
         if( id == null )
@@ -233,10 +321,6 @@
         }
         
         final IProjectFacetVersion fv = f.getVersion( version );
-        
-        final WizardPagesInfo info = new WizardPagesInfo();
-        info.plugin = config.getContributor().getName();
-        
         final IConfigurationElement[] children = config.getChildren();
         
         for( int i = 0; i < children.length; i++ )
@@ -256,10 +340,28 @@
                 return;
             }
             
-            info.pagesets.put( actionType, readPageList( child ) );
+            if( fv.supports( actionType ) )
+            {
+                final IActionDefinition def;
+                
+                try
+                {
+                    def = fv.getActionDefinition( actionType );
+                }
+                catch( CoreException e )
+                {
+                    FacetUiPlugin.log( e );
+                    return;
+                }
+                
+                final WizardPagesInfo pagesInfo = new WizardPagesInfo();
+                
+                pagesInfo.plugin = pluginId;
+                pagesInfo.pages = readPageList( child );
+                
+                wizardPages.put( def.getId(), pagesInfo );
+            }
         }
-        
-        metadata.put( fv, info );
     }
 
     private static List readPageList( final IConfigurationElement config )
@@ -423,9 +525,9 @@
     private static class WizardPagesInfo
     {
         public String plugin;
-        public HashMap pagesets = new HashMap();
+        public List pages;
     }
-    
+
     private static final class Resources
     
         extends NLS
@@ -439,6 +541,8 @@
         public static String failedToCreate;
         public static String invalidActionType;
         public static String iconNotFound;
+        public static String wizardExtensionPointDeprecated;
+        public static String actionNotDefined;
         
         static
         {
diff --git a/plugins/org.eclipse.wst.common.project.facet.ui/src/org/eclipse/wst/common/project/facet/ui/internal/ProjectFacetsUiManagerImpl.properties b/plugins/org.eclipse.wst.common.project.facet.ui/src/org/eclipse/wst/common/project/facet/ui/internal/ProjectFacetsUiManagerImpl.properties
index e2a8914..3186453 100644
--- a/plugins/org.eclipse.wst.common.project.facet.ui/src/org/eclipse/wst/common/project/facet/ui/internal/ProjectFacetsUiManagerImpl.properties
+++ b/plugins/org.eclipse.wst.common.project.facet.ui/src/org/eclipse/wst/common/project/facet/ui/internal/ProjectFacetsUiManagerImpl.properties
@@ -5,4 +5,12 @@
 runtimeComponentTypeNotDefined = Runtime component type {1} has not been defined. It is used in plugin {0}.
 failedToCreate = Failed to instantiate class {0}.
 invalidActionType = "{1}" is an invalid action type. It is used in plugin {0}.
-iconNotFound = Could not load icon "{1}" from plugin {0}.
\ No newline at end of file
+iconNotFound = Could not load icon "{1}" from plugin {0}.
+
+wizardExtensionPointDeprecated = \
+Extension point org.eclipse.wst.common.project.facet.ui.wizard is deprecated. \
+It is used in plugin {0}. \
+Extension point org.eclipse.wst.common.project.facet.ui.wizardPages provides \
+analogous functionality.
+
+actionNotDefined = Project facet action "{1}" has not been defined. It is used in plugin {0}.
\ No newline at end of file