You are viewing a plain text version of this content. The canonical link for it is here.
Posted to adffaces-commits@incubator.apache.org by ma...@apache.org on 2006/10/27 23:24:48 UTC

svn commit: r468584 - /incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentTag.java

Author: matzew
Date: Fri Oct 27 16:24:48 2006
New Revision: 468584

URL: http://svn.apache.org/viewvc?view=rev&rev=468584
Log:
added double/float support 

Modified:
    incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentTag.java

Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentTag.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentTag.java?view=diff&rev=468584&r1=468583&r2=468584
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentTag.java (original)
+++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentTag.java Fri Oct 27 16:24:48 2006
@@ -236,9 +236,6 @@
     }
   }
 
-
-
-
   /**
    * Set a property of type java.lang.Long.  If the value
    * is an EL expression, it will be stored as a ValueBinding.
@@ -260,6 +257,54 @@
     else
     {
       bean.setProperty(key, Long.valueOf(value));
+    }
+  }
+
+  /**
+   * Set a property of type java.lang.Dobule.  If the value
+   * is an EL expression, it will be stored as a ValueBinding.
+   * Otherwise, it will parsed with Dobule.valueOf().
+   * Null values are ignored.
+   */
+  protected void setDoubleProperty(
+    FacesBean   bean,
+    PropertyKey key,
+    String      value)
+  {
+    if (value == null)
+      return;
+
+    if (isValueReference(value))
+    {
+      bean.setValueBinding(key, createValueBinding(value));
+    }
+    else
+    {
+      bean.setProperty(key, Double.valueOf(value));
+    }
+  }
+
+  /**
+   * Set a property of type java.lang.Float.  If the value
+   * is an EL expression, it will be stored as a ValueBinding.
+   * Otherwise, it will parsed with Dobule.valueOf().
+   * Null values are ignored.
+   */
+  protected void setFloatProperty(
+    FacesBean   bean,
+    PropertyKey key,
+    String      value)
+  {
+    if (value == null)
+      return;
+
+    if (isValueReference(value))
+    {
+      bean.setValueBinding(key, createValueBinding(value));
+    }
+    else
+    {
+      bean.setProperty(key, Float.valueOf(value));
     }
   }