changeset 514:b9127f876a6a

Enhanced the Data object to save default values/labels. flys-client/trunk@1984 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 24 May 2011 10:44:59 +0000 (2011-05-24)
parents e090fbd5a535
children 27ffaf628b54
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/shared/model/Data.java flys-client/src/main/java/de/intevation/flys/client/shared/model/DefaultData.java
diffstat 3 files changed, 43 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Mon May 23 14:30:54 2011 +0000
+++ b/flys-client/ChangeLog	Tue May 24 10:44:59 2011 +0000
@@ -1,3 +1,9 @@
+2011-05-24  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/shared/model/Data.java,
+	  src/main/java/de/intevation/flys/client/shared/model/DefaultData.java:
+	  A data item can now have a default value and a default label.
+
 2011-05-23  Ingo Weinzierl <ingo@intevation.de>
 
 	  ISSUE-62 (part I/II)
--- a/flys-client/src/main/java/de/intevation/flys/client/shared/model/Data.java	Mon May 23 14:30:54 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/Data.java	Tue May 24 10:44:59 2011 +0000
@@ -42,5 +42,13 @@
      * @return the DataItems.
      */
     public DataItem[] getItems();
+
+
+    /**
+     * Returns the default value of this data object.
+     *
+     * @return the default value.
+     */
+    public DataItem getDefault();
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-client/src/main/java/de/intevation/flys/client/shared/model/DefaultData.java	Mon May 23 14:30:54 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/DefaultData.java	Tue May 24 10:44:59 2011 +0000
@@ -21,6 +21,9 @@
     /** The DataItems.*/
     protected DataItem[] items;
 
+    /** The default DataItem.*/
+    protected DataItem defaultItem;
+
 
     public DefaultData() {
     }
@@ -40,10 +43,31 @@
         String type,
         DataItem[] items)
     {
+        this(label, description, type, items, null);
+    }
+
+
+    /**
+     * The constructor to create new DefaultData objects with a default value.
+     *
+     * @param label The label.
+     * @param description The description.
+     * @param type The type.
+     * @param items The DataItems.
+     * @param defaultItem The default DataItem.
+     */
+    public DefaultData(
+        String label,
+        String description,
+        String type,
+        DataItem[] items,
+        DataItem defaultItem)
+    {
         this.label       = label;
         this.description = description;
         this.type        = type;
         this.items       = items;
+        this.defaultItem = defaultItem;
     }
 
 
@@ -65,5 +89,10 @@
     public DataItem[] getItems() {
         return items;
     }
+
+
+    public DataItem getDefault() {
+        return defaultItem;
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org