You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ar...@apache.org on 2009/12/02 19:45:15 UTC

svn commit: r886252 - in /myfaces/trinidad-maven/branches/2.0.0-branch/maven-faces-plugin/src/main: java/org/apache/myfaces/trinidadbuild/plugin/faces/ java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/component/ java/org/apache/myfaces/trin...

Author: arobinson74
Date: Wed Dec  2 18:45:08 2009
New Revision: 886252

URL: http://svn.apache.org/viewvc?rev=886252&view=rev
Log:
Trinidad 2 client behavior holder support

Modified:
    myfaces/trinidad-maven/branches/2.0.0-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateComponentsMojo.java
    myfaces/trinidad-maven/branches/2.0.0-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/component/AbstractComponentGenerator.java
    myfaces/trinidad-maven/branches/2.0.0-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/component/ComponentGenerator.java
    myfaces/trinidad-maven/branches/2.0.0-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/component/TrinidadComponentGenerator.java
    myfaces/trinidad-maven/branches/2.0.0-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/ComponentBean.java
    myfaces/trinidad-maven/branches/2.0.0-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java
    myfaces/trinidad-maven/branches/2.0.0-branch/maven-faces-plugin/src/main/resources/META-INF/schemas/maven-faces-plugin.xsd

Modified: myfaces/trinidad-maven/branches/2.0.0-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateComponentsMojo.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad-maven/branches/2.0.0-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateComponentsMojo.java?rev=886252&r1=886251&r2=886252&view=diff
==============================================================================
--- myfaces/trinidad-maven/branches/2.0.0-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateComponentsMojo.java (original)
+++ myfaces/trinidad-maven/branches/2.0.0-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateComponentsMojo.java Wed Dec  2 18:45:08 2009
@@ -6,9 +6,9 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -18,6 +18,15 @@
  */
 package org.apache.myfaces.trinidadbuild.plugin.faces;
 
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.StringWriter;
+
+import java.lang.reflect.Modifier;
+
+import java.util.Iterator;
+
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.project.MavenProject;
 import org.apache.myfaces.trinidadbuild.plugin.faces.generator.component.ComponentGenerator;
@@ -31,12 +40,6 @@
 import org.apache.myfaces.trinidadbuild.plugin.faces.util.SourceTemplate;
 import org.apache.myfaces.trinidadbuild.plugin.faces.util.Util;
 
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.StringWriter;
-import java.lang.reflect.Modifier;
-import java.util.Iterator;
 
 /**
  * @version $Id$
@@ -122,12 +125,12 @@
     // TODO: This must be changed in the future...
     JsfVersion version = JsfVersion.getVersion(jsfVersion);
     boolean isVersionGreaterThan11 = version != JsfVersion.JSF_1_1;
-    
+
     if (component.isTrinidadComponent())
     {
       generator = new TrinidadComponentGenerator(getLog(), isVersionGreaterThan11);
     }
-    else 
+    else
     {
       generator = new MyFacesComponentGenerator(getLog(), isVersionGreaterThan11);
     }
@@ -206,6 +209,10 @@
         generator.writePropertyConstants(out, superclassName, component);
         generator.writeFacetConstants(out, component);
         generator.writeGenericConstants(out, componentFamily, componentType);
+        if (component.isClientBehaviorHolder())
+        {
+          generator.writeClientBehaviorConstants(out, component);
+        }
 
         // public constructors and methods
         generator.writeConstructor(out, component, Modifier.PUBLIC);
@@ -227,10 +234,13 @@
         {
           generator.writePropertyMethods(out, component, template.getIgnoreMethods());
         }
-        
+
         if (!suppressListenerMethods)
           generator.writeListenerMethods(out, component);
 
+        if (component.isClientBehaviorHolder())
+          generator.writeClientBehaviorMethods(out, component);
+
         generator.writeStateManagementMethods(out, component);
 
         generator.writeGetFamily(out);

Modified: myfaces/trinidad-maven/branches/2.0.0-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/component/AbstractComponentGenerator.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad-maven/branches/2.0.0-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/component/AbstractComponentGenerator.java?rev=886252&r1=886251&r2=886252&view=diff
==============================================================================
--- myfaces/trinidad-maven/branches/2.0.0-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/component/AbstractComponentGenerator.java (original)
+++ myfaces/trinidad-maven/branches/2.0.0-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/component/AbstractComponentGenerator.java Wed Dec  2 18:45:08 2009
@@ -6,9 +6,9 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -18,20 +18,35 @@
  */
 package org.apache.myfaces.trinidadbuild.plugin.faces.generator.component;
 
