click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r923193 - in /click/trunk/click/extras/src/org/apache/click/extras: cayenne/PropertySelect.java cayenne/QuerySelect.java control/CountrySelect.java
Date Mon, 15 Mar 2010 12:31:47 GMT
Author: sabob
Date: Mon Mar 15 12:31:47 2010
New Revision: 923193

URL: http://svn.apache.org/viewvc?rev=923193&view=rev
Log:
removed bindRequestValue dependency on optionList values and general cleanup

Modified:
    click/trunk/click/extras/src/org/apache/click/extras/cayenne/PropertySelect.java
    click/trunk/click/extras/src/org/apache/click/extras/cayenne/QuerySelect.java
    click/trunk/click/extras/src/org/apache/click/extras/control/CountrySelect.java

Modified: click/trunk/click/extras/src/org/apache/click/extras/cayenne/PropertySelect.java
URL: http://svn.apache.org/viewvc/click/trunk/click/extras/src/org/apache/click/extras/cayenne/PropertySelect.java?rev=923193&r1=923192&r2=923193&view=diff
==============================================================================
--- click/trunk/click/extras/src/org/apache/click/extras/cayenne/PropertySelect.java (original)
+++ click/trunk/click/extras/src/org/apache/click/extras/cayenne/PropertySelect.java Mon Mar
15 12:31:47 2010
@@ -453,6 +453,8 @@ public class PropertySelect extends Sele
 
     /**
      * Validate the QuerySelect request submission.
+     *
+     * @see Select#validate()
      */
     @Override
     public void validate() {

Modified: click/trunk/click/extras/src/org/apache/click/extras/cayenne/QuerySelect.java
URL: http://svn.apache.org/viewvc/click/trunk/click/extras/src/org/apache/click/extras/cayenne/QuerySelect.java?rev=923193&r1=923192&r2=923193&view=diff
==============================================================================
--- click/trunk/click/extras/src/org/apache/click/extras/cayenne/QuerySelect.java (original)
+++ click/trunk/click/extras/src/org/apache/click/extras/cayenne/QuerySelect.java Mon Mar
15 12:31:47 2010
@@ -371,6 +371,8 @@ public class QuerySelect extends Select 
 
     /**
      * Validate the QuerySelect request submission.
+     *
+     * @see Select#validate()
      */
     @Override
     public void validate() {

Modified: click/trunk/click/extras/src/org/apache/click/extras/control/CountrySelect.java
URL: http://svn.apache.org/viewvc/click/trunk/click/extras/src/org/apache/click/extras/control/CountrySelect.java?rev=923193&r1=923192&r2=923193&view=diff
==============================================================================
--- click/trunk/click/extras/src/org/apache/click/extras/control/CountrySelect.java (original)
+++ click/trunk/click/extras/src/org/apache/click/extras/control/CountrySelect.java Mon Mar
15 12:31:47 2010
@@ -63,7 +63,7 @@ public class CountrySelect extends Selec
     /** The Select comparator locale. */
     private Locale locale;
 
-    // ----------------------------------------------------------- Constructors
+    // Constructors -----------------------------------------------------------
 
     /**
      * Create a CountrySelect field with the given name.
@@ -126,7 +126,7 @@ public class CountrySelect extends Selec
         super();
     }
 
-    // --------------------------------------------------------- Public Methods
+    // Public Methods ---------------------------------------------------------
 
     /**
      * Return the locale for this control.
@@ -154,18 +154,19 @@ public class CountrySelect extends Selec
         this.locale = locale;
     }
  
-    // --------------------------------------------------------- Public Methods
+    // Public Methods ---------------------------------------------------------
 
     /**
-     * Bind the request value to the control.
+     * Validate the Select request submission.
      *
-     * @see Select#bindRequestValue()
+     * @see Select#validate()
      */
-    public void bindRequestValue() {
-
+    @Override
+    public void validate() {
+        // Ensure the option list is loaded before validation
         loadOptionList();
 
-        super.bindRequestValue();
+        super.validate();
     }
 
     /**
@@ -178,12 +179,13 @@ public class CountrySelect extends Selec
      *
      * @param buffer the specified buffer to render the control's output to
      */
+    @Override
     public void render(HtmlStringBuffer buffer) {
         loadOptionList();
         super.render(buffer);
     }
 
-    // ------------------------------------------------------ Protected Methods
+    // Protected Methods ------------------------------------------------------
 
     /**
      * Load the Country Select options if not defined, using all the available
@@ -213,10 +215,10 @@ public class CountrySelect extends Selec
 
         for (int i = 0; i < availableLocales.length; i++) {
             final String iso = availableLocales[i].getCountry();
-            final String name = availableLocales[i].getDisplayCountry(getLocale());
+            final String country = availableLocales[i].getDisplayCountry(getLocale());
 
-            if (StringUtils.isNotEmpty(iso) && StringUtils.isNotEmpty(name)) {
-                countryList.add(new Option(iso, name));
+            if (StringUtils.isNotEmpty(iso) && StringUtils.isNotEmpty(country)) {
+                countryList.add(new Option(iso, country));
             }
         }
 
@@ -227,7 +229,7 @@ public class CountrySelect extends Selec
         addAll(countryList);
     }
 
-    // ---------------------------------------------------------- Inner Classes
+    // Inner Classes ----------------------------------------------------------
 
     /**
      * Provides a comparator for Option labels with locale-sensitive behaviour.



Mime
View raw message