changeset 52:1d0be51ab93b

The DataList has a label now. flys-client/trunk@1508 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 17 Mar 2011 18:20:05 +0000
parents a2923d63f530
children 3d5d7788d471
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/server/ArtifactDescriptionFactory.java flys-client/src/main/java/de/intevation/flys/client/shared/model/DataList.java
diffstat 3 files changed, 46 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Thu Mar 17 16:44:51 2011 +0000
+++ b/flys-client/ChangeLog	Thu Mar 17 18:20:05 2011 +0000
@@ -1,3 +1,12 @@
+2011-03-17  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/shared/model/DataList.java:
+	  Added a constructor to create a DataList with a label.
+
+	* src/main/java/de/intevation/flys/client/server/ArtifactDescriptionFactory.java:
+	  Read the label of the static state data objects and create the DataList
+	  objects with this attribute.
+
 2011-03-17  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/shared/model/DataList.java: This
--- a/flys-client/src/main/java/de/intevation/flys/client/server/ArtifactDescriptionFactory.java	Thu Mar 17 16:44:51 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/server/ArtifactDescriptionFactory.java	Thu Mar 17 18:20:05 2011 +0000
@@ -177,6 +177,10 @@
 
             String name = XMLUtils.xpathString(
                 tmp, "@art:name", ArtifactNamespaceContext.INSTANCE);
+            String uiprovider = XMLUtils.xpathString(
+                tmp, "@art:uiprovider", ArtifactNamespaceContext.INSTANCE);
+            String label = XMLUtils.xpathString(
+                tmp, "@art:label", ArtifactNamespaceContext.INSTANCE);
 
             NodeList dataNodes = (NodeList) XMLUtils.xpath(
                 tmp,
@@ -189,7 +193,7 @@
             }
 
             int size      = dataNodes.getLength();
-            DataList list = new DataList(name, size);
+            DataList list = new DataList(name, size, uiprovider, label);
 
             for (int j = 0; j < size; j++) {
                 Node dataNode = dataNodes.item(j);
--- a/flys-client/src/main/java/de/intevation/flys/client/shared/model/DataList.java	Thu Mar 17 16:44:51 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/DataList.java	Thu Mar 17 18:20:05 2011 +0000
@@ -31,6 +31,12 @@
     }
 
 
+    /**
+     * Constructor.
+     *
+     * @param state The name of the state that this list belongs to.
+     * @param size The initial size of the list.
+     */
     public DataList(String state, int size) {
         this.state = state;
         this.data  = new ArrayList<Data>(size);
@@ -41,7 +47,9 @@
      * A constructor that creates a new DataList without Data objects and no
      * UIProvider. Size defines the initial size of the list.
      *
+     * @param state The name of the state that this list belongs to.
      * @param size The initial size of the list.
+     * @param uiprovider The UIProvider that should be used to render this list.
      */
     public DataList(String state, int size, String uiprovider) {
         this(state, size);
@@ -50,6 +58,21 @@
 
 
     /**
+     * A constructor that creates a new DataList without Data objects and no
+     * UIProvider. Size defines the initial size of the list.
+     *
+     * @param state The name of the state that this list belongs to.
+     * @param size The initial size of the list.
+     * @param uiprovider The UIProvider that should be used to render this list.
+     * @param label The label.
+     */
+    public DataList(String state, int size, String uiprovider, String label) {
+        this(state, size, uiprovider);
+        this.label = label;
+    }
+
+
+    /**
      * Adds a new Data object to the list.
      *
      * @param obj The Data object.
@@ -92,6 +115,15 @@
 
 
     /**
+     * Returns the whole list of Data objects.
+     *
+     * @return the whole list of Data objects.
+     */
+    public List<Data> getAll() {
+        return data;
+    }
+
+    /**
      * Returns the number of Data objects in the list.
      *
      * @param the number of Data objects in the list.

http://dive4elements.wald.intevation.org