+import java.io.IOException;
+
+import java.lang.reflect.Modifier;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
 import org.apache.maven.plugin.logging.Log;
 import org.apache.myfaces.trinidadbuild.plugin.faces.generator.GeneratorHelper;
 import org.apache.myfaces.trinidadbuild.plugin.faces.io.PrettyWriter;
-import org.apache.myfaces.trinidadbuild.plugin.faces.parse.*;
+import org.apache.myfaces.trinidadbuild.plugin.faces.parse.ComponentBean;
+import org.apache.myfaces.trinidadbuild.plugin.faces.parse.EventBean;
+import org.apache.myfaces.trinidadbuild.plugin.faces.parse.EventRefBean;
+import org.apache.myfaces.trinidadbuild.plugin.faces.parse.FacetBean;
+import org.apache.myfaces.trinidadbuild.plugin.faces.parse.PropertyBean;
 import org.apache.myfaces.trinidadbuild.plugin.faces.util.FilteredIterator;
 import org.apache.myfaces.trinidadbuild.plugin.faces.util.PropertyFilter;
 import org.apache.myfaces.trinidadbuild.plugin.faces.util.SourceTemplate;
 import org.apache.myfaces.trinidadbuild.plugin.faces.util.Util;
 
-import java.io.IOException;
-import java.lang.reflect.Modifier;
-import java.util.*;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
 
 public abstract class AbstractComponentGenerator implements ComponentGenerator
 {
@@ -138,6 +153,9 @@
     if (component.isNamingContainer())
       interfaces.add("javax.faces.component.NamingContainer");
 
+    if (component.isClientBehaviorHolder())
+      interfaces.add("javax.faces.component.behavior.ClientBehaviorHolder");
+
     Iterator events = component.events();
     while (events.hasNext())
     {
@@ -219,6 +237,17 @@
     if (component.isNamingContainer())
       imports.add("javax.faces.component.NamingContainer");
 
+    // Detect ClientBehaviorHolder
+    if (component.isClientBehaviorHolder())
+    {
+      imports.add("java.util.Arrays");
+      imports.add("java.util.Collection");
+      imports.add("java.util.List");
+      imports.add("java.util.Map");
+      imports.add("javax.faces.component.behavior.ClientBehavior");
+      imports.add("javax.faces.component.behavior.ClientBehaviorHolder");
+    }
+
     Iterator properties = component.properties();
     properties = new FilteredIterator(properties, new NonVirtualFilter());
     // PropertyKey only needed if there are properties
@@ -436,7 +465,6 @@
     }
   }
 
-
   protected String convertVariableToBoxedForm(
     String  className,
     String  varName)
@@ -577,7 +605,6 @@
     writePropertyMethods(out, component, null);
   }
 
