labs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simo...@apache.org
Subject svn commit: r900828 - in /labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview: ShowList.java SmartListProducer.java
Date Tue, 19 Jan 2010 16:08:13 GMT
Author: simoneg
Date: Tue Jan 19 16:08:13 2010
New Revision: 900828

URL: http://svn.apache.org/viewvc?rev=900828&view=rev
Log:
Display "No elements found" on empty lists.

Modified:
    labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/ShowList.java
    labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/SmartListProducer.java

Modified: labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/ShowList.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/ShowList.java?rev=900828&r1=900827&r2=900828&view=diff
==============================================================================
--- labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/ShowList.java
(original)
+++ labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/ShowList.java
Tue Jan 19 16:08:13 2010
@@ -100,6 +100,9 @@
 	
 	@Override
 	public void produce(Writer tables) throws IOException {
+		if (this.list == null || !this.list.iterator().hasNext()) {
+			tables.write(new LocalizableString("No elements found").toString());
+		}
 		this.gototitle = new LocalizableString("Show element").toString();
 		
 		if (referringHandler == null) referringHandler = getCreatingHandler();

Modified: labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/SmartListProducer.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/SmartListProducer.java?rev=900828&r1=900827&r2=900828&view=diff
==============================================================================
--- labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/SmartListProducer.java
(original)
+++ labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/SmartListProducer.java
Tue Jan 19 16:08:13 2010
@@ -113,6 +113,10 @@
 
 	@Override
 	public void produce(Writer tables) throws IOException {
+		if (this.list == null || this.count <= 0) {
+			tables.write(new LocalizableString("No elements found").toString());
+		}
+		
 		if (listStyle == null) {
 			listStyle = new ListStyleTableWithSorting();
 		}		



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org


Mime
View raw message