changeset 2312:f911ddd93f58

Format multiple double values with a locale. flys-artifacts/trunk@3992 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Thu, 09 Feb 2012 10:59:38 +0000
parents b8df8d1476ba
children e7fc3465baa2
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/EnterMultipleLocationsState.java
diffstat 2 files changed, 27 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Thu Feb 09 10:57:35 2012 +0000
+++ b/flys-artifacts/ChangeLog	Thu Feb 09 10:59:38 2012 +0000
@@ -1,3 +1,8 @@
+2012-02-09  Felix Wolfsteller	<felix.wolfsteller@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/states/EnterMultipleLocationsState.java:
+	  Locale-format multiple double values also.
+
 2012-02-09  Ingo Weinzierl <ingo@intevation.de>
 
 	* doc/conf/artifacts/winfo.xml: Registered a new facet for difference curves
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/EnterMultipleLocationsState.java	Thu Feb 09 10:57:35 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/EnterMultipleLocationsState.java	Thu Feb 09 10:59:38 2012 +0000
@@ -1,5 +1,9 @@
 package de.intevation.flys.artifacts.states;
 
+import de.intevation.artifacts.CallContext;
+import de.intevation.artifacts.common.utils.StringUtils;
+
+
 /**
  * Get me doubles (km).
  */
@@ -9,5 +13,23 @@
     protected String getUIProvider() {
         return "multi_location_panel";
     }
+
+    
+    /** Deal with multiple double values. */
+    @Override
+    protected String getLabelFor(
+        CallContext cc,
+        String      name,
+        String      value,
+        String      type
+    ) {
+        String label = "";
+        String[] vals = value.split(" ");
+        for (int i = 0; i < vals.length; i++) {
+            vals[i] = super.getLabelFor(cc, name, vals[i], type);
+        }
+
+        return StringUtils.join(vals, " ");
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org