You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by jd...@apache.org on 2007/05/12 16:19:22 UTC

svn commit: r537434 - /incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/link/Link.java

Author: jdonnerstag
Date: Sat May 12 07:19:21 2007
New Revision: 537434

URL: http://svn.apache.org/viewvc?view=rev&rev=537434
Log:
wicket-328: Link#setAnchor return Link instead of void

fixed

Modified:
    incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/link/Link.java

Modified: incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/link/Link.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/link/Link.java?view=diff&rev=537434&r1=537433&r2=537434
==============================================================================
--- incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/link/Link.java (original)
+++ incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/link/Link.java Sat May 12 07:19:21 2007
@@ -36,25 +36,25 @@
  * You can use a link like:
  * 
  * <pre>
- *                        add(new Link(&quot;myLink&quot;)
- *                        {
- *                            public void onClick(RequestCycle cycle)
- *                            {
- *                                // do something here...  
- *                            }
- *                        );
+ * add(new Link(&quot;myLink&quot;)
+ * {
+ *     public void onClick(RequestCycle cycle)
+ *     {
+ *         // do something here...  
+ *     }
+ * );
  * </pre>
  * 
  * and in your HTML file:
  * 
  * <pre>
- *                        &lt;a href=&quot;#&quot; wicket:id=&quot;myLink&quot;&gt;click here&lt;/a&gt;
+ *  &lt;a href=&quot;#&quot; wicket:id=&quot;myLink&quot;&gt;click here&lt;/a&gt;
  * </pre>
  * 
  * or:
  * 
  * <pre>
- *                        &lt;td wicket:id=&quot;myLink&quot;&gt;my clickable column&lt;/td&gt;
+ *  &lt;td wicket:id=&quot;myLink&quot;&gt;my clickable column&lt;/td&gt;
  * </pre>
  * 
  * </p>
@@ -62,13 +62,13 @@
  * the Page to the Page responded by the Link.
  * 
  * <pre>
- *                        add(new Link(&quot;link&quot;, listItem.getModel()) 
- *                        {
- *                            public void onClick() 
- *                            {
- *                                MyObject obj = (MyObject)getModelObject();
- *                                setResponsePage(new MyPage(obj.getId(), ... ));
- *                            }
+ * add(new Link(&quot;link&quot;, listItem.getModel()) 
+ * {
+ *     public void onClick() 
+ *     {
+ *         MyObject obj = (MyObject)getModelObject();
+ *         setResponsePage(new MyPage(obj.getId(), ... ));
+ *     }
  * </pre>
  * 
  * @author Jonathan Locke
@@ -222,7 +222,6 @@
 		onClick();
 	}
 
-
 	/**
 	 * Sets an anchor component. An anchor (form
 	 * 'http://server/app/etc#someAnchor') will be appended to the link so that
@@ -234,11 +233,13 @@
 	 * 
 	 * @param anchor
 	 *            The anchor
+	 * @return this
 	 */
-	public void setAnchor(Component anchor)
+	public Link setAnchor(Component anchor)
 	{
 		addStateChange(new AnchorChange(this.anchor));
 		this.anchor = anchor;
+		return this;
 	}
 
 	/**
@@ -468,5 +469,4 @@
 		}
 
 	}
-
 }