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/20 15:30:22 UTC

svn commit: r786815 - in /incubator/click/trunk/click/extras/src: ./ META-INF/web/click/ META-INF/web/click/checklist/ META-INF/web/click/prototype/ META-INF/web/click/tree/ META-INF/web/click/tree/images/ org/apache/click/extras/cayenne/ org/apache/cl...

Author: sabob
Date: Sat Jun 20 13:30:21 2009
New Revision: 786815

URL: http://svn.apache.org/viewvc?rev=786815&view=rev
Log:
moved resources to META-INF/web. removed onDeploy methods

Added:
    incubator/click/trunk/click/extras/src/META-INF/web/click/TabbedPanel.css
      - copied unchanged from r783889, incubator/click/trunk/click/extras/src/org/apache/click/extras/panel/TabbedPanel.css
    incubator/click/trunk/click/extras/src/META-INF/web/click/checklist/
    incubator/click/trunk/click/extras/src/META-INF/web/click/checklist/checklist.css
      - copied unchanged from r783889, incubator/click/trunk/click/extras/src/org/apache/click/extras/control/checklist/checklist.css
    incubator/click/trunk/click/extras/src/META-INF/web/click/checklist/checklist.js
      - copied unchanged from r783889, incubator/click/trunk/click/extras/src/org/apache/click/extras/control/checklist/checklist.js
    incubator/click/trunk/click/extras/src/META-INF/web/click/extras-control.css
      - copied unchanged from r783889, incubator/click/trunk/click/extras/src/org/apache/click/extras/control/extras-control.css
    incubator/click/trunk/click/extras/src/META-INF/web/click/extras-control.js
      - copied unchanged from r783889, incubator/click/trunk/click/extras/src/org/apache/click/extras/control/extras-control.js
    incubator/click/trunk/click/extras/src/META-INF/web/click/keyboard.css
      - copied unchanged from r783889, incubator/click/trunk/click/extras/src/org/apache/click/extras/control/keyboard.css
    incubator/click/trunk/click/extras/src/META-INF/web/click/keyboard.js
      - copied unchanged from r783889, incubator/click/trunk/click/extras/src/org/apache/click/extras/control/keyboard.js
    incubator/click/trunk/click/extras/src/META-INF/web/click/keyboard.png
      - copied unchanged from r783889, incubator/click/trunk/click/extras/src/org/apache/click/extras/control/keyboard.png
    incubator/click/trunk/click/extras/src/META-INF/web/click/menu.css
      - copied unchanged from r783889, incubator/click/trunk/click/extras/src/org/apache/click/extras/control/menu.css
    incubator/click/trunk/click/extras/src/META-INF/web/click/prototype/
    incubator/click/trunk/click/extras/src/META-INF/web/click/prototype/builder.js
      - copied unchanged from r783889, incubator/click/trunk/click/extras/src/org/apache/click/extras/control/prototype/builder.js
    incubator/click/trunk/click/extras/src/META-INF/web/click/prototype/controls.js
      - copied unchanged from r783889, incubator/click/trunk/click/extras/src/org/apache/click/extras/control/prototype/controls.js
    incubator/click/trunk/click/extras/src/META-INF/web/click/prototype/dragdrop.js
      - copied unchanged from r783889, incubator/click/trunk/click/extras/src/org/apache/click/extras/control/prototype/dragdrop.js
    incubator/click/trunk/click/extras/src/META-INF/web/click/prototype/effects.js
      - copied unchanged from r783889, incubator/click/trunk/click/extras/src/org/apache/click/extras/control/prototype/effects.js
    incubator/click/trunk/click/extras/src/META-INF/web/click/prototype/prototype.js
      - copied unchanged from r783889, incubator/click/trunk/click/extras/src/org/apache/click/extras/control/prototype/prototype.js
    incubator/click/trunk/click/extras/src/META-INF/web/click/prototype/scriptaculous.js
      - copied unchanged from r783889, incubator/click/trunk/click/extras/src/org/apache/click/extras/control/prototype/scriptaculous.js
    incubator/click/trunk/click/extras/src/META-INF/web/click/prototype/slider.js
      - copied unchanged from r783889, incubator/click/trunk/click/extras/src/org/apache/click/extras/control/prototype/slider.js
    incubator/click/trunk/click/extras/src/META-INF/web/click/prototype/unittest.js
      - copied unchanged from r783889, incubator/click/trunk/click/extras/src/org/apache/click/extras/control/prototype/unittest.js
    incubator/click/trunk/click/extras/src/META-INF/web/click/tree/
    incubator/click/trunk/click/extras/src/META-INF/web/click/tree/checkbox-tree.js
      - copied unchanged from r783889, incubator/click/trunk/click/extras/src/org/apache/click/extras/tree/checkbox-tree.js
    incubator/click/trunk/click/extras/src/META-INF/web/click/tree/cookie-helper.js
      - copied unchanged from r783889, incubator/click/trunk/click/extras/src/org/apache/click/extras/tree/cookie-helper.js
    incubator/click/trunk/click/extras/src/META-INF/web/click/tree/images/
    incubator/click/trunk/click/extras/src/META-INF/web/click/tree/images/corner.png
      - copied unchanged from r783889, incubator/click/trunk/click/extras/src/org/apache/click/extras/tree/images/corner.png
    incubator/click/trunk/click/extras/src/META-INF/web/click/tree/images/folder-closed.png
      - copied unchanged from r783889, incubator/click/trunk/click/extras/src/org/apache/click/extras/tree/images/folder-closed.png
    incubator/click/trunk/click/extras/src/META-INF/web/click/tree/images/folder-open.png
      - copied unchanged from r783889, incubator/click/trunk/click/extras/src/org/apache/click/extras/tree/images/folder-open.png
    incubator/click/trunk/click/extras/src/META-INF/web/click/tree/images/item.png
      - copied unchanged from r783889, incubator/click/trunk/click/extras/src/org/apache/click/extras/tree/images/item.png
    incubator/click/trunk/click/extras/src/META-INF/web/click/tree/images/minus-corner.png
      - copied unchanged from r783889, incubator/click/trunk/click/extras/src/org/apache/click/extras/tree/images/minus-corner.png
    incubator/click/trunk/click/extras/src/META-INF/web/click/tree/images/minus.png
      - copied unchanged from r783889, incubator/click/trunk/click/extras/src/org/apache/click/extras/tree/images/minus.png
    incubator/click/trunk/click/extras/src/META-INF/web/click/tree/images/plus-corner.png
      - copied unchanged from r783889, incubator/click/trunk/click/extras/src/org/apache/click/extras/tree/images/plus-corner.png
    incubator/click/trunk/click/extras/src/META-INF/web/click/tree/images/plus.png
      - copied unchanged from r783889, incubator/click/trunk/click/extras/src/org/apache/click/extras/tree/images/plus.png
    incubator/click/trunk/click/extras/src/META-INF/web/click/tree/images/tjunction.png
      - copied unchanged from r783889, incubator/click/trunk/click/extras/src/org/apache/click/extras/tree/images/tjunction.png
    incubator/click/trunk/click/extras/src/META-INF/web/click/tree/images/vertical-line.png
      - copied unchanged from r783889, incubator/click/trunk/click/extras/src/org/apache/click/extras/tree/images/vertical-line.png
    incubator/click/trunk/click/extras/src/META-INF/web/click/tree/tree.css
      - copied unchanged from r783889, incubator/click/trunk/click/extras/src/org/apache/click/extras/tree/tree.css
    incubator/click/trunk/click/extras/src/META-INF/web/click/tree/tree.js
      - copied unchanged from r783889, incubator/click/trunk/click/extras/src/org/apache/click/extras/tree/tree.js
Removed:
    incubator/click/trunk/click/extras/src/org/apache/click/extras/control/extras-control.css
    incubator/click/trunk/click/extras/src/org/apache/click/extras/control/extras-control.js
    incubator/click/trunk/click/extras/src/org/apache/click/extras/control/keyboard.css
    incubator/click/trunk/click/extras/src/org/apache/click/extras/control/keyboard.js
    incubator/click/trunk/click/extras/src/org/apache/click/extras/control/keyboard.png
    incubator/click/trunk/click/extras/src/org/apache/click/extras/control/menu.css
    incubator/click/trunk/click/extras/src/org/apache/click/extras/panel/TabbedPanel.css
    incubator/click/trunk/click/extras/src/org/apache/click/extras/tree/checkbox-tree.js
    incubator/click/trunk/click/extras/src/org/apache/click/extras/tree/cookie-helper.js
    incubator/click/trunk/click/extras/src/org/apache/click/extras/tree/tree.css
    incubator/click/trunk/click/extras/src/org/apache/click/extras/tree/tree.js
Modified:
    incubator/click/trunk/click/extras/src/extras-controls.xml
    incubator/click/trunk/click/extras/src/org/apache/click/extras/cayenne/TabbedCayenneForm.java
    incubator/click/trunk/click/extras/src/org/apache/click/extras/control/AutoCompleteTextField.java
    incubator/click/trunk/click/extras/src/org/apache/click/extras/control/CheckList.java
    incubator/click/trunk/click/extras/src/org/apache/click/extras/control/ColorPicker.java
    incubator/click/trunk/click/extras/src/org/apache/click/extras/control/CreditCardField.java
    incubator/click/trunk/click/extras/src/org/apache/click/extras/control/DateField.java
    incubator/click/trunk/click/extras/src/org/apache/click/extras/control/EmailField.java
    incubator/click/trunk/click/extras/src/org/apache/click/extras/control/Menu.java
    incubator/click/trunk/click/extras/src/org/apache/click/extras/control/NumberField.java
    incubator/click/trunk/click/extras/src/org/apache/click/extras/control/PickList.java
    incubator/click/trunk/click/extras/src/org/apache/click/extras/control/RegexField.java
    incubator/click/trunk/click/extras/src/org/apache/click/extras/control/SubmitLink.java
    incubator/click/trunk/click/extras/src/org/apache/click/extras/control/TabbedForm.java
    incubator/click/trunk/click/extras/src/org/apache/click/extras/control/VirtualKeyboard.java
    incubator/click/trunk/click/extras/src/org/apache/click/extras/control/menu.dtd
    incubator/click/trunk/click/extras/src/org/apache/click/extras/panel/TabbedPanel.java
    incubator/click/trunk/click/extras/src/org/apache/click/extras/tree/CheckboxTree.java
    incubator/click/trunk/click/extras/src/org/apache/click/extras/tree/Tree.java

Modified: incubator/click/trunk/click/extras/src/extras-controls.xml
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/extras/src/extras-controls.xml?rev=786815&r1=786814&r2=786815&view=diff
==============================================================================
--- incubator/click/trunk/click/extras/src/extras-controls.xml (original)
+++ incubator/click/trunk/click/extras/src/extras-controls.xml Sat Jun 20 13:30:21 2009
@@ -20,20 +20,6 @@
 <click-app>
 
   <controls>
