]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixes #2076 : TextField.getValue() does not use format
authorJoonas Lehtinen <joonas.lehtinen@itmill.com>
Mon, 15 Sep 2008 21:02:12 +0000 (21:02 +0000)
committerJoonas Lehtinen <joonas.lehtinen@itmill.com>
Mon, 15 Sep 2008 21:02:12 +0000 (21:02 +0000)
svn changeset:5403/svn branch:trunk

src/com/itmill/toolkit/ui/TextField.java

index 50404d643a32aeaa36b3eaa87669d3ad53fa8e10..741fb84589d2e99a29907946f6f6009fda29ecd0 100644 (file)
@@ -182,20 +182,31 @@ public class TextField extends AbstractField {
      * @return the Formatted value.
      * @see #setFormat(Format)
      * @see Format
+     * @deprecated
      */
     protected String getFormattedValue() {
-        final Object value = getValue();
-        if (format != null && value != null) {
-            try {
-                return format.format(value);
-            } catch (final IllegalArgumentException e) {
-                // FIXME: Handle exception ?
-            }
+        Object v = getValue();
+        if (v == null) {
+            return null;
+        }
+        return v.toString();
+    }
+
+    /*
+     * Gets the value of the field, but uses formatter is given. Don't add a
+     * JavaDoc comment here, we use the default documentation from implemented
+     * interface.
+     */
+    public Object getValue() {
+        Object v = super.getValue();
+        if (format == null || v == null) {
+            return v;
         }
-        if (value != null) {
-            return value.toString();
+        try {
+            return format.format(v);
+        } catch (final IllegalArgumentException e) {
+            return v;
         }
-        return null;
     }
 
     /*