-
   public void writePropertyMethods(PrettyWriter out, ComponentBean component, Collection ignoreList)
       throws IOException
   {
@@ -668,20 +695,20 @@
     {
       out.println(" * @deprecated");
     }
-    
+
     if (property.getDeprecated() != null)
     {
       out.print(" * @deprecated ");
-      out.println(convertMultilineComment(property.getDeprecated()));      
+      out.println(convertMultilineComment(property.getDeprecated()));
     }
-    
+
     out.println(" */");
 
     if (property.getDeprecated() != null)
     {
       out.println("@Deprecated");
     }
- 
+
     if (isAccessorMethodFinal())
     {
       out.print("final ");
@@ -741,20 +768,20 @@
     {
       out.println(" * @deprecated");
     }
-    
+
     if (property.getDeprecated() != null)
     {
       out.print(" * @deprecated ");
       out.println(convertMultilineComment(property.getDeprecated()));
     }
-    
+
     out.println(" */");
 
     if (property.getDeprecated() != null)
     {
       out.println("@Deprecated");
     }
-  
+
     if (isUnchecked)
     {
       out.println("@SuppressWarnings(\"unchecked\")");
@@ -987,10 +1014,102 @@
     out.println("}");
   }
 
-
   public abstract void writeStateManagementMethods(PrettyWriter out,
                                                    ComponentBean component) throws IOException;
 
+  @Override
+  public void writeClientBehaviorMethods(
+    PrettyWriter  out,
+    ComponentBean component
+    ) throws IOException
+  {
+    String defaultEventName = component.getDefaultEventName();
+    if (defaultEventName != null)
+    {
+      out.println();
+      out.println("@Override");
+      out.println("public String getDefaultEventName()");
+      out.println("{");
+      out.indent();
+      out.print("return \"");
+      out.print(defaultEventName);
+      out.println("\";");
+      out.unindent();
+      out.println("}");
+    }
+
+    out.println();
+    out.println("@Override"); // JDK 1.6 is a requirement for JSF2 so this is okay
+    out.println("public Collection<String> getEventNames()");
+    out.println("{");
+    out.indent();
+    out.println("return _EVENT_NAMES;");
+    out.unindent();
+    out.println("}");
+
+    out.println();
+    out.println("@Override");
+    out.println("public Map<String, List<ClientBehavior>> getClientBehaviors()");
+    out.println("{");
+    out.indent();
+    out.println("return super.getClientBehaviors();");
+    out.unindent();
+    out.println("}");
+
+    out.println();
+    out.println("@Override");
+    out.println("public void addClientBehavior(");
+    out.indent();
+    out.println("String         eventName,");
+    out.println("ClientBehavior behavior)");
+    out.unindent();
+    out.println("{");
+    out.indent();
+    out.println("super.addClientBehavior(eventName, behavior);");
+    out.unindent();
+    out.println("}");
+  }
+
+  @Override
+  public void writeClientBehaviorConstants(
+    PrettyWriter  out,
+    ComponentBean component
+    ) throws IOException
+  {
+    out.println("private final static Collection<String> _EVENT_NAMES = Arrays.asList(");
+    out.indent();
+    out.println("new String [] { ");
+    out.indent();
+    boolean first = true;
+    int wrapAt = 5;
+    for (String eventName : component.getEventNames())
+    {
+      if (first)
+      {
+        first = false;
+      }
+      else
+      {
+        if (--wrapAt < 0)
+        {
+          out.println(",");
+          wrapAt = 5;
+        }
+        else
+        {
+          out.print(", ");
+        }
+      }
+      out.print("\"");
+      out.print(eventName);
+      out.print("\"");
+    }
+    out.println();
+    out.unindent();
+    out.println(" });");
+    out.unindent();
+  }
+
   public void writeOther(
       PrettyWriter out, ComponentBean component) throws IOException
   {
@@ -1001,8 +1120,8 @@
       String commentBody)
   {
    StringBuilder buff = new StringBuilder(commentBody.replaceAll("\n", "\n * "));
-   
-   
+
+
    // escape markup within <pre> blocks.  The tag doc gen plugin escapes the ampersand
    // making it not possible to escape causing issue with javadoc.
    int s = 0;
@@ -1018,12 +1137,12 @@
        markup = markup.replaceAll(">", "&gt;");
        buff.delete(s, e);
        buff.insert(s, markup);
-       
+
        s = buff.indexOf("<pre>", s + markup.length() + "</pre>".length());
      }
    } while (s > 0);
-    
-   return buff.toString(); 
+
+   return buff.toString();
   }
 
   protected class ResolvableTypeFilter extends PropertyFilter