-    <control classname="org.apache.click.extras.control.CheckList"/>
-    <control classname="org.apache.click.extras.control.CreditCardField"/>
-    <control classname="org.apache.click.extras.control.EmailField"/>
-    <control classname="org.apache.click.extras.control.IntegerField"/>
-    <control classname="org.apache.click.extras.control.PickList"/>
-    <control classname="org.apache.click.extras.control.Menu"/>
-    <control classname="org.apache.click.extras.control.RegexField"/>
-    <control classname="org.apache.click.extras.control.SubmitLink"/>
-    <control classname="org.apache.click.extras.control.TabbedForm"/>
-    <control classname="org.apache.click.extras.control.VirtualKeyboard"/>
-    <control classname="org.apache.click.extras.panel.ListPanel"/>
-    <control classname="org.apache.click.extras.panel.TabbedPanel"/>
-    <control classname="org.apache.click.extras.tree.CheckboxTree"/>
-    <control classname="org.apache.click.extras.tree.Tree"/>
   </controls>
 
 </click-app>

Modified: incubator/click/trunk/click/extras/src/org/apache/click/extras/cayenne/TabbedCayenneForm.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/extras/src/org/apache/click/extras/cayenne/TabbedCayenneForm.java?rev=786815&r1=786814&r2=786815&view=diff
==============================================================================
--- incubator/click/trunk/click/extras/src/org/apache/click/extras/cayenne/TabbedCayenneForm.java (original)
+++ incubator/click/trunk/click/extras/src/org/apache/click/extras/cayenne/TabbedCayenneForm.java Sat Jun 20 13:30:21 2009
@@ -23,8 +23,6 @@
 import java.util.List;
 import java.util.Map;
 
-import javax.servlet.ServletContext;
-
 import org.apache.click.control.Field;
 import org.apache.click.control.FieldSet;
 import org.apache.click.extras.control.TabbedForm;
@@ -34,13 +32,28 @@
 /**
  * Provides Cayenne data aware tabbed Form control: &nbsp; &lt;form method='POST'&gt;.
  * <p/>
- * This control provides t form capabilities to the standard CayenneForm.
+ * This control provides tab capabilities to the standard CayenneForm.
  * For more information and examples please see:
  * <ul>
  * <li>{@link CayenneForm}</li>
  * <li>{@link org.apache.click.extras.control.TabbedForm}</li>
  * </ul>
  *
+ * <a name="resources"></a>
+ * <h3>CSS and JavaScript resources</h3>
+ *
+ * In addition to <a href="../../../../../../click-api/org/apache/click/control/Form.html#resources">Form's resources</a>,
+ * the TabbedCayenneForm control makes use of the following resources (which Click
+ * automatically deploys to the application directory, <tt>/click</tt>):
+ *
+ * <ul>
+ * <li><tt>click/extras-control.css</tt></li>
+ * </ul>
+ *
+ * To import these TabbedCayenneForm files simply reference the variables
+ * <span class="blue">$headElements</span> and
+ * <span class="blue">$jsElements</span> in the page template.
+ *
  * <p>&nbsp;</p>
  *
  * @author Malcolm Edgar
@@ -159,13 +172,21 @@
     }
 
     /**
-     * Return the HTML head import statements for the CSS stylesheet file:
-     * <tt>click/TabbedForm.css</tt>.
+     * Return the TabbedCayenneForm HTML head imports statements for the
+     * following resources:
+     * <p/>
+     * <ul>
+     * <li><tt>click/extras-control.css</tt></li>
+     * </ul>
+     * <p/>
+     * Additionally all the {@link org.apache.click.control.Form#getHtmlImports()
+     * Form import statements} are also returned.
+     *
+     * @see org.apache.click.Control#getHtmlImports()
      *
-     * @return the HTML head import statements for the control stylesheet and
-     * JavaScript files
+     * @return the HTML head import statements for the control
      */
