You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@click.apache.org by sa...@apache.org on 2009/10/28 02:11:54 UTC

svn commit: r830419 - /incubator/click/trunk/click/examples/src/org/apache/click/examples/control/exporter/TableExportBanner.java

Author: sabob
Date: Wed Oct 28 01:11:54 2009
New Revision: 830419

URL: http://svn.apache.org/viewvc?rev=830419&view=rev
Log:
don't render banner if no exporters are defined

Modified:
    incubator/click/trunk/click/examples/src/org/apache/click/examples/control/exporter/TableExportBanner.java

Modified: incubator/click/trunk/click/examples/src/org/apache/click/examples/control/exporter/TableExportBanner.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/examples/src/org/apache/click/examples/control/exporter/TableExportBanner.java?rev=830419&r1=830418&r2=830419&view=diff
==============================================================================
--- incubator/click/trunk/click/examples/src/org/apache/click/examples/control/exporter/TableExportBanner.java (original)
+++ incubator/click/trunk/click/examples/src/org/apache/click/examples/control/exporter/TableExportBanner.java Wed Oct 28 01:11:54 2009
@@ -25,6 +25,7 @@
 import org.apache.click.Control;
 import org.apache.click.control.Renderable;
 import org.apache.click.util.HtmlStringBuffer;
+import org.apache.commons.collections.CollectionUtils;
 
 /**
  *
@@ -123,6 +124,10 @@
      * @param buffer the StringBuffer to render the paging controls to
      */
     protected void renderExportBanner(HtmlStringBuffer buffer) {
+        List exportFormats = getExportFormats();
+        if (exportFormats == null || exportFormats.isEmpty()) {
+            return;
+        }
 
         HtmlStringBuffer banner = new HtmlStringBuffer();
         Iterator<AbstractTableExporter> it = getExportFormats().iterator();