@@ -1052,7 +1171,6 @@
     return (String) _RESOLVABLE_TYPES.get(className);
   }
 
-
   static private Map _createResolvableTypes()
   {
     Map resolvableTypes = new HashMap();
@@ -1077,6 +1195,6 @@
 
   static private final Pattern _GENERIC_TYPE = Pattern.compile("([^<]+)<(.+)>");
   static final private Map _RESOLVABLE_TYPES = _createResolvableTypes();
-  
-  
+
+
 }

Modified: myfaces/trinidad-maven/branches/2.0.0-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/component/ComponentGenerator.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad-maven/branches/2.0.0-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/component/ComponentGenerator.java?rev=886252&r1=886251&r2=886252&view=diff
==============================================================================
--- myfaces/trinidad-maven/branches/2.0.0-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/component/ComponentGenerator.java (original)
+++ myfaces/trinidad-maven/branches/2.0.0-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/component/ComponentGenerator.java Wed Dec  2 18:45:08 2009
@@ -6,9 +6,9 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -18,12 +18,14 @@
  */
 package org.apache.myfaces.trinidadbuild.plugin.faces.generator.component;
 
+import java.io.IOException;
+
+import java.util.Collection;
+
 import org.apache.myfaces.trinidadbuild.plugin.faces.generator.ClassGenerator;
 import org.apache.myfaces.trinidadbuild.plugin.faces.io.PrettyWriter;
 import org.apache.myfaces.trinidadbuild.plugin.faces.parse.ComponentBean;
 
-import java.io.IOException;
-import java.util.Collection;
 
 /**
  * Generates component classes
@@ -33,7 +35,6 @@
  */
 public interface ComponentGenerator extends ClassGenerator
 {
-
   void writeGenericConstants(
       PrettyWriter out,
       String componentFamily,
@@ -67,6 +68,14 @@
       PrettyWriter out,
       ComponentBean component) throws IOException;
 
+  void writeClientBehaviorMethods(
+      PrettyWriter  out,
+      ComponentBean component) throws IOException;
+
+  void writeClientBehaviorConstants(
+      PrettyWriter  out,
+      ComponentBean component) throws IOException;
+
   void writeStateManagementMethods(
       PrettyWriter out,
       ComponentBean component) throws IOException;

Modified: myfaces/trinidad-maven/branches/2.0.0-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/component/TrinidadComponentGenerator.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad-maven/branches/2.0.0-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/component/TrinidadComponentGenerator.java?rev=886252&r1=886251&r2=886252&view=diff
==============================================================================
--- myfaces/trinidad-maven/branches/2.0.0-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/component/TrinidadComponentGenerator.java (original)
+++ myfaces/trinidad-maven/branches/2.0.0-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/generator/component/TrinidadComponentGenerator.java Wed Dec  2 18:45:08 2009
@@ -6,9 +6,9 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -18,6 +18,18 @@
  */
 package org.apache.myfaces.trinidadbuild.plugin.faces.generator.component;
 
+import java.io.IOException;
+
+import java.lang.reflect.Modifier;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
 import org.apache.maven.plugin.logging.Log;
 import org.apache.myfaces.trinidadbuild.plugin.faces.io.PrettyWriter;
 import org.apache.myfaces.trinidadbuild.plugin.faces.parse.ComponentBean;
@@ -26,9 +38,6 @@
 import org.apache.myfaces.trinidadbuild.plugin.faces.util.PropertyFilter;
 import org.apache.myfaces.trinidadbuild.plugin.faces.util.Util;
 
-import java.io.IOException;
-import java.lang.reflect.Modifier;
-import java.util.*;
 
 public class TrinidadComponentGenerator extends AbstractComponentGenerator
 {
@@ -63,7 +72,7 @@
         if (property.isNoOp())
         {
           imports.add("org.apache.myfaces.trinidad.logging.TrinidadLogger");
-        }  
+        }
       }
     }
   }