-    public String getHtmlImports() {
+     public String getHtmlImports() {
         HtmlStringBuffer buffer = new HtmlStringBuffer(512);
         buffer.append(super.getHtmlImports());
         buffer.append(ClickUtils.createHtmlImport(TabbedForm.HTML_IMPORTS, getContext()));
@@ -264,20 +285,6 @@
     // --------------------------------------------------------- Public Methods
 
     /**
-     * Deploy the <tt>table.css</tt> file to the <tt>click</tt> web
-     * directory when the application is initialized.
-     *
-     * @see org.apache.click.Control#onDeploy(ServletContext)
-     *
-     * @param servletContext the servlet context
-     */
-    public void onDeploy(ServletContext servletContext) {
-        ClickUtils.deployFile(servletContext,
-                              "/org/apache/click/extras/control/TabbedForm.css",
-                              "click");
-    }
-
-    /**
      * Process the Form request. In addition to the normal Form
      * <tt>onProcess()</tt> processing, if the Form is invalid this method
      * will display the tab sheet with the first field error.

Modified: incubator/click/trunk/click/extras/src/org/apache/click/extras/control/AutoCompleteTextField.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/extras/src/org/apache/click/extras/control/AutoCompleteTextField.java?rev=786815&r1=786814&r2=786815&view=diff
==============================================================================
--- incubator/click/trunk/click/extras/src/org/apache/click/extras/control/AutoCompleteTextField.java (original)
+++ incubator/click/trunk/click/extras/src/org/apache/click/extras/control/AutoCompleteTextField.java Sat Jun 20 13:30:21 2009
@@ -22,7 +22,6 @@
 import java.io.PrintWriter;
 import java.util.List;
 
-import javax.servlet.ServletContext;
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.click.Context;
@@ -58,9 +57,25 @@
  * };
  * form.add(nameField); </pre>
  *
- * <p>
- * This control uses the JavaScript 'script.aculo.us' <tt>Ajax.Autocompleter</tt> class.
- * </p>
+ * <a name="resources"></a>
+ * <h3>CSS and JavaScript resources</h3>
+ *
+ * AutoCompleteTextField depends on the <a class="external" target="_blank" href="http://www.prototypejs.org">Prototype</a>
+ * and <a class="external" target="_blank" href="http://script.aculo.us/">Scriptaculous/</a>
+ * JavaScript libraries to handle the auto-complete functionality. See
+ * <a class="external" target="_blank" href="http://wiki.github.com/madrobby/scriptaculous/ajax-autocompleter">Ajax.Autocompleter</a>
+ * for more details.
+ * <p/>
+ * The AutoCompleteTextField control makes use of the following resources
+ * (which Click automatically deploys to the application directory, <tt>/click</tt>):
+ *
+ * <ul>
+ * <li><tt>click/extras-control.css</tt></li>
+ * <li><tt>click/control.js</tt></li>
+ * <li><tt>click/prototype/prototype.js</tt></li>
+ * <li><tt>click/prototype/effects.js</tt></li>
+ * <li><tt>click/prototype/controls.js</tt></li>
+ * </ul>
  *
  * See also the W3C HTML reference:
  * <a class="external" target="_blank" title="W3C HTML 4.01 Specification"
@@ -74,13 +89,6 @@
 
     private static final long serialVersionUID = 1L;
 
-    /** The Prototype resource file names. */
-    static final String[] PROTOTYPE_RESOURCES = {
-        "/org/apache/click/extras/control/prototype/controls.js",
-        "/org/apache/click/extras/control/prototype/effects.js",
-        "/org/apache/click/extras/control/prototype/prototype.js",
-    };
-
     // ----------------------------------------------------- Instance Variables
 
     /**
@@ -236,9 +244,9 @@
     }
 
     /**
-     * Return the list of HEAD elements to be included in the page.
+     * Return the list of HEAD {@link org.apache.click.element.Element elements}
+     * (resources) to be included in the page. The resources are:
      * <p/>
-     * This list of resources returned are:
      * <ul>
      * <li>/click/extras-control.css</li>
      * <li>/click/control.js</li>
@@ -392,22 +400,6 @@
         return true;
     }
 
-    /**
-     * Deploys the controls static CSS and JavaScript resources.
-     *
-     * @see org.apache.click.control.Field#onDeploy(javax.servlet.ServletContext)
-     *
-     * @param servletContext the context
-     */
-    public void onDeploy(ServletContext servletContext) {
-        ClickUtils.deployFile(servletContext, "click/control.js", "click");
-        ClickUtils.deployFile(servletContext, "click/extras-control.css", "click");
-
-        ClickUtils.deployFiles(servletContext,
-                               PROTOTYPE_RESOURCES,
-                               "click/prototype");
-    }
-
     // ------------------------------------------------------ Protected Methods
 
     /**

Modified: incubator/click/trunk/click/extras/src/org/apache/click/extras/control/CheckList.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/extras/src/org/apache/click/extras/control/CheckList.java?rev=786815&r1=786814&r2=786815&view=diff
==============================================================================
--- incubator/click/trunk/click/extras/src/org/apache/click/extras/control/CheckList.java (original)
+++ incubator/click/trunk/click/extras/src/org/apache/click/extras/control/CheckList.java Sat Jun 20 13:30:21 2009
@@ -22,8 +22,6 @@
 import java.util.List;
 import java.util.Map;
 
-import javax.servlet.ServletContext;
-
 import org.apache.click.Context;
 import org.apache.click.control.Field;
 import org.apache.click.control.Option;
@@ -76,7 +74,7 @@
  * The selected values can be retrieved from {@link #getSelectedValues()}. The
  * get/setValue() property is not supported.
  * <p/>
- * The select uses the /click/checklist.css style. By providing a style which
+ * The select uses the /click/checklist/checklist.css style. By providing a style which
  * extends this style the appearance of the list can be changed.
  * <p/>
  * To set the additional style class use {@link #addStyleClass(String)}.
@@ -86,6 +84,28 @@
  * <p/>
  * For an example please look at the click-examples and the at the above blog.
  *
+ * <a name="resources"></a>
+ * <h3>CSS and JavaScript resources</h3>
+ *
+ * The CheckList control makes use of the following resources
+ * (which Click automatically deploys to the application directories,
+ * <tt>/click/checklist</tt> and <tt>/click/prototype</tt>):
+ *
+ * <ul>
+ * <li><tt>click/checklist/checklist.css</tt></li>
+ * <li><tt>click/checklist/checklist.js</tt></li>
+ * <li><tt>click/prototype/builder.js</tt></li>
+ * <li><tt>click/prototype/controls.js</tt></li>
+ * <li><tt>click/prototype/dragdrop.js</tt></li>
+ * <li><tt>click/prototype/effects.js</tt></li>
+ * <li><tt>click/prototype/prototype.js</tt></li>
+ * <li><tt>click/prototype/slider.js</tt></li>
+ * </ul>
+ *
+ * To import these CheckList files simply reference the variables
+ * <span class="blue">$headElements</span> and
+ * <span class="blue">$jsElements</span> in the page template.
+ *
  * @see org.apache.click.control.Option
  *
  * @author Christian Essl
@@ -96,23 +116,7 @@
 
     private static final long serialVersionUID = 1L;
 
-    /** The Checklist resource file names. */
-    static final String[] CHECKLIST_RESOURCES = {
-        "/org/apache/click/extras/control/checklist/checklist.css",
-        "/org/apache/click/extras/control/checklist/checklist.js"
-    };
-
-    /** The Prototype resource file names. */
-    static final String[] PROTOTYPE_RESOURCES = {
-        "/org/apache/click/extras/control/prototype/builder.js",
-        "/org/apache/click/extras/control/prototype/controls.js",
-        "/org/apache/click/extras/control/prototype/dragdrop.js",
-        "/org/apache/click/extras/control/prototype/effects.js",
-        "/org/apache/click/extras/control/prototype/prototype.js",
-        "/org/apache/click/extras/control/prototype/slider.js"
-    };
-
-    /** The HTML import statements. */
+    /** The CheckList import statements. */
     public static final String HTML_IMPORTS =
         "<link type=\"text/css\" rel=\"stylesheet\" href=\"{0}/click/checklist/checklist{1}.css\"/>\n"
         + "<script type=\"text/javascript\" src=\"{0}/click/checklist/checklist{1}.js\"></script>\n";
@@ -472,12 +476,23 @@
     }
 
     /**
-     * Returns the CSS and JavaScript imports and adds the script the checklist
-     * onload event.
+     * Return the CheckList HTML head imports statements for the following
+     * resources:
+     * <p/>
+     * <ul>
+     * <li><tt>click/checklist/checklist.css</tt></li>
+     * <li><tt>click/checklist/checklist.js</tt></li>
+     * <li><tt>click/prototype/builder.js</tt></li>
+     * <li><tt>click/prototype/controls.js</tt></li>
+     * <li><tt>click/prototype/dragdrop.js</tt></li>
+     * <li><tt>click/prototype/effects.js</tt></li>
+     * <li><tt>click/prototype/prototype.js</tt></li>
+     * <li><tt>click/prototype/slider.js</tt></li>
+     * </ul>
      *
-     * @see org.apache.click.control.Field#getHtmlImports()
+     * @see org.apache.click.Control#getHtmlImports()
      *
-     * @return the two import tags
+     * @return the HTML head import statements for the control
      */
     public String getHtmlImports() {
         Context context = getContext();
@@ -763,23 +778,6 @@
     }
 
     /**
-     * Deploys the style-sheet 'checklist.css' to the /click directory.
-     *
-     * @see org.apache.click.control.Field#onDeploy(javax.servlet.ServletContext)
-     *
-     * @param servletContext the context
-     */
-    public void onDeploy(ServletContext servletContext) {
-        ClickUtils.deployFiles(servletContext,
-                               CHECKLIST_RESOURCES,
-                               "click/checklist");
-
-        ClickUtils.deployFiles(servletContext,
-                               PROTOTYPE_RESOURCES,
-                               "click/prototype");
-    }
-
-    /**
      * @see org.apache.click.control.AbstractControl#getControlSizeEst()
      *
      * @return the estimated rendered control size in characters

Modified: incubator/click/trunk/click/extras/src/org/apache/click/extras/control/ColorPicker.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/extras/src/org/apache/click/extras/control/ColorPicker.java?rev=786815&r1=786814&r2=786815&view=diff
==============================================================================
--- incubator/click/trunk/click/extras/src/org/apache/click/extras/control/ColorPicker.java (original)
+++ incubator/click/trunk/click/extras/src/org/apache/click/extras/control/ColorPicker.java Sat Jun 20 13:30:21 2009
@@ -44,11 +44,26 @@
  * The ColorPicker control will validate wheter the entered color is present (if required) and that it
  * is a valid hex color either in 3-digit presentation (ie #EEE) or 6-digit presentation (ie #EEEEEE).
  * If the color is not required the color-picker popup will show a button for 'no-color' on the top-left.
+ *
+ * <a name="resources"></a>
+ * <h3>CSS and JavaScript resources</h3>
+ *
+ * ColorPicker depends on the <a class="external" target="_blank" href="http://www.prototypejs.org">Prototype</a>
+ * JavaScript library.
  * <p/>
- * The color picker popup is based on JS script code from
- * <a target="_blank" href="http://www.dhtmlgoodies.com/index.html?whichScript=submitted-color-picker">www.dhtmlgoodies.com</a>.
- * To enable the color popup, reference the variables <span class="blue">$headElements</span>
- * and <span class="blue">$jsElements</span> in the page template. For example:
+ * The ColorPicker control makes use of the following resources
+ * (which Click automatically deploys to the application directories,
+ * <tt>/click/colorpicker</tt> and <tt>/click/prototype</tt>):
+ *
+ * <ul>
+ * <li><tt>click/colorpicker/colorpicker.css</tt></li>
+ * <li><tt>click/prototype/prototype.js</tt></li>
+ * <li><tt>click/colorpicker/colorpicker.js</tt></li>
+ * </ul>
+ *
+ * To import these ColorPicker files simply reference the variables
+ * <span class="blue">$headElements</span> and
+ * <span class="blue">$jsElements</span> in the page template. For example:
  *
  * <pre class="codeHtml">
  * &lt;html&gt;
@@ -63,6 +78,11 @@
  * &lt;/body&gt;
  * &lt;/html&gt; </pre>
  *
+ * <h4>Credits</h4>
+ *
+ * The color picker popup is based on JS script code from
+ * <a target="_blank" href="http://www.dhtmlgoodies.com/index.html?whichScript=submitted-color-picker">www.dhtmlgoodies.com</a>.
+ *
  * @author Christian Essl
  */
 public class ColorPicker extends Field {
@@ -71,7 +91,7 @@
 
     private static final long serialVersionUID = 1L;
 
-    /** The HTML imports statements. */
+    /** The ColorPicker imports statements. */
     static final String HTML_IMPORTS =
         "<link type=\"text/css\" rel=\"stylesheet\" href=\"{0}/click/colorpicker/colorpicker{1}.css\"/>\n"
         + "<script type=\"text/javascript\" src=\"{0}/click/prototype/prototype{1}.js\"></script>\n"
@@ -170,14 +190,18 @@
     // ------------------------------------------------------ Public Attributes
 
     /**
-     * Return the HTML head import statements for the JavaScript and CSS files
-     * <tt>click/colorpicker/colorpicker.css</tt>
-     * <tt>click/prototype/prototype.js</tt>) and
-     * <tt>click/colorpicker/colorpicker.js</tt>.
+     * Return the ColorPicker HTML head imports statements for the following
+     * resources:
+     * <p/>
+     * <ul>
+     * <li><tt>click/colorpicker/colorpicker.css</tt></li>
+     * <li><tt>click/prototype/prototype.js</tt></li>
+     * <li><tt>click/colorpicker/colorpicker.js</tt></li>
+     * </ul>
      *
-     * @see org.apache.click.control.Field#getHtmlImports()
+     * @see org.apache.click.Control#getHtmlImports()
      *
-     * @return the HTML head import statements for prototype.js and colorpicker.js
+     * @return the HTML head import statements for the control
      */
     public String getHtmlImports() {
         return ClickUtils.createHtmlImport(HTML_IMPORTS, getContext());

Modified: incubator/click/trunk/click/extras/src/org/apache/click/extras/control/CreditCardField.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/extras/src/org/apache/click/extras/control/CreditCardField.java?rev=786815&r1=786814&r2=786815&view=diff
==============================================================================
--- incubator/click/trunk/click/extras/src/org/apache/click/extras/control/CreditCardField.java (original)
+++ incubator/click/trunk/click/extras/src/org/apache/click/extras/control/CreditCardField.java Sat Jun 20 13:30:21 2009
@@ -22,8 +22,6 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import javax.servlet.ServletContext;
-
 import org.apache.click.control.Option;
 import org.apache.click.control.Select;
 import org.apache.click.control.TextField;
@@ -46,7 +44,17 @@
  * when the control is processed.
  * <p/>
  * Supported card include VISA, MASTER, AMEX, DINERS and DISCOVER.
- * <p/>
+ *
+ * <a name="resources"></a>
+ * <h3>CSS and JavaScript resources</h3>
+ *
+ * The CreditCardField control makes use of the following resources
+ * (which Click automatically deploys to the application directory, <tt>/click</tt>):
+ *
+ * <ul>
+ * <li><tt>click/extras-control.js</tt></li>
+ * </ul>
+ *
  * The CreditCardField uses a JavaScript onkeypress() integerFilter() method to
  * prevent users from entering invalid characters. To enable number key filtering
  * reference the variables <span class="blue">$headElements</span> and
@@ -286,9 +294,16 @@
     }
 
     /**
-     * Return the HTML head import statements for the CreditCardField.js.
+     * Return the CreditCardField HTML head imports statements for the following
+     * resources:
+     * <p/>
+     * <ul>
+     * <li><tt>click/extras-control.js</tt></li>
+     * </ul>
      *
-     * @return the HTML head import statements for the CreditCardField.js
+     * @see org.apache.click.Control#getHtmlImports()
+     *
+     * @return the HTML head import statements for the control
      */
     public String getHtmlImports() {
         return ClickUtils.createHtmlImport(HTML_IMPORTS, getContext());
@@ -444,19 +459,4 @@
             }
         }
     }
-
-    /**
-     * Deploy the <tt>extras-control.js</tt> file to the <tt>click</tt> web
-     * directory when the application is initialized.
-     *
-     * @see org.apache.click.Control#onDeploy(ServletContext)
-     *
-     * @param servletContext the servlet context
-     */
-    public void onDeploy(ServletContext servletContext) {
-        ClickUtils.deployFile(servletContext,
-                              "/org/apache/click/extras/control/extras-control.js",
-                              "click");
-    }
-
 }

Modified: incubator/click/trunk/click/extras/src/org/apache/click/extras/control/DateField.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/extras/src/org/apache/click/extras/control/DateField.java?rev=786815&r1=786814&r2=786815&view=diff
==============================================================================
--- incubator/click/trunk/click/extras/src/org/apache/click/extras/control/DateField.java (original)
+++ incubator/click/trunk/click/extras/src/org/apache/click/extras/control/DateField.java Sat Jun 20 13:30:21 2009
@@ -69,7 +69,9 @@
  *     }
  * } </pre>
  *
- * <p/>
+ * <a name="resources"></a>
+ * <h3>CSS and JavaScript resources</h3>
+ *
  * The Calendar popup is provided by the <a target="_blank" class="external" href="http//www.prototypejs.org">Prototype</a>
  * based <a target="_blank" class="external" href="http://code.google.com/p/calendardateselect/">CalendarDateSelect</a>
  * library.
