click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r899092 - in /incubator/click/trunk/click/framework/src/org/apache/click: Page.java control/AbstractControl.java control/Field.java
Date Thu, 14 Jan 2010 08:04:03 GMT
Author: sabob
Date: Thu Jan 14 08:04:03 2010
New Revision: 899092

URL: http://svn.apache.org/viewvc?rev=899092&view=rev
Log:
javadoc

Modified:
    incubator/click/trunk/click/framework/src/org/apache/click/Page.java
    incubator/click/trunk/click/framework/src/org/apache/click/control/AbstractControl.java
    incubator/click/trunk/click/framework/src/org/apache/click/control/Field.java

Modified: incubator/click/trunk/click/framework/src/org/apache/click/Page.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/framework/src/org/apache/click/Page.java?rev=899092&r1=899091&r2=899092&view=diff
==============================================================================
--- incubator/click/trunk/click/framework/src/org/apache/click/Page.java (original)
+++ incubator/click/trunk/click/framework/src/org/apache/click/Page.java Thu Jan 14 08:04:03
2010
@@ -771,8 +771,8 @@
 
     /**
      * Return the localized Page resource message for the given resource
-     * property key. The resource message returned will use the Locale obtained
-     * from the Context.
+     * name or null if not found. The resource message returned will use the
+     * Locale obtained from the Context.
      * <p/>
      * Pages can define text properties files to store localized messages. These
      * properties files must be stored on the Page class path with a name
@@ -810,25 +810,32 @@
      * <pre class="codeHtml">
      * <span class="blue">$messages.title</span> </pre>
      *
-     * Please see the {@link org.apache.click.util.MessagesMap} adaptor for more details.
+     * Please see the {@link org.apache.click.util.MessagesMap} adaptor for more
+     * details.
      *
-     * @param key the message property key name
-     * @return the Page message for the given message property key
+     * @param name resource name of the message
+     * @return the named localized message for the page or null if no message
+     * was found
      */