@@ -105,7 +114,7 @@
       {
         out.println("@Deprecated");
       }
-      
+
       out.println("static public final PropertyKey " + propKey + " =");
       out.indent();
       if (propAlias != null)
@@ -158,7 +167,6 @@
     // nothing by default
   }
 
-
   /**
    * Whether the getters/setters have the final modifier
    *
@@ -190,9 +198,9 @@
         out.println("setProperty(" + propKey + ", (" + propVar + "));");
       }
     }
-    else 
-    { 
-      out.println("TrinidadLogger log = TrinidadLogger.createTrinidadLogger(this.getClass());");  
+    else
+    {
+      out.println("TrinidadLogger log = TrinidadLogger.createTrinidadLogger(this.getClass());");
       out.print("log.warning(\"property \\\"" + propName + "\\\" is ");
       out.print("using a no-op implementation. Used in extreme cases when the property value, beyond the default value, results in unwanted behavior.");
       out.println("\");");
@@ -425,5 +433,12 @@
     }
     return sb.toString();
   }
-    
+
+  private final static Set<String> _CLIENT_EVENT_NAMES = new HashSet<String>(
+    Arrays.asList(
+      new String[] { "onclick", "ondblclick", "onmousedown", "onmouseup", "onmouseover",
+        "onmousemove", "onmouseout", "onkeypress", "onkeydown", "onkeyup", "onfocus",
+        "onblur", "onsubmit", "onchange", "onabort", "onerror", "onload", "onreset",
+        "onresize", "onselect", "onunload" }
+    ));
 }

Modified: myfaces/trinidad-maven/branches/2.0.0-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/ComponentBean.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad-maven/branches/2.0.0-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/ComponentBean.java?rev=886252&r1=886251&r2=886252&view=diff
==============================================================================
--- myfaces/trinidad-maven/branches/2.0.0-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/ComponentBean.java (original)
+++ myfaces/trinidad-maven/branches/2.0.0-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/ComponentBean.java Wed Dec  2 18:45:08 2009
@@ -295,6 +295,43 @@
     return _namingContainer;
   }
 
+  public boolean isClientBehaviorHolder()
+  {
+    return _eventNames != null && _eventNames.length > 0;
+  }
+
+  public void setDefaultEventName(String defaultEventName)
+  {
+    this._defaultEventName = defaultEventName;
+  }
+
+  public String getDefaultEventName()
+  {
+    return _defaultEventName;
+  }
+
+  public void setEventNames(String[] eventNames)
+  {
+    this._eventNames = eventNames;
+  }
+
+  public String[] getEventNames()
+  {
+    return _eventNames;
+  }
+
+  public void parseEventNames(String value)
+  {
+    if (value == null)
+    {
+      _eventNames = null;
+    }
+    else
+    {
+      _eventNames = value.trim().split("\\s+");
+    }
+  }
+
   /**
    * Sets the component supertype for this component.
    *
@@ -421,7 +458,6 @@
     return prop;
   }
 
-
   /**
    * Returns true if this component has any properties.
    *
@@ -537,7 +573,6 @@
     return (FacetBean)_facets.get(facetName);
   }
 
-
   public FacetBean findFacet(
     String facetName,
     boolean flatten)
@@ -824,7 +859,6 @@
     return event;
   }
 
-
   /**
    * Returns an iterator for all events on this component only.
    *
@@ -902,7 +936,6 @@
     return (parent != null) ? parent.findRendererType() : null;
   }
 
-
   /**
    * Finds the component superclass in the component inheritance
    * hierarchy.
@@ -1035,6 +1068,7 @@
   private String  _tagSuperclass;
   private String  _localName;
   private String  _nodeClass;
+  private String  _defaultEventName;
   private boolean _namingContainer;
   private boolean _children = true;
   private Map     _properties;
@@ -1043,6 +1077,7 @@
   private int     _componentClassModifiers;
   private int     _tagClassModifiers;
   private String[] _unsupportedAgents = new String[0];
+  private String[] _eventNames;
 
   static private final String _TRINIDAD_COMPONENT_BASE =
                          "org.apache.myfaces.trinidad.component.UIXComponentBase";

Modified: myfaces/trinidad-maven/branches/2.0.0-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad-maven/branches/2.0.0-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java?rev=886252&r1=886251&r2=886252&view=diff
==============================================================================
--- myfaces/trinidad-maven/branches/2.0.0-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java (original)
+++ myfaces/trinidad-maven/branches/2.0.0-branch/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/parse/FacesConfigParser.java Wed Dec  2 18:45:08 2009
@@ -18,20 +18,24 @@
  */
 package org.apache.myfaces.trinidadbuild.plugin.faces.parse;
 