@@ -84,6 +86,17 @@
  * {@link #setShowCalendar(boolean)} to false. No JavaScript and CSS will be
  * included when this option is false.
  * <p/>
+ * The DateFielld control makes use of the following resources
+ * (which Click automatically deploys to the application directories,
+ * <tt>/click/calendar</tt> and <tt>/click/prototype</tt>):
+ *
+ * <ul>
+ * <li><tt>click/calendar/{style}.css</tt> - where {style} is a specific Calendar style e.g. <tt>default</tt>, <tt>red</tt>, <tt>blue</tt> etc.</li>
+ * <li><tt>click/prototype/prototype.js</tt></li>
+ * <li><tt>click/calendar/calendar_date_select.js</tt></li>
+ * <li><tt>click/calendar/{lang}.js</tt> - where {lang} is the language specified by the browser e.g. <tt>fr</tt> (French), <tt>de</tt> (German) etc.</li>
+ * </ul>
+ *
  * The Calendar popup is created as a &lt;div&gt; element using JavaScript.
  * To enable the Calendar popup, reference <span class="blue">$headElements</span>
  * and <span class="blue">$jsElements</span> in the page template. For example:
@@ -94,10 +107,15 @@
  * <span class="blue">$headElements</span>
  * &lt;/head&gt;
  * &lt;body&gt;
+ *
  * <span class="red">$form</span>
+ *
+ * <span class="blue">$jsElements</span>
  * &lt;/body&gt;
- * &lt;/html&gt;
- * <span class="blue">$jsElements</span> </pre>
+ * &lt;/html&gt; </pre>
+ *
+ * <a name="styles"></a>
+ * <h3>Calendar Styles</h3>
  *
  * The default Calendar style is 'default' which has a gray theme.
  * The Calendar styles include:
@@ -109,9 +127,6 @@
  * <li>silver</li>
  * </ul>
  *
- * The DateField JavaScript, CSS and image resources are automatically deployed
- * to the <tt>click/calendar</tt> web directory on application startup.
- *
  * See also W3C HTML reference
  * <a class="external" target="_blank" title="W3C HTML 4.01 Specification"
  *    href="http://www.w3.org/TR/html401/interact/forms.html#h-17.4">INPUT</a>
@@ -513,26 +528,33 @@
     }
 
     /**
-     * Return the DateField <tt>calendar.js</tt> and <tt>calendar-{lang}.js</tt>
-     * includes.
+     * This method returns null.
+     *
+     * @see #getHeadElements()
      *
-     * @return the HTML head import statements for the control stylesheet and
-     * JavaScript files
+     * @return the HTML head import statements for the control
      */
     public String getHtmlImports() {
         return null;
     }
 
     /**
-     * Return the CalendarField <tt>prototype.js</tt>,
-     * <tt>calendar_date_select.js</tt>, <tt>{lang}.js</tt>
-     * and <tt>{style}.css</tt> includes.
-     * <p/>
+     * Return the DateField HTML head imports statements for the following
+     * resources:
+     *
+     * <ul>
+     * <li><tt>click/calendar/{style}.css</tt> - where {style} is a specific Calendar style e.g. <tt>default</tt>, <tt>red</tt>, <tt>blue</tt> etc.</li>
+     * <li><tt>click/prototype/prototype.js</tt></li>
+     * <li><tt>click/calendar/calendar_date_select.js</tt></li>
+     * <li><tt>click/calendar/{lang}.js</tt> - where {lang} is the language specified by the browser e.g. <tt>fr</tt> (French), <tt>de</tt> (German) etc.</li>
+     * </ul>
+     *
      * This method delegates to {@link #addCalendarOptions(java.util.List)} to
      * include the Calendar Options script.
      *
-     * @return the HTML head import statements for the control stylesheet and
-     * JavaScript files
+     * @see org.apache.click.Control#getHtmlImports()
+     *
+     * @return the HTML head import statements for the control
      */
     public List getHeadElements() {
         // CLK-309. Skip imports if dateField is disabled, readonly or calendar

Modified: incubator/click/trunk/click/extras/src/org/apache/click/extras/control/EmailField.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/extras/src/org/apache/click/extras/control/EmailField.java?rev=786815&r1=786814&r2=786815&view=diff
==============================================================================
--- incubator/click/trunk/click/extras/src/org/apache/click/extras/control/EmailField.java (original)
+++ incubator/click/trunk/click/extras/src/org/apache/click/extras/control/EmailField.java Sat Jun 20 13:30:21 2009
@@ -20,8 +20,6 @@
 
 import java.text.MessageFormat;
 
-import javax.servlet.ServletContext;
-
 import org.apache.click.control.TextField;
 import org.apache.click.util.ClickUtils;
 
@@ -37,7 +35,22 @@
  *
  * EmailField will validate the email when the control is processed and invoke
  * the control listener if defined.
+ *
+ * <a name="resources"></a>
+ * <h3>CSS and JavaScript resources</h3>
+ *
+ * The EmailField control makes use of the following resources
+ * (which Click automatically deploys to the application directory, <tt>/click</tt>):
+ *
+ * <ul>
+ * <li><tt>click/extras-control.js</tt></li>
+ * </ul>
+ *
+ * To import this EmailField file simply reference the variables
+ * <span class="blue">$headElements</span> and
+ * <span class="blue">$jsElements</span> in the page template.
  * <p/>
+ *
  * See also W3C HTML reference
  * <a class="external" target="_blank" title="W3C HTML 4.01 Specification"
  *    href="http://www.w3.org/TR/html401/interact/forms.html#h-17.4">INPUT</a>
@@ -167,12 +180,16 @@
     // ------------------------------------------------------ Public Attributes
 
     /**
-     * Return the HTML head import statements for the JavaScript
-     * (<tt>click/extras-control.js</tt>) file.
+     * Return the EmailField HTML head imports statements for the following
+     * resources:
+     * <p/>
+     * <ul>
+     * <li><tt>click/extras-control.js</tt></li>
+     * </ul>
      *
      * @see org.apache.click.Control#getHtmlImports()
      *
-     * @return the HTML head import statements for the JavaScript file
+     * @return the HTML head import statements for the control
      */
     public String getHtmlImports() {
         return ClickUtils.createHtmlImport(HTML_IMPORTS, getContext());
@@ -206,20 +223,6 @@
     // --------------------------------------------------------- Public Methods
 
     /**
-     * Deploy the <tt>extras-control.js</tt> file to the <tt>click</tt> web
-     * directory when the application is initialized.
-     *
-     * @see org.apache.click.Control#onDeploy(ServletContext)
-     *
-     * @param servletContext the servlet context
-     */
-    public void onDeploy(ServletContext servletContext) {
-        ClickUtils.deployFile(servletContext,
-                              "/org/apache/click/extras/control/extras-control.js",
-                              "click");
-    }
-
-    /**
      * Process the EmailField request submission.
      * <p/>
      * A field error message is displayed if a validation error occurs.

Modified: incubator/click/trunk/click/extras/src/org/apache/click/extras/control/Menu.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/extras/src/org/apache/click/extras/control/Menu.java?rev=786815&r1=786814&r2=786815&view=diff
==============================================================================
--- incubator/click/trunk/click/extras/src/org/apache/click/extras/control/Menu.java (original)
+++ incubator/click/trunk/click/extras/src/org/apache/click/extras/control/Menu.java Sat Jun 20 13:30:21 2009
@@ -178,6 +178,21 @@
  *     &lt;!ATTLIST <span class="red">menu</span> <span class="st">roles</span> CDATA #IMPLIED&gt;
  *     &lt;!ATTLIST <span class="red">menu</span> <span class="st">pages</span> CDATA #IMPLIED&gt; </pre>
  *
+ * <a name="resources"></a>
+ * <h3>CSS and JavaScript resources</h3>
+ *
+ * The Menu control makes use of the following resources
+ * (which Click automatically deploys to the application directory, <tt>/click</tt>):
+ *
+ * <ul>
+ * <li><tt>click/menu.css</tt></li>
+ * <li><tt>click/extras-control.js</tt></li>
+ * </ul>
+ *
+ * To import these Menu files simply reference the variables
+ * <span class="blue">$headElements</span> and
+ * <span class="blue">$jsElements</span> in the page template.
+ *
  * @see org.apache.click.extras.security.AccessController
  *
  * @author Malcolm Edgar
@@ -193,7 +208,7 @@
      */
     protected static final String DEFAULT_CONFIG_FILE = "/WEB-INF/menu.xml";
 
-    /** The HTML imports statements. */
+    /** The Menu imports statements. */
     public static final String HTML_IMPORTS =
         "<link type=\"text/css\" rel=\"stylesheet\" href=\"{0}/click/menu{1}.css\"/>\n"
         + "<script type=\"text/javascript\" src=\"{0}/click/control{1}.js\"></script>\n"
@@ -666,13 +681,17 @@
     }
 
     /**
-     * Return the HTML head import statements for the CSS stylesheet
-     * (<tt>click/menu.css</tt>) and JavaScript (<tt>click/extras-control.js</tt>) files.
+     * Return the Menu HTML head imports statements for the following
+     * resources:
+     * <p/>
+     * <ul>
+     * <li><tt>click/menu.css</tt></li>
+     * <li><tt>click/extras-control.js</tt></li>
+     * </ul>
      *
      * @see org.apache.click.Control#getHtmlImports()
      *
-     * @return the HTML head import statements for the control stylesheet and
-     * JavaScript files
+     * @return the HTML head import statements for the control
      */
     public String getHtmlImports() {
         return ClickUtils.createHtmlImport(HTML_IMPORTS, getContext());
@@ -718,23 +737,6 @@
     // --------------------------------------------------------- Public Methods
 
     /**
-     * Deploy the <tt>menu.css</tt> and <tt>menu.js</tt> files to the
-     * <tt>click</tt> web directory when the application is initialized.
-     *
-     * @see org.apache.click.Control#onDeploy(ServletContext)
-     *
-     * @param servletContext the servlet context
-     */
-    public void onDeploy(ServletContext servletContext) {
-        String[] files = new String[] {
-                "/org/apache/click/extras/control/menu.css",
-                "/org/apache/click/extras/control/extras-control.js"
-            };
-
-        ClickUtils.deployFiles(servletContext, files, "click");
-    }
-
-    /**
      * This sets the parent to be null.
      *
      * @see org.apache.click.Control#onDestroy()

Modified: incubator/click/trunk/click/extras/src/org/apache/click/extras/control/NumberField.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/extras/src/org/apache/click/extras/control/NumberField.java?rev=786815&r1=786814&r2=786815&view=diff
==============================================================================
--- incubator/click/trunk/click/extras/src/org/apache/click/extras/control/NumberField.java (original)
+++ incubator/click/trunk/click/extras/src/org/apache/click/extras/control/NumberField.java Sat Jun 20 13:30:21 2009
@@ -19,8 +19,6 @@
 import java.text.ParseException;
 import java.util.Locale;
 
-import javax.servlet.ServletContext;
-
 import org.apache.click.control.TextField;
 import org.apache.click.util.ClickUtils;
 
@@ -56,7 +54,17 @@
  * is also set to the formated number. The number returned from
  * {@link #getNumber()} is then the formatted number. It is not the orginal Number
  * passed in. To circumvent formatting use setValue().
- * <p/>
+ *
+ * <a name="resources"></a>
+ * <h3>CSS and JavaScript resources</h3>
+ *
+ * The NumberField control makes use of the following resources
+ * (which Click automatically deploys to the application directory, <tt>/click</tt>):
+ *
+ * <ul>
+ * <li><tt>click/extras-control.js</tt></li>
+ * </ul>
+ *
  * The NumberField uses a JavaScript onkeypress() doubleFilter() method to prevent
  * users from entering invalid characters.  To enable number key filtering
  * reference the variables <tt class="blue">$jsElements</tt> and
@@ -115,7 +123,7 @@
         + "   '}'\n"
         + "'}'\n";
 
-    /** The NumberField.js imports statement. */
+    /** The NumberField imports statement. */
     public static final String HTML_IMPORTS =
         "<script type=\"text/javascript\" src=\"{0}/click/extras-control{1}.js\"></script>\n";
 
@@ -393,12 +401,16 @@
     }
 
     /**
-     * Return the HTML head import statements for the JavaScript
-     * (<tt>click/extras-control.js</tt>) file.
+     * Return the NumberField HTML head imports statements for the following
+     * resources:
+     * <p/>
+     * <ul>
+     * <li><tt>click/extras-control.js</tt></li>
+     * </ul>
      *
      * @see org.apache.click.Control#getHtmlImports()
      *
-     * @return the HTML head import statements for the JavaScript file
+     * @return the HTML head import statements for the control
      */
     public String getHtmlImports() {
         return ClickUtils.createHtmlImport(HTML_IMPORTS, getContext());
@@ -431,20 +443,6 @@
     // --------------------------------------------------------- Public Methods
 
     /**
-     * Deploy the <tt>extras-control.js</tt> file to the <tt>click</tt> web
-     * directory when the application is initialized.
-     *
-     * @see org.apache.click.Control#onDeploy(ServletContext)
-     *
-     * @param servletContext the servlet context
-     */
-    public void onDeploy(ServletContext servletContext) {
-        ClickUtils.deployFile(servletContext,
-                              "/org/apache/click/extras/control/extras-control.js",
-                              "click");
-    }
-
-    /**
      * Validates the NumberField request submission. If the value entered
      * by the user can be parsed by the NumberFormat the string value
      * of this Field ({@link org.apache.click.control.Field#getValue()}) is

Modified: incubator/click/trunk/click/extras/src/org/apache/click/extras/control/PickList.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/extras/src/org/apache/click/extras/control/PickList.java?rev=786815&r1=786814&r2=786815&view=diff
==============================================================================
--- incubator/click/trunk/click/extras/src/org/apache/click/extras/control/PickList.java (original)
+++ incubator/click/trunk/click/extras/src/org/apache/click/extras/control/PickList.java Sat Jun 20 13:30:21 2009
@@ -26,8 +26,6 @@
 import java.util.List;
 import java.util.Map;
 
-import javax.servlet.ServletContext;
-
 import org.apache.click.control.Field;
 import org.apache.click.control.Option;
 import org.apache.click.util.ClickUtils;
@@ -95,6 +93,20 @@
  *     ...
  * } </pre>
  *
+ * <a name="resources"></a>
+ * <h3>CSS and JavaScript resources</h3>
+ *
+ * The PickList control makes use of the following resources
+ * (which Click automatically deploys to the application directory, <tt>/click</tt>):
+ *
+ * <ul>
+ * <li><tt>click/extras-control.js</tt></li>
+ * </ul>
+ *
+ * To import these CheckList files simply reference the variables
+ * <span class="blue">$headElements</span> and
+ * <span class="blue">$jsElements</span> in the page template.
+ *
  * @author Naoki Takezoe
  */
 public class PickList extends Field {
@@ -103,7 +115,7 @@
 
     // -------------------------------------------------------------- Constants
 
-    /** The <tt>Palette.js</tt> imports statement. */
+    /** The PickList imports statement. */
     public static final String HTML_IMPORTS =
         "<script type=\"text/javascript\" src=\"{0}/click/extras-control{1}.js\"></script>\n";
 
@@ -368,12 +380,16 @@
     }
 
     /**
-     * Return the HTML head import statements for the JavaScript
-     * (<tt>click/extras-control.js</tt>) file.
+     * Return the PickList HTML head imports statements for the following
+     * resources:
+     * <p/>
+     * <ul>
+     * <li><tt>click/extras-control.js</tt></li>
+     * </ul>
      *
      * @see org.apache.click.Control#getHtmlImports()
      *
-     * @return the HTML head import statements for the JavaScript file
+     * @return the HTML head import statements for the control
      */
     public String getHtmlImports() {
         return ClickUtils.createHtmlImport(HTML_IMPORTS, getContext());
@@ -585,20 +601,6 @@
     }
 
     /**
-     * Deploy the <tt>extras-control.js</tt> file to the <tt>click</tt> web
-     * directory when the application is initialized.
-     *
-     * @see org.apache.click.Control#onDeploy(ServletContext)
-     *
-     * @param servletContext the servlet context
-     */
-    public void onDeploy(ServletContext servletContext) {
-        ClickUtils.deployFile(servletContext,
-                              "/org/apache/click/extras/control/extras-control.js",
-                              "click");
-    }
-
-    /**
      * Validate the PickList request submission.
      * <p/>
      * A field error message is displayed if a validation error occurs.

Modified: incubator/click/trunk/click/extras/src/org/apache/click/extras/control/RegexField.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/extras/src/org/apache/click/extras/control/RegexField.java?rev=786815&r1=786814&r2=786815&view=diff
==============================================================================
--- incubator/click/trunk/click/extras/src/org/apache/click/extras/control/RegexField.java (original)
+++ incubator/click/trunk/click/extras/src/org/apache/click/extras/control/RegexField.java Sat Jun 20 13:30:21 2009
@@ -21,8 +21,6 @@
 import java.text.MessageFormat;
 import java.util.regex.Pattern;
 
-import javax.servlet.ServletContext;
-
 import org.apache.click.control.TextField;
 import org.apache.click.util.ClickUtils;
 
@@ -61,7 +59,22 @@
  * expression pattern a
  * <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/util/regex/PatternSyntaxException.html">PatternSyntaxException</a>
  * will be thrown by the {@link #onProcess()} method.
- * <p>
+ *
+ * <a name="resources"></a>
+ * <h3>CSS and JavaScript resources</h3>
+ *
+ * The RegexField control makes use of the following resources
+ * (which Click automatically deploys to the application directory, <tt>/click</tt>):
+ *
+ * <ul>
+ * <li><tt>click/extras-control.js</tt></li>
+ * </ul>
+ *
+ * To import these RegexField files simply reference the variables
+ * <span class="blue">$headElements</span> and
+ * <span class="blue">$jsElements</span> in the page template.
+ * <p/>
+ *
  * See also the W3C HTML reference:
  * <a class="external" target="_blank" title="W3C HTML 4.01 Specification"
  *    href="http://www.w3.org/TR/html401/interact/forms.html#h-17.4">INPUT</a>
@@ -99,7 +112,7 @@
         + "   '}'\n"
         + "'}'\n";
 
-    /** The RegexField.js imports statement. */
+    /** The RegexField imports statement. */
     public static final String HTML_IMPORTS =
         "<script type=\"text/javascript\" src=\"{0}/click/extras-control{1}.js\"></script>\n";
 
@@ -209,12 +222,15 @@
     }
 
     /**
-     * Return the HTML head import statements for the JavaScript
-     * (<tt>click/extras-control.js</tt>) file.
+     * Return the RegexField HTML head imports statements for the following
+     * resources:
+     * <ul>
+     * <li><tt>click/extras-control.js</tt></li>
+     * </ul>
      *
      * @see org.apache.click.Control#getHtmlImports()
      *
-     * @return the HTML head import statements for the JavaScript file
+     * @return the HTML head import statements for the control
      */
     public String getHtmlImports() {
         return ClickUtils.createHtmlImport(HTML_IMPORTS, getContext());
@@ -286,20 +302,6 @@
         }
     }
 
