diff flys-client/src/main/java/de/intevation/flys/client/client/ui/AbstractUIProvider.java @ 247:4a684d29404f

Implemented the createOld() of WQAdaptedInputPanel. flys-client/trunk@1832 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 05 May 2011 09:33:15 +0000
parents 137daff2c732
children 9f16ac843dda
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/AbstractUIProvider.java	Thu May 05 08:09:03 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/AbstractUIProvider.java	Thu May 05 09:33:15 2011 +0000
@@ -19,6 +19,7 @@
 import de.intevation.flys.client.client.event.StepForwardEvent;
 import de.intevation.flys.client.client.event.StepForwardHandler;
 import de.intevation.flys.client.shared.model.Data;
+import de.intevation.flys.client.shared.model.DataItem;
 import de.intevation.flys.client.shared.model.DataList;
 import de.intevation.flys.client.shared.model.Artifact;
 
@@ -177,6 +178,45 @@
 
 
     /**
+     * This method greps the Data with name <i>name</i> from the list and
+     * returns it.
+     *
+     * @param items A list of Data.
+     * @param name The name of the Data that we are searching for.
+     *
+     * @return the Data with the name <i>name</i>.
+     */
+    protected Data getData(List<Data> data, String name) {
+        for (Data d: data) {
+            if (name.equals(d.getLabel())) {
+                return d;
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * This method greps the DataItem with name <i>name</i> from the list and
+     * returns it.
+     *
+     * @param items A list of DataItems.
+     * @param name The name of the DataItem that we are searching for.
+     *
+     * @return the DataItem with the name <i>name</i>.
+     */
+    protected DataItem getDataItem(DataItem[] items, String name) {
+        for (DataItem item: items) {
+            if (name.equals(item.getLabel())) {
+                return item;
+            }
+        }
+
+        return null;
+    }
+
+
+    /**
      * This method needs to be implemented by concrete subclasses. It should
      * create a new Canvas object with a representation of <i>data</i>.
      *

http://dive4elements.wald.intevation.org