+import java.io.IOException;
+import java.io.InputStream;
+
+import java.net.URL;
+import java.net.URLConnection;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParserFactory;
+
 import org.apache.commons.digester.AbstractObjectCreationFactory;
 import org.apache.commons.digester.Digester;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.myfaces.trinidadbuild.plugin.faces.parse.rules.BeanPropertySetterRule;
 import org.apache.myfaces.trinidadbuild.plugin.faces.util.XIncludeFilter;
+
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
 
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParserFactory;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.net.URLConnection;
 
 public class FacesConfigParser
 {
@@ -124,7 +128,7 @@
 
     // Maven Faces Plugin
     digester.setRuleNamespaceURI("http://myfaces.apache.org/maven-faces-plugin");
-    
+
     // faces-config/component/facet/facet-extension
     digester.addBeanPropertySetter("faces-config/component/facet/facet-extension/hidden");
 
@@ -213,6 +217,11 @@
     digester.setRuleNamespaceURI("http://java.sun.com/xml/ns/javaee/faces/design-time-metadata");
     digester.addBeanPropertySetter("faces-config/component/property/property-extension/property-metadata/required");
     digester.addBeanPropertySetter("faces-config/component/property/property-extension/property-metadata/value-expression", "valueExpression");
+    digester.addBeanPropertySetter("faces-config/component/component-extension/default-event-name",
+                                   "defaultEventName");
+    digester.addCallMethod("faces-config/component/component-extension/event-names",
+                           "parseEventNames", 1);
+    digester.addCallParam("faces-config/component/component-extension/event-names", 0);
 
     // XInclude rules
     digester.setRuleNamespaceURI(XIncludeFilter.XINCLUDE_NAMESPACE);
@@ -490,7 +499,7 @@
     return digester;
   }
 
-  // Base class for include factories 
+  // Base class for include factories
   abstract static public class AbstractIncludeFactory extends AbstractObjectCreationFactory
   {
     public Object createObject(

Modified: myfaces/trinidad-maven/branches/2.0.0-branch/maven-faces-plugin/src/main/resources/META-INF/schemas/maven-faces-plugin.xsd
URL: http://svn.apache.org/viewvc/myfaces/trinidad-maven/branches/2.0.0-branch/maven-faces-plugin/src/main/resources/META-INF/schemas/maven-faces-plugin.xsd?rev=886252&r1=886251&r2=886252&view=diff
==============================================================================
--- myfaces/trinidad-maven/branches/2.0.0-branch/maven-faces-plugin/src/main/resources/META-INF/schemas/maven-faces-plugin.xsd (original)
+++ myfaces/trinidad-maven/branches/2.0.0-branch/maven-faces-plugin/src/main/resources/META-INF/schemas/maven-faces-plugin.xsd Wed Dec  2 18:45:08 2009
@@ -16,7 +16,7 @@
     KIND, either express or implied.  See the License for the
     specific language governing permissions and limitations
     under the License.
-	   
+
 -->
 <xsd:schema xmlns:mfp="http://myfaces.apache.org/maven-faces-plugin"
             xmlns:xsd="http://www.w3.org/2001/XMLSchema"