-    /**
-     * Deploy the <tt>extras-control.js</tt> file to the <tt>click</tt> web
-     * directory when the application is initialized.
-     *
-     * @see org.apache.click.Control#onDeploy(ServletContext)
-     *
-     * @param servletContext the servlet context
-     */
-    public void onDeploy(ServletContext servletContext) {
-        ClickUtils.deployFile(servletContext,
-                              "/org/apache/click/extras/control/extras-control.js",
-                              "click");
-    }
-
     // ------------------------------------------------------ Private Methods
 
     /**

Modified: incubator/click/trunk/click/extras/src/org/apache/click/extras/control/SubmitLink.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/extras/src/org/apache/click/extras/control/SubmitLink.java?rev=786815&r1=786814&r2=786815&view=diff
==============================================================================
--- incubator/click/trunk/click/extras/src/org/apache/click/extras/control/SubmitLink.java (original)
+++ incubator/click/trunk/click/extras/src/org/apache/click/extras/control/SubmitLink.java Sat Jun 20 13:30:21 2009
@@ -21,7 +21,6 @@
 import java.util.Enumeration;
 import java.util.Iterator;
 import java.util.List;
-import javax.servlet.ServletContext;
 import javax.servlet.http.HttpServletRequest;
 import org.apache.click.Context;
 import org.apache.click.control.ActionLink;
@@ -92,9 +91,12 @@
  *     }
  * } </pre>
  *
- * <h3>JavaScript and CSS Dependencies</h3>
+ * <a name="resources"></a>
+ * <h3>CSS and JavaScript resources</h3>
+ *
+ * When SubmitLink is added to a Form it makes use of the following resources
+ * (which Click automatically deploys to the application directory, <tt>/click</tt>):
  *
- * When SubmitLink is added to a Form it will include the following resources:
  * <ul>
  * <li>/click/extras-control.js</li>
  * </ul>
@@ -437,11 +439,10 @@
 
     /**
      * Return the list of HEAD {@link org.apache.click.element.Element elements}
-     * to be included in the page.
+     * to be included in the page. The list of resources are:
      * <p/>
-     * The list of resources returned are:
      * <ul>
-     * <li>the template "/click/extras-control.js"</li>
+     * <li>click/extras-control.js</li>
      * </ul>
      *
      * @return the list of HEAD elements to be included in the page
@@ -480,20 +481,6 @@
         super.render(buffer);
     }
 
-    /**
-     * Deploy the <tt>extras-control.js</tt> file to the <tt>click</tt> web
-     * directory when the application is initialized.
-     *
-     * @see org.apache.click.Control#onDeploy(ServletContext)
-     *
-     * @param servletContext the servlet context
-     */
-    public void onDeploy(ServletContext servletContext) {
-        ClickUtils.deployFile(servletContext,
-                              "/org/apache/click/extras/control/extras-control.js",
-                              "click");
-    }
-
     // -------------------------------------------------------- Private Methods
 
     /**

Modified: incubator/click/trunk/click/extras/src/org/apache/click/extras/control/TabbedForm.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/extras/src/org/apache/click/extras/control/TabbedForm.java?rev=786815&r1=786814&r2=786815&view=diff
==============================================================================
--- incubator/click/trunk/click/extras/src/org/apache/click/extras/control/TabbedForm.java (original)
+++ incubator/click/trunk/click/extras/src/org/apache/click/extras/control/TabbedForm.java Sat Jun 20 13:30:21 2009
@@ -23,8 +23,6 @@
 import java.util.List;
 import java.util.Map;
 
-import javax.servlet.ServletContext;
-
 import org.apache.click.control.Field;
 import org.apache.click.control.FieldSet;
 import org.apache.click.control.Form;
@@ -55,50 +53,50 @@
  * and "Payment Details" tab sheets, is provided below. Note how tabsheets
  * are created with {@link FieldSet} control which are added to the form.
  *
- * <pre class="codeJava">
- * <span class="kw">public</span> DeliveryDetailsEditor() {
+ * <pre class="prettyprint">
+ * public DeliveryDetailsEditor() {
  *
- *     form.setBackgroundColor(<span class="st">"#F7FFAF"</span>);
- *     form.setTabHeight(<span class="st">"210px"</span>);
- *     form.setTabWidth(<span class="st">"420px"</span>);
+ *     form.setBackgroundColor("#F7FFAF");
+ *     form.setTabHeight("210px");
+ *     form.setTabWidth("420px");
  *
- *     <span class="green">// Contact tab sheet</span>
+ *     // Contact tab sheet
  *
- *     FieldSet contactTabSheet = <span class="kw">new</span> FieldSet(<span class="st">"contactDetails"</span>);
+ *     FieldSet contactTabSheet = new FieldSet("contactDetails");
  *     form.addTabSheet(contactTabSheet);
  *
- *     contactTabSheet.add(<span class="kw">new</span> TitleSelect(<span class="st">"title"</span>));
- *     contactTabSheet.add(<span class="kw">new</span> TextField(<span class="st">"firstName"</span>));
- *     contactTabSheet.add(<span class="kw">new</span> TextField(<span class="st">"middleNames"</span>));
- *     contactTabSheet.add(<span class="kw">new</span> TextField(<span class="st">"surname"</span>, <span class="kw">true</span>));
+ *     contactTabSheet.add(new TitleSelect("title"));
+ *     contactTabSheet.add(new TextField("firstName"));
+ *     contactTabSheet.add(new TextField("middleNames"));
+ *     contactTabSheet.add(new TextField("surname", true));
  *     contactTabSheet.add(contactNumber);
- *     contactTabSheet.add(<span class="kw">new</span> EmailField(<span class="st">"email"</span>));
+ *     contactTabSheet.add(new EmailField("email"));
  *
- *     <span class="green">// Delivery tab sheet</span>
+ *     // Delivery tab sheet
  *
- *     FieldSet deliveryTabSheet = <span class="kw">new</span> FieldSet("deliveryDetails");
+ *     FieldSet deliveryTabSheet = new FieldSet("deliveryDetails");
  *     form.addTabSheet(deliveryTabSheet);
  *
- *     TextArea textArea = <span class="kw">new</span> TextArea(<span class="st">"deliveryAddress"</span>, <span class="kw">true</span>);
+ *     TextArea textArea = new TextArea("deliveryAddress", true);
  *     textArea.setCols(30);
  *     textArea.setRows(3);
  *     deliveryTabSheet.add(textArea);
  *
- *     deliveryTabSheet.add(<span class="kw">new</span> DateField(<span class="st">"deliveryDate"</span>));
+ *     deliveryTabSheet.add(new DateField("deliveryDate"));
  *
- *     PackagingRadioGroup packaging = <span class="kw">new</span> PackagingRadioGroup(<span class="st">"packaging"</span>);
- *     packaging.setValue(<span class="st">"STD"</span>);
+ *     PackagingRadioGroup packaging = new PackagingRadioGroup("packaging");
+ *     packaging.setValue("STD");
  *     deliveryTabSheet.add(packaging);
  *
  *     deliveryTabSheet.add(telephoneOnDelivery);
  *
- *     <span class="green">// Payment tab sheet</span>
+ *     // Payment tab sheet
  *
- *     FieldSet paymentTabSheet = <span class="kw">new</span> FieldSet(<span class="st">"paymentDetails"</span>);
+ *     FieldSet paymentTabSheet = new FieldSet("paymentDetails");
  *     form.addTabSheet(paymentTabSheet);
  *
- *     paymentGroup.add(<span class="kw">new</span> Radio(<span class="st">"cod"</span>, <span class="st">"Cash On Delivery"</span>));
- *     paymentGroup.add(<span class="kw">new</span> Radio(<span class="st">"credit"</span>, <span class="st">"Credit Card"</span>));
+ *     paymentGroup.add(new Radio("cod", "Cash On Delivery"));
+ *     paymentGroup.add(new Radio("credit", "Credit Card"));
  *     paymentGroup.setVerticalLayout(false);
  *     paymentTabSheet.add(paymentGroup);
  *
@@ -108,14 +106,29 @@
  *     expiry.setSize(4);
  *     expiry.setMaxLength(4);
  *
- *     <span class="green">// Buttons</span>
+ *     // Buttons
  *
- *     form.add(<span class="kw">new</span> Submit(<span class="st">"ok"</span>, <span class="st">"   OK   "</span>,  <span class="kw">this</span>, <span class="st">"onOkClick"</span>));
- *     form.add(<span class="kw">new</span> Submit(<span class="st">"cancel"</span>, <span class="kw">this</span>, <span class="st">"onCancelClick"</span>));
+ *     form.add(new Submit("ok", "   OK   ",  this, "onOkClick"));
+ *     form.add(new Submit("cancel", this, "onCancelClick"));
  *
  *     addControl(form);
  * } </pre>
  *
+ * <a name="resources"></a>
+ * <h3>CSS and JavaScript resources</h3>
+ *
+ * In addition to <a href="../../../../../../click-api/org/apache/click/control/Form.html#resources">Form's resources</a>,
+ * the TabbedForm control makes use of the following resources (which Click
+ * automatically deploys to the application directory, <tt>/click</tt>):
+ *
+ * <ul>
+ * <li><tt>click/extras-control.css</tt></li>
+ * </ul>
+ *
+ * To import these TabbedForm files simply reference the variables
+ * <span class="blue">$headElements</span> and
+ * <span class="blue">$jsElements</span> in the page template.
+ *
  * @author Malcolm Edgar
  */
 public class TabbedForm extends Form {
@@ -124,7 +137,7 @@
 
     private static final long serialVersionUID = 1L;
 
-    /** The TabbedForm.css style sheet import link. */
+    /** The TabbedForm imports statement. */
     public static final String HTML_IMPORTS = Form.HTML_IMPORTS
         + "<link type=\"text/css\" rel=\"stylesheet\" href=\"{0}/click/extras-control{1}.css\"/>\n";
 
@@ -233,11 +246,19 @@
     }
 
     /**
-     * Return the HTML head import statements for the CSS stylesheet file:
-     * <tt>click/TabbedForm.css</tt>.
+     * Return the TabbedForm HTML head imports statements for the following
+     * resources:
+     * <p/>
+     * <ul>
+     * <li><tt>click/extras-control.css</tt></li>
+     * </ul>
+     * <p/>
+     * Additionally all the {@link org.apache.click.control.Form#getHtmlImports()
+     * Form import statements} are also returned.
+     *
+     * @see org.apache.click.Control#getHtmlImports()
      *
-     * @return the HTML head import statements for the control stylesheet and
-     * JavaScript files
+     * @return the HTML head import statements for the control
      */
     public String getHtmlImports() {
         HtmlStringBuffer buffer = new HtmlStringBuffer(512);
@@ -329,20 +350,6 @@
     // --------------------------------------------------------- Public Methods
 
     /**
-     * Deploy the <tt>table.css</tt> file to the <tt>click</tt> web
-     * directory when the application is initialized.
-     *
-     * @see org.apache.click.Control#onDeploy(ServletContext)
-     *
-     * @param servletContext the servlet context
-     */
-    public void onDeploy(ServletContext servletContext) {
-        ClickUtils.deployFile(servletContext,
-                              "/org/apache/click/extras/control/extras-control.css",
-                              "click");
-    }
-
-    /**
      * Process the Form request. In addition to the normal Form
      * <tt>onProcess()</tt> processing, if the Form is invalid this method
      * will display the tab sheet with the first field error.

Modified: incubator/click/trunk/click/extras/src/org/apache/click/extras/control/VirtualKeyboard.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/extras/src/org/apache/click/extras/control/VirtualKeyboard.java?rev=786815&r1=786814&r2=786815&view=diff
==============================================================================
--- incubator/click/trunk/click/extras/src/org/apache/click/extras/control/VirtualKeyboard.java (original)
+++ incubator/click/trunk/click/extras/src/org/apache/click/extras/control/VirtualKeyboard.java Sat Jun 20 13:30:21 2009
@@ -13,8 +13,6 @@
  */
 package org.apache.click.extras.control;
 
-import javax.servlet.ServletContext;
-
 import org.apache.click.control.TextField;
 import org.apache.click.util.ClickUtils;
 
@@ -24,7 +22,7 @@
  * <table class='htmlHeader' cellspacing='10'>
  * <tr>
  * <td>
- * <img align='middle' hspace='2'src='virtual-keyboard.gif' title='Virtual Keyboard'/>
+ * <img align='middle' hspace='2' src='virtual-keyboard.gif' title='Virtual Keyboard'/>
  * </td>
  * </tr>
  * </table>
@@ -35,7 +33,7 @@
  * <b>Virtual keyboard interfaces</b> are generally used in websites where the highest
  * level of security is a must like online banking applications.
  * Virtual keyboards help to prevent any keylogging activies and/or provide
- * users a special keyboard which they don�t already have (like a keyboard of
+ * users a special keyboard which they don't already have (like a keyboard of
  * another language).
  *
  * <h3>Keyboard Layout Support</h3>
@@ -45,6 +43,22 @@
  * Turkish-F, Turkish-QWERTY, UK, US Standard and US International keyboard layouts,
  * dynamically selectable.
  *
+ * <a name="resources"></a>
+ * <h3>CSS and JavaScript resources</h3>
+ *
+ * The VirtualKeyboard control makes use of the following resources
+ * (which Click automatically deploys to the application directory, <tt>/click</tt>):
+ *
+ * <ul>
+ * <li><tt>click/keyboard.css</tt></li>
+ * <li><tt>click/keyboard.js</tt></li>
+ * <li><tt>click/keyboard.png</tt></li>
+ * </ul>
+ *
+ * To import these VirtualKeyboard files simply reference the variables
+ * <span class="blue">$headElements</span> and
+ * <span class="blue">$jsElements</span> in the page template.
+ *
  * <h4>Credits</h4>
  * This control based on the <a href="http://www.greywyvern.com/code/js/keyboard.html">Greywyvern</a> JavaScript library.
  *
@@ -56,7 +70,7 @@
 
     private static final long serialVersionUID = 1L;
 
-     /** The HTML import statements. */
+     /** The VirtualKeyboard imports statement. */
     public static final String HTML_IMPORTS =
           "<script type=\"text/javascript\">var keyboard_png_path=\"{0}/click/keyboard{1}.png\";</script>\n"
         + "<script type=\"text/javascript\" src=\"{0}/click/keyboard{1}.js\" charset=\"UTF-8\"></script>\n"
@@ -98,30 +112,20 @@
     // --------------------------------------------------------- Public Methods
 
     /**
-     * Returns the HTML head import statements for the JavaScript
-     * (<tt>click/keyboard.js</tt>) and CSS (<tt>click/keyboard.css</tt>) files.
+     * Return the VirtualKeyboard HTML head imports statements for the following
+     * resources:
+     * <p/>
+     * <ul>
+     * <li><tt>click/keyboard.css</tt></li>
+     * <li><tt>click/keyboard.js</tt></li>
+     * <li><tt>click/keyboard.png</tt></li>
+     * </ul>
      *
      * @see org.apache.click.Control#getHtmlImports()
      *
-     * @return the HTML head import statements for the JavaScript and CSS files
+     * @return the HTML head import statements for the control
      */
     public String getHtmlImports() {
         return ClickUtils.createHtmlImport(HTML_IMPORTS, getContext());
     }
-
-    /**
-     * Deploy the static resource files in the VirtualKeyboard control.
-     *
-     * @see org.apache.click.control.Field#onDeploy(javax.servlet.ServletContext)
-     *
-     * @param servletContext the ServletContext
-     */
-    public void onDeploy(ServletContext servletContext) {
-        ClickUtils.deployFiles(servletContext,
-                new String[]{
-                        "/org/apache/click/extras/control/keyboard.css",
-                        "/org/apache/click/extras/control/keyboard.js",
-                        "/org/apache/click/extras/control/keyboard.png"},
-                "click");
-    }
 }

