[Dive4elements-commits] [PATCH 4 of 7] Add new method hasItems to Collection class

Wald Commits scm-commit at wald.intevation.org
Tue Dec 11 16:27:39 CET 2012


# HG changeset patch
# User Björn Ricks <bjoern.ricks at intevation.de>
# Date 1355239497 -3600
# Node ID bb9ce9aece70b43ce7620674a9701205d503806a
# Parent  518d60dfe6bf2af06a50e3443381ff2a87140f85
Add new method hasItems to Collection class

diff -r 518d60dfe6bf -r bb9ce9aece70 flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java	Tue Dec 11 16:23:29 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java	Tue Dec 11 16:24:57 2012 +0100
@@ -336,7 +336,7 @@
      * @return true, if the Collection is new.
      */
     public boolean isNew() {
-        return collection.getItemLength() == 0;
+        return collection.hasItems();
     }
 
 
diff -r 518d60dfe6bf -r bb9ce9aece70 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	Tue Dec 11 16:23:29 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/Collection.java	Tue Dec 11 16:24:57 2012 +0100
@@ -56,5 +56,7 @@
     public void addRecommendations(List<Recommendation> recommendations);
 
     public boolean loadedRecommendation(Recommendation recommendation);
+
+    public boolean hasItems();
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
diff -r 518d60dfe6bf -r bb9ce9aece70 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	Tue Dec 11 16:23:29 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/DefaultCollection.java	Tue Dec 11 16:24:57 2012 +0100
@@ -291,5 +291,11 @@
 
         return false;
     }
+
+
+    @Override
+    public boolean hasItems() {
+        return items.isEmpty();
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :


More information about the Dive4elements-commits mailing list