click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r938027 - in /click/trunk/click/extras/src/org/apache/click/extras/control: HiddenList.java HtmlFieldSet.java HtmlForm.java
Date Mon, 26 Apr 2010 13:05:51 GMT
Author: sabob
Date: Mon Apr 26 13:05:51 2010
New Revision: 938027

URL: http://svn.apache.org/viewvc?rev=938027&view=rev
Log:
java5 cleanup

Modified:
    click/trunk/click/extras/src/org/apache/click/extras/control/HiddenList.java
    click/trunk/click/extras/src/org/apache/click/extras/control/HtmlFieldSet.java
    click/trunk/click/extras/src/org/apache/click/extras/control/HtmlForm.java

Modified: click/trunk/click/extras/src/org/apache/click/extras/control/HiddenList.java
URL: http://svn.apache.org/viewvc/click/trunk/click/extras/src/org/apache/click/extras/control/HiddenList.java?rev=938027&r1=938026&r2=938027&view=diff
==============================================================================
--- click/trunk/click/extras/src/org/apache/click/extras/control/HiddenList.java (original)
+++ click/trunk/click/extras/src/org/apache/click/extras/control/HiddenList.java Mon Apr 26
13:05:51 2010
@@ -55,12 +55,12 @@ public class HiddenList extends Field {
 
     private static final long serialVersionUID = 1L;
 
-    // ----------------------------------------------------- Instance Variables
+    // Instance Variables -----------------------------------------------------
 
     /** The hidden values. */
     protected List valueObject;
 
-    // ----------------------------------------------------------- Constructors
+    // Constructors -----------------------------------------------------------
 
     /**
      * Create a HiddenList with the given name.
@@ -79,13 +79,14 @@ public class HiddenList extends Field {
     public HiddenList() {
     }
 
-    // ------------------------------------------------------ Public Attributes
+    // Public Attributes ------------------------------------------------------
 
     /**
      * Set the list of hidden values.
      *
      * @param valueObject a list of Strings
      */
+    @Override
     public void setValueObject(Object valueObject) {
         if (!(valueObject instanceof List)) {
             throw new IllegalArgumentException("the valueObject must be a"
@@ -99,6 +100,7 @@ public class HiddenList extends Field {
      *
      * @return a list of Strings
      */
+    @Override
     public Object getValueObject() {
         if (this.valueObject == null) {
             this.valueObject = new ArrayList();
@@ -125,11 +127,18 @@ public class HiddenList extends Field {
         getValues().add(value);
     }
 
-    // --------------------------------------------------------- Public Methods
+    // Public Methods ---------------------------------------------------------
 
     /**
      * This method binds the submitted request values to the HiddenList values.
+     * <p/>
+     * <b>Please note:</b> while it is possible to explicitly bind the field
+     * value by invoking this method directly, it is recommended to use the
+     * "<tt>bind</tt>" utility methods in {@link org.apache.click.util.ClickUtils}
+     * instead. See {@link org.apache.click.util.ClickUtils#bind(org.apache.click.control.Field)}
+     * for more details.
      */
+    @Override
     public void bindRequestValue() {
         String[] values = getContext().getRequestParameterValues(getName());
 
@@ -149,6 +158,7 @@ public class HiddenList extends Field {
      *
      * @return true
      */
+    @Override
     public boolean isHidden() {
         return true;
     }
@@ -160,6 +170,7 @@ public class HiddenList extends Field {
      *
      * @param buffer the specified buffer to render the control's output to
      */
+    @Override
     public void render(HtmlStringBuffer buffer) {
         List values = getValues();
 

Modified: click/trunk/click/extras/src/org/apache/click/extras/control/HtmlFieldSet.java
URL: http://svn.apache.org/viewvc/click/trunk/click/extras/src/org/apache/click/extras/control/HtmlFieldSet.java?rev=938027&r1=938026&r2=938027&view=diff
==============================================================================
--- click/trunk/click/extras/src/org/apache/click/extras/control/HtmlFieldSet.java (original)
+++ click/trunk/click/extras/src/org/apache/click/extras/control/HtmlFieldSet.java Mon Apr
26 13:05:51 2010
@@ -41,11 +41,11 @@ import org.apache.click.util.HtmlStringB
  */
 public class HtmlFieldSet extends FieldSet {
 
-    // -------------------------------------------------------------- Constants
+    // Constants --------------------------------------------------------------
 
     private static final long serialVersionUID = 1L;
 
-    // ----------------------------------------------------------- Constructors
+    // Constructors -----------------------------------------------------------
 
     /**
      * Create a HtmlFieldSet with the given name.
@@ -74,7 +74,7 @@ public class HtmlFieldSet extends FieldS
     public HtmlFieldSet() {
     }
 
-    // --------------------------------------------------------- Public Methods
+    // Public Methods ---------------------------------------------------------
 
     /**
      * This method is not supported and throws an UnsupportedOperationException
@@ -85,6 +85,7 @@ public class HtmlFieldSet extends FieldS
      * @return the field added to this fieldSet
      * @throws UnsupportedOperationException if invoked
      */
+    @Override
     public Field add(Field field, int width) {
         throw new UnsupportedOperationException("Not supported by HtmlFieldSet.");
     }
@@ -98,6 +99,7 @@ public class HtmlFieldSet extends FieldS
      * @return the control added to this fieldSet
      * @throws UnsupportedOperationException if invoked
      */
+    @Override
     public Control add(Control control, int width) {
         throw new UnsupportedOperationException("Not supported by HtmlFieldSet.");
     }
@@ -109,6 +111,7 @@ public class HtmlFieldSet extends FieldS
      *
      * @param buffer the specified buffer to render the control's output to
      */
+    @Override
     public void render(HtmlStringBuffer buffer) {
 
         if (getShowBorder()) {
@@ -137,11 +140,12 @@ public class HtmlFieldSet extends FieldS
      *
      * @return the HTML representation of this control
      */
+    @Override
     public String toString() {
         return super.toString();
     }
 
-    // ------------------------------------------------------ Protected Methods
+    // Protected Methods ------------------------------------------------------
 
     /**
      * @see org.apache.click.control.AbstractControl#renderTagBegin(java.lang.String, org.apache.click.util.HtmlStringBuffer)
@@ -149,6 +153,7 @@ public class HtmlFieldSet extends FieldS
      * @param tagName the name of the tag to render
      * @param buffer the buffer to append the output to
      */
+    @Override
     protected void renderTagBegin(String tagName, HtmlStringBuffer buffer) {
         if (tagName == null) {
             throw new IllegalStateException("Tag cannot be null");
@@ -170,6 +175,7 @@ public class HtmlFieldSet extends FieldS
      * @param tagName the name of the tag to close
      * @param buffer the buffer to append the output to
      */
+    @Override
     protected void renderTagEnd(String tagName, HtmlStringBuffer buffer) {
         buffer.elementEnd(tagName);
     }

Modified: click/trunk/click/extras/src/org/apache/click/extras/control/HtmlForm.java
URL: http://svn.apache.org/viewvc/click/trunk/click/extras/src/org/apache/click/extras/control/HtmlForm.java?rev=938027&r1=938026&r2=938027&view=diff
==============================================================================
--- click/trunk/click/extras/src/org/apache/click/extras/control/HtmlForm.java (original)
+++ click/trunk/click/extras/src/org/apache/click/extras/control/HtmlForm.java Mon Apr 26
13:05:51 2010
@@ -48,7 +48,7 @@ import org.apache.click.util.HtmlStringB
  */
 public class HtmlForm extends Form {
 
-    // -------------------------------------------------------------- Constants
+    // Constants --------------------------------------------------------------
 
     private static final long serialVersionUID = 1L;
 
@@ -67,7 +67,7 @@ public class HtmlForm extends Form {
     public HtmlForm() {
     }
 
-    // --------------------------------------------------------- Public Methods
+    // Public Methods ---------------------------------------------------------
 
     /**
      * This method is not supported and throws an UnsupportedOperationException
@@ -78,6 +78,7 @@ public class HtmlForm extends Form {
      * @return the field added to this form
      * @throws UnsupportedOperationException if invoked
      */
+    @Override
     public Field add(Field field, int width) {
         throw new UnsupportedOperationException("Not supported by HtmlForm.");
     }
@@ -91,6 +92,7 @@ public class HtmlForm extends Form {
      * @return the control added to this form
      * @throws UnsupportedOperationException if invoked
      */
+    @Override
     public Control add(Control control, int width) {
         throw new UnsupportedOperationException("Not supported by HtmlForm.");
     }
@@ -100,6 +102,7 @@ public class HtmlForm extends Form {
      *
      * @return true to continue Page event processing or false otherwise
      */
+    @Override
     public boolean onProcess() {
 
         if (getValidate()) {
@@ -147,6 +150,7 @@ public class HtmlForm extends Form {
      *
      * @param buffer the specified buffer to render the control's output to
      */
+    @Override
     public void render(HtmlStringBuffer buffer) {
 
         //If tag is set, render it
@@ -166,7 +170,7 @@ public class HtmlForm extends Form {
         }
     }
 
-    // ------------------------------------------------------ Protected Methods
+    // Protected Methods ------------------------------------------------------
 
     /**
      * @see org.apache.click.control.AbstractControl#renderTagBegin(java.lang.String, org.apache.click.util.HtmlStringBuffer)
@@ -174,6 +178,7 @@ public class HtmlForm extends Form {
      * @param tagName the name of the tag to render
      * @param buffer the buffer to append the output to
      */
+    @Override
     protected void renderTagBegin(String tagName, HtmlStringBuffer buffer) {
         if (tagName == null) {
             throw new IllegalStateException("Tag cannot be null");
@@ -194,6 +199,7 @@ public class HtmlForm extends Form {
      *
      * @param buffer the buffer to append the output to
      */
+    @Override
     protected void renderContent(HtmlStringBuffer buffer) {
         // Render hidden fields
         List fields = ContainerUtils.getInputFields(this);
@@ -212,6 +218,7 @@ public class HtmlForm extends Form {
      *
      * @param buffer the buffer to append the output to
      */
+    @Override
     protected void renderChildren(HtmlStringBuffer buffer) {
         if (hasControls()) {
             for (int i = 0; i < getControls().size(); i++) {
@@ -240,6 +247,7 @@ public class HtmlForm extends Form {
      * @param formFields the list of form fields
      * @return the estimated rendered control size in characters
      */
+    @Override
     protected int getFormSizeEst(List formFields) {
         return 400 + (getControls().size() * 350);
     }



Mime
View raw message