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("myLink") - * { - * public void onClick(RequestCycle cycle) - * { - * // do something here... - * } - * ); + * add(new Link("myLink") + * { + * public void onClick(RequestCycle cycle) + * { + * // do something here... + * } + * ); * </pre> * * and in your HTML file: * * <pre> - * <a href="#" wicket:id="myLink">click here</a> + * <a href="#" wicket:id="myLink">click here</a> * </pre> * * or: * * <pre> - * <td wicket:id="myLink">my clickable column</td> + * <td wicket:id="myLink">my clickable column</td> * </pre> * * </p> @@ -62,13 +62,13 @@ * the Page to the Page responded by the Link. * * <pre> - * add(new Link("link", listItem.getModel()) - * { - * public void onClick() - * { - * MyObject obj = (MyObject)getModelObject(); - * setResponsePage(new MyPage(obj.getId(), ... )); - * } + * add(new Link("link", 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 @@ } } - }