[Dive4elements-commits] [PATCH 1 of 8] Add a Collection method to return a string to be displayed in the gui

Wald Commits scm-commit at wald.intevation.org
Mon Dec 17 16:19:13 CET 2012


# HG changeset patch
# User Björn Ricks <bjoern.ricks at intevation.de>
# Date 1355757047 -3600
# Node ID 79f11188da214d0c555b85c00e555daf689b929e
# Parent  1e23998aa4db8e5deefba45d3f75e0c3fb36cc07
Add a Collection method to return a string to be displayed in the gui

diff -r 1e23998aa4db -r 79f11188da21 flys-client/src/main/java/de/intevation/flys/client/shared/model/Collection.java
--- a/flys-client/src/main/java/de/intevation/flys/client/shared/model/Collection.java	Mon Dec 17 15:54:30 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/Collection.java	Mon Dec 17 16:10:47 2012 +0100
@@ -58,5 +58,11 @@
     public boolean loadedRecommendation(Recommendation recommendation);
 
     public boolean hasItems();
+
+    /**
+     * Returns the name which should be displayed in the client gui
+     * @return String display name
+     */
+    public String getDisplayName();
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
diff -r 1e23998aa4db -r 79f11188da21 flys-client/src/main/java/de/intevation/flys/client/shared/model/DefaultCollection.java
--- a/flys-client/src/main/java/de/intevation/flys/client/shared/model/DefaultCollection.java	Mon Dec 17 15:54:30 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/DefaultCollection.java	Mon Dec 17 16:10:47 2012 +0100
@@ -297,5 +297,16 @@
     public boolean hasItems() {
         return items.isEmpty();
     }
+
+    /**
+     * Returns the name of the collection or uuid if no name is set
+     */
+    @Override
+    public String getDisplayName() {
+        if (this.name != null) {
+            return this.name;
+        }
+        return this.uuid;
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :


More information about the Dive4elements-commits mailing list