Modified: incubator/click/trunk/click/extras/src/org/apache/click/extras/control/menu.dtd
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/extras/src/org/apache/click/extras/control/menu.dtd?rev=786815&r1=786814&r2=786815&view=diff
==============================================================================
--- incubator/click/trunk/click/extras/src/org/apache/click/extras/control/menu.dtd (original)
+++ incubator/click/trunk/click/extras/src/org/apache/click/extras/control/menu.dtd Sat Jun 20 13:30:21 2009
@@ -23,10 +23,10 @@
 <!ELEMENT menu (menu*)>
     <!ATTLIST menu label CDATA #IMPLIED>
     <!ATTLIST menu path CDATA #IMPLIED>
+    <!ATTLIST menu target CDATA #IMPLIED>
     <!ATTLIST menu title CDATA #IMPLIED>
+    <!ATTLIST menu imageSrc CDATA #IMPLIED>
+    <!ATTLIST menu external (true|false) "false">
+    <!ATTLIST menu separator (true|false) "false">
     <!ATTLIST menu roles CDATA #IMPLIED>
     <!ATTLIST menu pages CDATA #IMPLIED>
-
-  
-  
-  

Modified: incubator/click/trunk/click/extras/src/org/apache/click/extras/panel/TabbedPanel.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/extras/src/org/apache/click/extras/panel/TabbedPanel.java?rev=786815&r1=786814&r2=786815&view=diff
==============================================================================
--- incubator/click/trunk/click/extras/src/org/apache/click/extras/panel/TabbedPanel.java (original)
+++ incubator/click/trunk/click/extras/src/org/apache/click/extras/panel/TabbedPanel.java Sat Jun 20 13:30:21 2009
@@ -18,8 +18,6 @@
  */
 package org.apache.click.extras.panel;
 
