Mercurial > dive4elements > river
changeset 4689:79f11188da21
Add a Collection method to return a string to be displayed in the gui
author | Björn Ricks <bjoern.ricks@intevation.de> |
---|---|
date | Mon, 17 Dec 2012 16:10:47 +0100 |
parents | 1e23998aa4db |
children | 7c59baa150bd |
files | flys-client/src/main/java/de/intevation/flys/client/shared/model/Collection.java flys-client/src/main/java/de/intevation/flys/client/shared/model/DefaultCollection.java |
diffstat | 2 files changed, 17 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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 :
--- 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 :