-    public String getMessage(String key) {
-        if (key == null) {
-            throw new IllegalArgumentException("Null key parameter");
+    public String getMessage(String name) {
+        if (name == null) {
+            throw new IllegalArgumentException("Null name parameter");
         }
-        return (String) getMessages().get(key);
+        return (String) getMessages().get(name);
     }
 
     /**
      * Return the formatted page message for the given resource name
-     * and message format argument and for the context request locale.
+     * and message format argument or null if no message was found. The resource
+     * message returned will use the Locale obtained from the Context.
+     * <p/>
+     * {@link #getMessage(java.lang.String, java.lang.Object[])} is invoked to
+     * retrieve the message for the specified name.
      *
      * @param name resource name of the message
      * @param arg the message argument to format
-     * @return the named localized message for the page
+     * @return the named localized message for the page or null if no message
+     * was found
      */
     public String getMessage(String name, Object arg) {
         Object[] args = new Object[] { arg };
@@ -837,11 +844,16 @@
 
     /**
      * Return the formatted page message for the given resource name and
-     * message format arguments and for the context request locale.
+     * message format arguments or null if no message was found. The resource
+     * message returned will use the Locale obtained from the Context.
+     * <p/>
+     * {@link #getMessage(java.lang.String)} is invoked to retrieve the message
+     * for the specified name.
      *
      * @param name resource name of the message
      * @param args the message arguments to format
-     * @return the named localized message for the page
+     * @return the named localized message for the page or null if no message
+     * was found
      */
     public String getMessage(String name, Object[] args) {
         String value = getMessage(name);
@@ -850,7 +862,8 @@
     }
 
     /**
-     * Return a Map of localized messages for the Page.
+     * Return a Map of localized messages for the Page. The messages returned
+     * will use the Locale obtained from the Context.
      *
      * @see #getMessage(String)
      *

Modified: incubator/click/trunk/click/framework/src/org/apache/click/control/AbstractControl.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/framework/src/org/apache/click/control/AbstractControl.java?rev=899092&r1=899091&r2=899092&view=diff
==============================================================================
--- incubator/click/trunk/click/framework/src/org/apache/click/control/AbstractControl.java
(original)
+++ incubator/click/trunk/click/framework/src/org/apache/click/control/AbstractControl.java
Thu Jan 14 08:04:03 2010
@@ -368,7 +368,9 @@
     }
 
     /**
-     * Return the localized message for the given key, or null if not found.
+     * Return the localized message for the given key or null if not found.
+     * The resource message returned will use the Locale obtained from the
+     * Context.
      * <p/>
      * This method will attempt to lookup the localized message in the
      * parent's messages, which resolves to the Page's resource bundle.
@@ -380,7 +382,7 @@
      * If still not found, this method will return null.
      *
      * @param name the name of the message resource
-     * @return the named localized message, or null if not found
+     * @return the named localized message for the control, or null if not found
      */
     public String getMessage(String name) {
         if (name == null) {
@@ -399,16 +401,17 @@
     }
 
     /**
-     * Return the formatted message for the given resource name,
-     * message format argument and the context request locale, or null
-     * if no message was found.
+     * Return the formatted message for the given resource name and message
+     * format argument or null if no message was found. The resource message
+     * returned will use the Locale obtained from the Context.
      * <p/>
      * {@link #getMessage(java.lang.String, java.lang.Object[])} is invoked to
      * retrieve the message for the specified name.
      *
      * @param name resource name of the message
      * @param arg the message argument to format
-     * @return the named localized message for the control
+     * @return the named localized message for the control or null if no message
+     * was found
      */
     public String getMessage(String name, Object arg) {
         Object[] args = new Object[] { arg };
@@ -416,16 +419,16 @@
     }
 
     /**
-     * Return the formatted message for the given resource name,
-     * message format arguments and the context request locale, or null if
-     * no message was found.
+     * Return the formatted message for the given resource name and message
+     * format arguments or null if no message was found. The resource
+     * message returned will use the Locale obtained from the Context.
      * <p/>
      * {@link #getMessage(java.lang.String)} is invoked to retrieve the message
      * for the specified name.
      *
      * @param name resource name of the message
      * @param args the message arguments to format
-     * @return the named localized message for the package or null if no message
+     * @return the named localized message for the control or null if no message
      * was found
      */
     public String getMessage(String name, Object[] args) {
@@ -437,7 +440,8 @@
     }
 
     /**
-     * Return a Map of localized messages for the control.
+     * Return a Map of localized messages for the control. The messages returned
+     * will use the Locale obtained from the Context.
      *
      * @return a Map of localized messages for the control
      * @throws IllegalStateException if the context for the control has not be set

Modified: incubator/click/trunk/click/framework/src/org/apache/click/control/Field.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/click/framework/src/org/apache/click/control/Field.java?rev=899092&r1=899091&r2=899092&view=diff
==============================================================================
--- incubator/click/trunk/click/framework/src/org/apache/click/control/Field.java (original)
+++ incubator/click/trunk/click/framework/src/org/apache/click/control/Field.java Thu Jan
14 08:04:03 2010
@@ -119,6 +119,16 @@
  * <li>{@link #setErrorMessage(String, Object)}</li>
  * </ul>
  *
+ * Fields automatically pick up localized messages where applicable. Please see
+ * the following methods on how to customize these messages:
+ * <ul>
+ * <li>{@link #getLabel()}</li>
+ * <li>{@link #getTitle()}</li>
+ * <li>{@link #getHelp()}</li>
+ * <li>{@link #setErrorMessage(String)}</li>
+ * <li>{@link #setErrorMessage(String, Object)}</li>
+ * </ul>
+ *
  * <a name="message-resolve-order" href="#"></a>
  * The order in which localized messages resolve are:
  * <dl>



Mime
View raw message