You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2009/07/22 05:00:30 UTC

svn commit: r796607 - in /myfaces/myfaces-build-tools/trunk/maven2-plugins: myfaces-builder-annotations/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/annotation/ myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/mav...

Author: lu4242
Date: Wed Jul 22 03:00:30 2009
New Revision: 796607

URL: http://svn.apache.org/viewvc?rev=796607&view=rev
Log:
MYFACES-2291 Components implementing ClientBehaviorHolder should override getEventNames() and getDefaultEventName()

Modified:
    myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-annotations/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/annotation/JSFComponent.java
    myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-annotations/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/annotation/JSFProperty.java
    myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/model/ComponentMeta.java
    myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/model/PropertyMeta.java
    myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/qdox/QdoxModelBuilder.java

Modified: myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-annotations/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/annotation/JSFComponent.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-annotations/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/annotation/JSFComponent.java?rev=796607&r1=796606&r2=796607&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-annotations/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/annotation/JSFComponent.java (original)
+++ myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-annotations/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/annotation/JSFComponent.java Wed Jul 22 03:00:30 2009
@@ -336,4 +336,14 @@
      * template (true) or subclass (false).
      */
     boolean template() default false;
+    
+    /**
+     * The name of the default client event to be return on method
+     * ClientBehaviorHolder.getDefaultEventName(). This property is
+     * JSF 2.0 specific, and the component must implement 
+     * javax.faces.component.behavior.ClientBehaviorHolder interface.  
+     * 
+     * @since 1.0.4
+     */
+    String defaultEventName() default "";
 }

Modified: myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-annotations/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/annotation/JSFProperty.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-annotations/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/annotation/JSFProperty.java?rev=796607&r1=796606&r2=796607&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-annotations/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/annotation/JSFProperty.java (original)
+++ myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-annotations/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/annotation/JSFProperty.java Wed Jul 22 03:00:30 2009
@@ -146,4 +146,15 @@
      * @since 1.0.3
      */
     String deferredValueType() default "";
+    
+    /**
+     * Indicate if this property is a client event that should
+     * be returned by ClientBehaviorHolder.getEventNames(). This
+     * property is by default "", it is JSF 2.0 specific, and 
+     * the component holding it must implement 
+     * javax.faces.component.behavior.ClientBehaviorHolder interface.
+     * 
+     * @since 1.0.4
+     */
+    String clientEvent() default "";
 }

Modified: myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/model/ComponentMeta.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/model/ComponentMeta.java?rev=796607&r1=796606&r2=796607&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/model/ComponentMeta.java (original)
+++ myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/model/ComponentMeta.java Wed Jul 22 03:00:30 2009
@@ -50,6 +50,7 @@
     private Boolean _configExcluded;
     private String _serialuid;
     private String _implements;
+    private String _defaultEventName;
     
     private Boolean _generatedComponentClass;
     private Boolean _generatedTagClass;
@@ -73,6 +74,7 @@
         out.writeElement("tagHandler", _tagHandler);
         out.writeElement("rendererType", _rendererType);
         out.writeElement("configExcluded", _configExcluded);
+        out.writeElement("defaultEventName", _defaultEventName);
 
         out.writeElement("serialuid", _serialuid);
         out.writeElement("implements", _implements);
@@ -107,6 +109,7 @@
         digester.addBeanPropertySetter(newPrefix + "/tagSuperclass");
         digester.addBeanPropertySetter(newPrefix + "/tagHandler");
         digester.addBeanPropertySetter(newPrefix + "/rendererType");
+        digester.addBeanPropertySetter(newPrefix + "/defaultEventName");
         digester.addBeanPropertySetter(newPrefix + "/faceletRendererType");
         digester.addBeanPropertySetter(newPrefix + "/configExcluded");
         digester.addBeanPropertySetter(newPrefix + "/serialuid");
@@ -157,6 +160,7 @@
         }
         //_tagClass = ModelUtils.merge(this._tagClass, other._tagClass);
         _tagHandler = ModelUtils.merge(this._tagHandler, other._tagHandler);
+        _defaultEventName = ModelUtils.merge(this._defaultEventName, other._defaultEventName);
         _namingContainer = ModelUtils.merge(this._namingContainer,
                 other._namingContainer);
         _children = ModelUtils.merge(this._children, other._children);
@@ -390,6 +394,24 @@
     {
         return (FacetMeta) _facets.get(name);
     }
+    
+    /**
+     * 
+     * @since 1.0.4
+     */
+    public String getDefaultEventName()
+    {
+        return _defaultEventName;
+    }
+
+    /**
+     * 
+     * @since 1.0.4
+     */
+    public void setDefaultEventName(String defaultEventName)
+    {
+        this._defaultEventName = defaultEventName;
+    }
             
     //THIS METHODS ARE USED FOR VELOCITY TO GET DATA AND GENERATE CLASSES
     