-import javax.servlet.ServletContext;
-
 import org.apache.click.ActionListener;
 import org.apache.click.Control;
 import org.apache.click.control.ActionLink;
@@ -108,6 +106,33 @@
  *   background: #efefef;
  * } </pre>
  *
+ * <a name="resources"></a>
+ * <h3>CSS and JavaScript resources</h3>
+ *
+ * The TabbedPanel makes use of the following resources
+ * (which Click automatically deploys to the application directory, <tt>/click/</tt>):
+ *
+ * <ul>
+ * <li><tt>click/TabbedPanel.css</tt></li>
+ * </ul>
+ *
+ * To import these TabbedPanel files simply reference the variables
+ * <span class="blue">$headElements</span> and
+ * <span class="blue">$jsElements</span> in the page template. For example:
+ *
+ * <pre class="codeHtml">
+ * &lt;html&gt;
+ * &lt;head&gt;
+ * <span class="blue">$headElements</span>
+ * &lt;/head&gt;
+ * &lt;body&gt;
+ *
+ * <span class="red">$panel</span>
+ *
+ * <span class="blue">$jsElements</span>
+ * &lt;/body&gt;
+ * &lt;/html&gt; </pre>
+ *
  * @author Phil Barnes
  * @author Malcolm Edgar
  */
@@ -115,7 +140,7 @@
 
     private static final long serialVersionUID = 1L;
 
-    /** The TabbedPanel.css style sheet import link. */
+    /** The TabbedPanel imports statements. */
     public static final String HTML_IMPORTS =
         "<link type=\"text/css\" rel=\"stylesheet\" href=\"{0}/click/TabbedPanel{1}.css\"/>\n";
 
