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 2010/07/03 14:01:17 UTC

svn commit: r960207 - in /click/trunk/click/framework/src/org/apache/click: Control.java control/AbstractControl.java

Author: sabob
Date: Sat Jul  3 12:01:16 2010
New Revision: 960207

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

Modified:
    click/trunk/click/framework/src/org/apache/click/Control.java
    click/trunk/click/framework/src/org/apache/click/control/AbstractControl.java

Modified: click/trunk/click/framework/src/org/apache/click/Control.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/src/org/apache/click/Control.java?rev=960207&r1=960206&r2=960207&view=diff
==============================================================================
--- click/trunk/click/framework/src/org/apache/click/Control.java (original)
+++ click/trunk/click/framework/src/org/apache/click/Control.java Sat Jul  3 12:01:16 2010
@@ -468,10 +468,7 @@ public interface Control extends Seriali
 
     public List<Behavior> getBehaviors();
 
-    // What about setCssSelector?
     public String getCssSelector();
 
-    // TODO this method could be changed to both check and return the target
-    // behavior
     public boolean isAjaxTarget(Context context);
 }

Modified: click/trunk/click/framework/src/org/apache/click/control/AbstractControl.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/src/org/apache/click/control/AbstractControl.java?rev=960207&r1=960206&r2=960207&view=diff
==============================================================================
--- click/trunk/click/framework/src/org/apache/click/control/AbstractControl.java (original)
+++ click/trunk/click/framework/src/org/apache/click/control/AbstractControl.java Sat Jul  3 12:01:16 2010
@@ -43,7 +43,6 @@ import org.apache.click.element.Element;
 import org.apache.click.util.ActionListenerAdaptor;
 import org.apache.click.util.ClickUtils;
 import org.apache.click.util.HtmlStringBuffer;
-import org.apache.click.util.MessagesMap;
 
 /**
  * Provides a default implementation of the {@link Control} interface
@@ -286,11 +285,11 @@ public abstract class AbstractControl im
     }
 
     /**
-     * Returns this Control's CSS selector or <tt>null</tt>null if no selector
-     * can be found.
+     * Returns this Control CSS selector or <tt>null</tt>null if no CSS selector
+     * has been defined.
      *
-     * @return this Control's CSS selector or <tt>null</tt> if no selector
-     * can be found.
+     * @return this Control CSS selector or <tt>null</tt> if no CSS selector has
+     * been defined
      */
     public String getCssSelector() {
         // TODO each control could have an optimized version of cssSelector
@@ -300,11 +299,15 @@ public abstract class AbstractControl im
     }
 
     /**
-     * Returns <tt>true</tt> if this is an AJAX control,
-     * <tt>false</tt> otherwise.
+     * Returns <tt>true</tt> if this control is an AJAX target, <tt>false</tt>
+     * otherwise.
+     * <p/>
+     * The control is defined as an Ajax target if the control {@link #getId() ID}
+     * is send as a request parameter.
      *
-     * @param context the Click context.
-     * @return <tt>true</tt> if this is an AJAX control, <tt>false</tt> otherwise.
+     * @param context the request context
+     * @return <tt>true</tt> if this control is an AJAX target, <tt>false</tt>
+     * otherwise
      */
     public boolean isAjaxTarget(Context context) {
         // TODO each control could have an optimized version of isAjaxTarget
@@ -313,7 +316,7 @@ public abstract class AbstractControl im
         // ActionLink
         String id = getId();
         if (id != null) {
-            return context.getRequestParameter(id) != null;
+            return context.hasRequestParameter(id);
         } else {
             return false;
         }