incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat...@apache.org
Subject svn commit: r471693 - /incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentTag.java
Date Mon, 06 Nov 2006 11:02:46 GMT
Author: matzew
Date: Mon Nov  6 03:02:45 2006
New Revision: 471693

URL: http://svn.apache.org/viewvc?view=rev&rev=471693
Log:
added setNumberProperties

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=471693&r1=471692&r2=471693
==============================================================================
--- 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
Mon Nov  6 03:02:45 2006
@@ -184,14 +184,13 @@
     }
   }
 
-
   /**
-   * Set a property of type java.lang.Integer.  If the value
+   * Set a property of type java.lang.Number.  If the value
    * is an EL expression, it will be stored as a ValueBinding.
-   * Otherwise, it will parsed with Integer.valueOf().
+   * Otherwise, it will parsed with Integer.valueOf() or Double.valueOf() .
    * Null values are ignored.
    */
-  protected void setIntegerProperty(
+  protected void setNumberProperty(
     FacesBean   bean,
     PropertyKey key,
     String      value)
@@ -205,9 +204,35 @@
     }
     else
     {
-      bean.setProperty(key, Integer.valueOf(value));
+      if(value.indexOf(".") == -1)
+        bean.setProperty(key, Integer.valueOf(value));
+      else
+        bean.setProperty(key, Double.valueOf(value));
     }
   }
+ /**
+  * Set a property of type java.lang.Integer.  If the value
+  * is an EL expression, it will be stored as a ValueBinding.
+  * Otherwise, it will parsed with Integer.valueOf().
+  * Null values are ignored.
+  */
+ protected void setIntegerProperty(
+   FacesBean   bean,
+   PropertyKey key,
+   String      value)
+ {
+   if (value == null)
+     return;
+
+   if (isValueReference(value))
+   {
+     bean.setValueBinding(key, createValueBinding(value));
+   }
+   else
+   {
+     bean.setProperty(key, Integer.valueOf(value));
+   }
+ }
 
 
   /**



Mime
View raw message