@@ -229,10 +254,19 @@
     }
 
     /**
-     * Return the HTML head import statements for the CSS stylesheet file:
-     * <tt>click/TabbedPanel.css</tt>.
+     * Return the TabbedPanel HTML head imports statements for the following
+     * resources:
+     * <p/>
+     * <ul>
+     * <li><tt>click/TabbedPanel.css</tt></li>
+     * </ul>
+     * <p/>
+     * Additionally all {@link #getControls() controls} import statements are
+     * also returned.
      *
-     * @return the HTML head import statements for the control stylesheet
+     * @see org.apache.click.Control#getHtmlImports()
+     *
+     * @return the HTML head import statements for the control
      */
     public String getHtmlImports() {
         HtmlStringBuffer buffer = new HtmlStringBuffer(512);
@@ -354,20 +388,6 @@
     // --------------------------------------------------------- Public Methods
 
     /**
-     * Deploy the <tt>TabbedPanel.css</tt> file to the <tt>click</tt> web
-     * directory when the application is initialized.
-     *
-     * @see org.apache.click.Control#onDeploy(ServletContext)
-     *
-     * @param servletContext the servlet context
-     */
-    public void onDeploy(ServletContext servletContext) {
-        ClickUtils.deployFile(servletContext,
-                              "/org/apache/click/extras/panel/TabbedPanel.css",
-                              "click");
-    }
-
-    /**
      * Initialize the child controls contained in the panel. Note with the child
      * panels only the active panel will be initialized.
      * <p/>

Modified: incubator/click/trunk/click/extras/src/org/apache/click/extras/tree/CheckboxTree.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/extras/src/org/apache/click/extras/tree/CheckboxTree.java?rev=786815&r1=786814&r2=786815&view=diff
==============================================================================
--- incubator/click/trunk/click/extras/src/org/apache/click/extras/tree/CheckboxTree.java (original)
+++ incubator/click/trunk/click/extras/src/org/apache/click/extras/tree/CheckboxTree.java Sat Jun 20 13:30:21 2009
@@ -27,8 +27,6 @@
 import java.util.Map;
 import java.util.Set;
 
-import javax.servlet.ServletContext;
-
 import org.apache.click.Context;
 import org.apache.click.control.Decorator;
 import org.apache.click.control.Form;
@@ -65,12 +63,15 @@
  *     protected Form form;
  *
  *     public PlainTreePage() {
+ *         form = new Form("form");
+ *         addControl(form);
+ *
  *         Tree tree = createTree();
- *         form = createForm();
  *         form.add(tree);
- *         addControl(form);
+ *
  *         submit = new Submit("submit", this, "onSubmitClick");
  *         cancel = new Submit("cancel", this, "onCancelClick");
+ *
  *         form.add(submit);
  *         form.add(cancel);
  *     }
@@ -103,28 +104,22 @@
  *         tree.setRootNode(root);
  *         return tree;
  *     }
+ * } </pre>
  *
- *     public Form createForm() {
- *         Form form = new Form("form") {
- *             // PLEASE NOTE: CheckboxTree will only be processed by form if the
- *             // Form is submitted. Thus expanding and collapsing Tree nodes
- *             // won't work by default because the Tree won't be processed.
- *
- *             // Here we override the default behavior and explicitly process
- *             // CheckboxTree so that expanding and collapsing nodes will still work,
- *             // even if the Form was not submitted.
- *             public boolean onProcess() {
- *                 if (form.isFormSubmission()) {
- *                     return super.onProcess();
- *                 } else {
- *                     return tree.onProcess();
- *                 }
- *             }
- *         };
+ * <a name="resources"></a>
+ * <h3>CSS and JavaScript resources</h3>
  *
- *         return form;
- *     }
- * } </pre>
+ * In addition to <a href="Tree.html#resources">Tree's resources</a>,
+ * the CheckboxTree control makes use of the following resources
+ * (which Click automatically deploys to the application directory, <tt>/click/tree</tt>):
+ *
+ * <ul>
+ * <li><tt>click/tree/checkbox-tree.js</tt></li>
+ * </ul>
+ *
+ * To import these Tree files simply reference the variables
+ * <span class="blue">$headElements</span> and
+ * <span class="blue">$jsElements</span> in the page template.
  *
  * @see Tree
  *
@@ -138,11 +133,6 @@
     public static final String HTML_IMPORTS =
             "<script type=\"text/javascript\" src=\"{0}/click/tree/checkbox-tree{1}.js\"></script>\n";
 
-    /** The Tree resource file names. */
-    protected static final String[] TREE_RESOURCES = {
-        "/org/apache/click/extras/tree/checkbox-tree.js"
-    };
-
     /** default serial version id. */
     private static final long serialVersionUID = 1L;
 
@@ -212,13 +202,19 @@
     // --------------------------------------------------------- Public Methods
 
     /**
-     * Return the HTML head import statements for the CSS stylesheet file:
-     * <tt>click/tree/checkbox-tree.js</tt>.
+     * Return the CheckboxTree HTML head imports statements for the following
+     * resources:
+     * <p/>
+     * <ul>
+     * <li><tt>click/tree/checkbox-tree.js</tt></li>
+     * </ul>
      * <p/>
-     * This method calls super.getHtmlImports() to retrieve any imports defined in the
-     * super class.
+     * Additionally all the {@link Tree#getHtmlImports() Tree import statements}
+     * are also returned.
+     *
+     * @see org.apache.click.Control#getHtmlImports()
      *
-     * @return the HTML head import statements for the control stylesheet
+     * @return the HTML head import statements for the control
      */
     public String getHtmlImports() {
         HtmlStringBuffer buffer = new HtmlStringBuffer(256);
@@ -231,23 +227,6 @@
     }
 
     /**
-     * Deploy all files defined in the constant <tt>{@link #TREE_RESOURCES}</tt>
-     * to the <tt>click/tree</tt> web directory when the application is initialized.
-     * <p/>
-     * This method calls super.onDeploy() to copy any files defined in the
-     * super class.
-     *
-     * @param servletContext the servlet context
-     * @see org.apache.click.Control#onDeploy(ServletContext)
-     */
-    public void onDeploy(ServletContext servletContext) {
-        super.onDeploy(servletContext);
-        ClickUtils.deployFiles(servletContext,
-                               TREE_RESOURCES,
-                               "click/tree");
-    }
-
-    /**
      * Binds the users request of selected nodes to the tree's nodes.
      * <p/>
      * This method is automatically invoked when the CheckboxTree's parent form

Modified: incubator/click/trunk/click/extras/src/org/apache/click/extras/tree/Tree.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/extras/src/org/apache/click/extras/tree/Tree.java?rev=786815&r1=786814&r2=786815&view=diff
==============================================================================
--- incubator/click/trunk/click/extras/src/org/apache/click/extras/tree/Tree.java (original)
+++ incubator/click/trunk/click/extras/src/org/apache/click/extras/tree/Tree.java Sat Jun 20 13:30:21 2009
@@ -32,8 +32,6 @@
 import java.util.Set;
 import java.util.StringTokenizer;
 
-import javax.servlet.ServletContext;
-
 import org.apache.click.ActionListener;
 import org.apache.click.Context;
 import org.apache.click.Control;
@@ -67,86 +65,97 @@
  *
  * An example tree usage is provided below (this code was used to produce the screenshot):
  *
- * <pre class="codeJava">
- * <span class="kw">public class</span> PlainTreePage <span class="kw">extends</span> BorderPage {
+ * <pre class="prettyprint">
+ * public class PlainTreePage extends BorderPage {
  *
- *     <span class="kw">public</span> PlainTreePage() {
+ *     public PlainTreePage() {
  *         Tree tree = buildTree();
  *         addControl(tree);
  *     }
  *
- *     <span class="cm">//This method creates a representation of a Windows OS directory.</span>
- *     <span class="kw">public Tree</span> buildTree() {
- *         Tree tree = <span class="kw">new</span> Tree(<span class="st">"tree"</span>);
- *
- *         <span class="cm">//Create a node representing the root directory with the specified
- *         //parameter as the value. Because an id is not specified, a random
- *         //one will be generated by the node. By default the root node is
- *         //not rendered by the tree. This can be changed by calling
- *         //tree.setRootNodeDisplayed(true).</span>
- *         TreeNode root = new TreeNode(<span class="st">"c:"</span>);
- *
- *         <span class="cm">//Create a new directory, setting the root directory as its parent. Here
- *         //we do specify a id as the 2nd argument, so no id is generated.</span>
- *         TreeNode dev = <span class="kw">new</span> TreeNode(<span class="st">"dev"</span>,<span class="st">"1"</span>, root);
- *
- *         <span class="cm">//The following two nodes represent files in the directory.
- *         //The false argument to the constructor below means that these nodes
- *         //does not support child nodes. Makes sense since files cannot contain
- *         //directories or other files</span>
- *         <span class="kw">new</span> TreeNode(<span class="st">"java.pdf"</span>, <span class="st">"2"</span>, dev, <span class="kw">false</span>);
- *         <span class="kw">new</span> TreeNode(<span class="st">"ruby.pdf"</span>, <span class="st">"3"</span>, dev, <span class="kw">false</span>);
- *
- *         TreeNode programFiles = <span class="kw">new</span> TreeNode(<span class="st">"program files"</span>, <span class="st">"4"</span>, root);
- *         TreeNode adobe = <span class="kw">new</span> TreeNode(<span class="st">"Adobe"</span>, <span class="st">"5"</span>, programFiles);
- *
- *         TreeNode download = <span class="kw">new</span> TreeNode(<span class="st">"downloads"</span>,<span class="st">"6"</span>, root);
- *         TreeNode web = <span class="kw">new</span> TreeNode(<span class="st">"web"</span>, <span class="st">"7"</span>, download);
- *         <span class="kw">new</span> TreeNode(<span class="st">"html.pdf"</span>, <span class="st">"8"</span>, web);
- *         <span class="kw">new</span> TreeNode(<span class="st">"css.html"</span>, <span class="st">"9"</span>, web);
- *
- *         TreeNode databases = <span class="kw">new</span> TreeNode(<span class="st">"databases"</span>, <span class="st">"10"</span>, download);
- *         <span class="kw">new</span> TreeNode(<span class="st">"mysql.html"</span>,<span class="st">"11"</span>,databases);
- *         <span class="kw">new</span> TreeNode(<span class="st">"oracle.pdf"</span>,<span class="st">"12"</span>,databases);
- *         <span class="kw">new</span> TreeNode(<span class="st">"postgres"</span>,<span class="st">"13"</span>,databases);
+ *     // This method creates a representation of a Windows OS directory.
+ *     public Tree buildTree() {
+ *         Tree tree = new Tree("tree");
+ *
+ *         // Create a node representing the root directory with the specified
+ *         // parameter as the value. Because an id is not specified, a random
+ *         // one will be generated by the node. By default the root node is
+ *         // not rendered by the tree. This can be changed by calling
+ *         // tree.setRootNodeDisplayed(true).
+ *         TreeNode root = new TreeNode("c:");
+ *
+ *         // Create a new directory, setting the root directory as its parent. Here
+ *         // we do specify a id as the 2nd argument, so no id is generated.
+ *         TreeNode dev = new TreeNode("dev","1", root);
+ *
+ *         // The following two nodes represent files in the directory.
+ *         // The false argument to the constructor below means that these nodes
+ *         // does not support child nodes. Makes sense since files cannot contain
+ *         // directories or other files
+ *         new TreeNode("java.pdf", "2", dev, false);
+ *         new TreeNode("ruby.pdf", "3", dev, false);
+ *
+ *         TreeNode programFiles = new TreeNode("program files", "4", root);
+ *         TreeNode adobe = new TreeNode("Adobe", "5", programFiles);
+ *
+ *         TreeNode download = new TreeNode("downloads","6", root);
+ *         TreeNode web = new TreeNode("web", "7", download);
+ *         new TreeNode("html.pdf", "8", web);
+ *         new TreeNode("css.html", "9", web);
+ *
+ *         TreeNode databases = new TreeNode("databases", "10", download);
+ *         new TreeNode("mysql.html","11",databases);
+ *         new TreeNode("oracle.pdf","12",databases);
+ *         new TreeNode("postgres","13",databases);
  *
  *         tree.setRootNode(root);
- *         <span class="kw">return</span> tree;
+ *         return tree;
  *     }
  * } </pre>
  *
- * <h4>Tree Style</h4>
+ * <a name="resources"></a>
+ * <h3>CSS and JavaScript resources</h3>
  *
- * The Tree control automatically deploys the tree CSS style sheet
- * (<tt>tree.css</tt>) and javascript (<tt>tree.js</tt>) to the application
- * directory <tt>/click/tree</tt>. To import the style sheet simply reference
- * the {@link org.apache.click.util.PageImports} object. For example:
+ * The Tree control makes use of the following resources
+ * (which Click automatically deploys to the application directory, <tt>/click/tree</tt>):
+ *
+ * <ul>
+ * <li><tt>click/tree/tree.css</tt></li>
+ * <li><tt>click/tree/tree.js</tt></li>
+ * <li><tt>click/tree/cookie-helper.js</tt></li>
+ * </ul>
+ *
+ * To import these Tree files simply reference the variables
+ * <span class="blue">$headElements</span> and
+ * <span class="blue">$jsElements</span> in the page template. For example:
  *
  * <pre class="codeHtml">
  * &lt;html&gt;
- *    &lt;head&gt;
- *       <span class="blue">$imports</span>
- *    &lt;/head&gt;
- *    &lt;body&gt;
- *       <span class="red">$tree</span>
- *    &lt;/body&gt;
+ * &lt;head&gt;
+ * <span class="blue">$headElements</span>
+ * &lt;/head&gt;
+ * &lt;body&gt;
+ *
+ * <span class="red">$tree</span>
+ *
+ * <span class="blue">$jsElements</span>
+ * &lt;/body&gt;
  * &lt;/html&gt; </pre>
- * <p/>
- * <h4>Tree customization</h4>
+ *
+ * <a name="customization"></a>
+ * <h3>Tree customization</h3>
+ *
  * The following list of stylesheet classes are used to render the tree
- * icons. One can easily change the tree.css to use a different set of
- * icons. Note: all classes are set in a &lt;span&gt; element.
- * <dl>
- *      <dt>&lt;span class=<span class="blue">"leafIcon"</span>&gt;</dt>
- *      <dd>renders the leaf node of the tree</dd>
- *      <dt>&lt;span class=<span class="blue">"expandedIcon"</span>&gt;</dt>
- *      <dd>renders the expanded state of a node</dd>
- *      <dt>&lt;span class=<span class="blue">"collapsedIcon"</span>&gt;</dt>
- *      <dd>renders the collapsed state of a node</dd>
- * </dl>
+ * icons. One can easily change the <tt>tree.css</tt> to use a different set of
+ * icons. Note: all CSS classes are set inline in &lt;span&gt; elements.
+ * <ul>
+ * <li>&lt;span class=<span class="blue">"leafIcon"</span>&gt; - renders the leaf node of the tree</li>
+ * <li>&lt;span class=<span class="blue">"expandedIcon"</span>&gt; - renders the expanded state of a node</li>
+ * <li>&lt;span class=<span class="blue">"collapsedIcon"</span>&gt; - renders the collapsed state of a node</li>
+ * </ul>
  *
  * <strong>Credit</strong> goes to <a href="http://wicket.apache.org">Wicket</a>
- * for the following:
+ * for these images:
  * <ul>
  *      <li>images/folder-closed.png</li>
  *      <li>images/folder-open.png</li>
@@ -165,45 +174,24 @@
     /** The tree's select/deselect parameter name: <tt>"selectTreeNode"</tt>. */
     public static final String SELECT_TREE_NODE_PARAM = "selectTreeNode";
 
-    /** The tree.css style sheet import link. */
+    /** The Tree imports statement. */
     public static final String TREE_IMPORTS =
             "<link type=\"text/css\" rel=\"stylesheet\" href=\"{0}/click/tree/tree{1}.css\"/>\n";
 
-    /** Client side javascript import link. */
+    /** Client side javascript imports statement. */
     public static final String JAVASCRIPT_IMPORTS =
             "<script type=\"text/javascript\" src=\"{0}/click/tree/tree{1}.js\"></script>\n";
 
-    /** Client side javascript cookie import link. */
+    /** Client side javascript cookie imports statement. */
     public static final String JAVASCRIPT_COOKIE_IMPORTS =
             "<script type=\"text/javascript\" src=\"{0}/click/tree/cookie-helper{1}.js\"></script>\n";
 
-    /** The Tree resource file names. */
-    public static final String[] TREE_RESOURCES = {
-        "/org/apache/click/extras/tree/tree.css",
-        "/org/apache/click/extras/tree/tree.js",
-        "/org/apache/click/extras/tree/cookie-helper.js"
-    };
-
     /** Indicator for using cookies to implement client side behavior. */
     public final static int JAVASCRIPT_COOKIE_POLICY = 1;
 
     /** Indicator for using the session to implement client side behavior. */
     public final static int JAVASCRIPT_SESSION_POLICY = 2;
 
-    /** The Tree image file names. */
-    protected static final String[] TREE_IMAGES = {
-        "/org/apache/click/extras/tree/images/folder-open.png",
-        "/org/apache/click/extras/tree/images/folder-closed.png",
-        "/org/apache/click/extras/tree/images/item.png",
-        "/org/apache/click/extras/tree/images/corner.png",
-        "/org/apache/click/extras/tree/images/minus.png",
-        "/org/apache/click/extras/tree/images/minus-corner.png",
-        "/org/apache/click/extras/tree/images/plus.png",
-        "/org/apache/click/extras/tree/images/plus-corner.png",
-        "/org/apache/click/extras/tree/images/tjunction.png",
-        "/org/apache/click/extras/tree/images/vertical-line.png"
-    };
-
     /** The tree's expand icon name: <tt>"expandedIcon"</tt>. */
     protected static final String EXPAND_ICON = "expandedIcon";
 
@@ -462,13 +450,18 @@
     }
 
     /**
-     * Return the HTML head import statements for the CSS stylesheet file:
-     * <tt>click/tree/tree.css</tt>.
+     * Return the Tree HTML head imports statements for the following
+     * resources:
      * <p/>
-     * If javascript is enabled, this method also includes the head import
-     * Javascript file: <tt>click/tree/tree.js</tt>.
+     * <ul>
+     * <li><tt>click/tree/tree.css</tt></li>
+     * <li><tt>click/tree/tree.js</tt></li>
+     * <li><tt>click/tree/cookie-helper.js</tt></li>
+     * </ul>
+     *
+     * @see org.apache.click.Control#getHtmlImports()
      *
-     * @return the HTML head import statements for the control stylesheet
+     * @return the HTML head import statements for the control
      */
     public String getHtmlImports() {
         Context context = getContext();
@@ -784,24 +777,6 @@
     }
 
     /**
-     * Deploy all files defined in the constants <tt>{@link #TREE_RESOURCES}</tt>
-     * and <tt>{@link #TREE_IMAGES}</tt> to the <tt>click/tree</tt> web
-     * directory when the application is initialized.
-     *
-     * @param servletContext the servlet context
-     * @see org.apache.click.Control#onDeploy(ServletContext)
-     */
-    public void onDeploy(ServletContext servletContext) {
-        ClickUtils.deployFiles(servletContext,
-                               TREE_RESOURCES,
-                               "click/tree");
-
-        ClickUtils.deployFiles(servletContext,
-                               TREE_IMAGES,
-                               "click/tree/images");
-    }
-
-    /**
      * Provides a TreeNode callback interface.
      */
     protected interface Callback {