Modified: myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/model/PropertyMeta.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/model/PropertyMeta.java?rev=796607&r1=796606&r2=796607&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/model/PropertyMeta.java (original)
+++ myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/model/PropertyMeta.java Wed Jul 22 03:00:30 2009
@@ -54,6 +54,7 @@
     private Boolean _setMethod; //Generate method to define if is set a value or not
     
     private Boolean _rtexprvalue;
+    private String _clientEvent;
     
     private String _deferredValueType;
 
@@ -88,6 +89,7 @@
         _setMethod = pm._setMethod;
         _rtexprvalue = pm._rtexprvalue;
         _deferredValueType = pm._deferredValueType;
+        _clientEvent = pm._clientEvent;
     }
     
     /**
@@ -127,6 +129,7 @@
         out.writeElement("setMethod", pm._setMethod);
         out.writeElement("rtexprvalue", pm._rtexprvalue);
         out.writeElement("deferredValueType", pm._deferredValueType);
+        out.writeElement("clientEvent", pm._clientEvent);
         out.endElement("property");
     }
 
@@ -162,6 +165,7 @@
         digester.addBeanPropertySetter(newPrefix + "/setMethod", "setMethod");
         digester.addBeanPropertySetter(newPrefix + "/rtexprvalue", "rtexprvalue");
         digester.addBeanPropertySetter(newPrefix + "/deferredValueType", "deferredValueType");
+        digester.addBeanPropertySetter(newPrefix + "/clientEvent", "clientEvent");
         MethodSignatureMeta.addXmlRules(digester, newPrefix);
         
     }
@@ -195,6 +199,7 @@
         _tagExcluded = ModelUtils.merge(this._tagExcluded, other._tagExcluded);
         _rtexprvalue = ModelUtils.merge(this._rtexprvalue, other._rtexprvalue);
         _deferredValueType = ModelUtils.merge(this._deferredValueType, other._deferredValueType);
+        _clientEvent = ModelUtils.merge(this._clientEvent, other._clientEvent);
     }
 
     /**
@@ -547,4 +552,22 @@
     {
         return _deferredValueType;
     }
+
+    /**
+     * 
+     * @since 1.0.4
+     */
+    public String getClientEvent()
+    {
+        return _clientEvent;
+    }
+
+    /**
+     * 
+     * @since 1.0.4
+     */
+    public void setClientEvent(String clientEvent)
+    {
+        this._clientEvent = clientEvent;
+    }
 }

Modified: myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/qdox/QdoxModelBuilder.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/qdox/QdoxModelBuilder.java?rev=796607&r1=796606&r2=796607&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/qdox/QdoxModelBuilder.java (original)
+++ myfaces/myfaces-build-tools/trunk/maven2-plugins/myfaces-builder-plugin/src/main/java/org/apache/myfaces/buildtools/maven2/plugin/builder/qdox/QdoxModelBuilder.java Wed Jul 22 03:00:30 2009
@@ -1131,6 +1131,7 @@
         String tagClass = getString(clazz, "tagClass", props, null);
         String tagSuperclass = getString(clazz, "tagSuperclass", props, null);
         String tagHandler = getString(clazz, "tagHandler", props, null);
+        String defaultEventName = getString(clazz, "defaultEventName", props, null);
         String serialuid = getString(clazz, "serialuid", props, null);
         String implementsValue = getString(clazz, "implements", props, null);
         implementsValue = getString(clazz, "implementz", props, implementsValue);
@@ -1149,6 +1150,7 @@
         component.setSerialuid(serialuid);
         component.setImplements(implementsValue);
         component.setTemplate(template);
+        component.setDefaultEventName(defaultEventName);
         
         JavaClass[] interfaces = clazz.getImplementedInterfaces();
         for (int i = 0; i < interfaces.length; ++i)
@@ -1545,6 +1547,7 @@
         String defaultValue = getString(clazz,"defaultValue",props,null);
         String jspName = getString(clazz,"jspName",props,null);
         Boolean rtexprvalue = getBoolean(clazz, "rtexprvalue",props,null);
+        String clientEvent = getString(clazz, "clientEvent",props,null);
         String deferredValueType = getString(clazz, "deferredValueType", props, null);
 
         Type returnType = null;
@@ -1588,6 +1591,7 @@
         p.setJspName(jspName);
         p.setRtexprvalue(rtexprvalue);
         p.setDeferredValueType(deferredValueType);
+        p.setClientEvent(clientEvent);
         p.setInheritedTag(inheritedTag);
         
         if (returnSignature != null)