incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat...@apache.org
Subject svn commit: r471694 - /incubator/adffaces/branches/stable-06-nov/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentTag.java
Date Mon, 06 Nov 2006 11:04:20 GMT
Author: matzew
Date: Mon Nov  6 03:04:19 2006
New Revision: 471694

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

Modified:
    incubator/adffaces/branches/stable-06-nov/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentTag.java

Modified: incubator/adffaces/branches/stable-06-nov/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentTag.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/stable-06-nov/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentTag.java?view=diff&rev=471694&r1=471693&r2=471694
==============================================================================
--- incubator/adffaces/branches/stable-06-nov/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentTag.java
(original)
+++ incubator/adffaces/branches/stable-06-nov/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/UIXComponentTag.java
Mon Nov  6 03:04:19 2006
@@ -184,6 +184,32 @@
     }
   }
 
+  /**
+   * 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() or Double.valueOf() .
+   * Null values are ignored.
+   */
+  protected void setNumberProperty(
+    FacesBean   bean,
+    PropertyKey key,
+    String      value)
+  {
+    if (value == null)
+      return;
+
+    if (isValueReference(value))
+    {
+      bean.setValueBinding(key, createValueBinding(value));
+    }
+    else
+    {
+      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



Mime
View raw message