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/06/22 09:08:01 UTC

svn commit: r787154 - /incubator/click/trunk/click/framework/src/org/apache/click/util/PageImports.java

Author: sabob
Date: Mon Jun 22 07:08:01 2009
New Revision: 787154

URL: http://svn.apache.org/viewvc?rev=787154&view=rev
Log:
provide an addAll method on PageImports

Modified:
    incubator/click/trunk/click/framework/src/org/apache/click/util/PageImports.java

Modified: incubator/click/trunk/click/framework/src/org/apache/click/util/PageImports.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/framework/src/org/apache/click/util/PageImports.java?rev=787154&r1=787153&r2=787154&view=diff
==============================================================================
--- incubator/click/trunk/click/framework/src/org/apache/click/util/PageImports.java (original)
+++ incubator/click/trunk/click/framework/src/org/apache/click/util/PageImports.java Mon Jun 22 07:08:01 2009
@@ -144,8 +144,13 @@
      * Add the given Element to the Page HEAD elements.
      *
      * @param element the Element to add
+     * @throws IllegalArgumentException if the Element is null
      */
     public void add(Element element) {
+        if (element == null) {
+            throw new IllegalArgumentException("Null element parameter");
+        }
+
         if (element instanceof JsImport) {
             if (jsImports.contains(element)) {
                 return;
@@ -180,6 +185,22 @@
     }
 
     /**
+     * Add the given list of Elements to the Page HEAD elements.
+     *
+     * @param elements the list of Elements to add to the Page HEAD elements
+     * @throws IllegalArgumentException is the list of Elements are null
+     */
+    public void addAll(List<Element> elements) {
+        if (elements == null) {
+            throw new IllegalArgumentException("Null elements parameter");
+        }
+
+        for (Element element : elements) {
+            add(element);
+        }
+    }
+
+    /**
      * Add the given HTML import line to the Page HTML imports.
      *
      * @deprecated use the new {@link #add(org.apache.click.element.Element)}