You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by eh...@apache.org on 2007/04/03 20:30:41 UTC
svn commit: r525235 -
/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/link/PageLink.java
Author: ehillenius
Date: Tue Apr 3 11:30:40 2007
New Revision: 525235
URL: http://svn.apache.org/viewvc?view=rev&rev=525235
Log:
added warning and deprecation
Modified:
incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/link/PageLink.java
Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/link/PageLink.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/link/PageLink.java?view=diff&rev=525235&r1=525234&r2=525235
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/link/PageLink.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/markup/html/link/PageLink.java Tue Apr 3 11:30:40 2007
@@ -33,7 +33,7 @@
public class PageLink extends Link
{
private static final long serialVersionUID = 1L;
-
+
/** The delayed linking Page source. */
private final IPageLink pageLink;
@@ -74,15 +74,43 @@
}
/**
+ * This constructor is ideal for constructing pages lazily.
+ *
+ * Constructs a link which invokes the getPage() method of the IPageLink
+ * interface when the link is clicked. Whatever Page objects is returned by
+ * this method will be rendered back to the user.
+ *
+ * @param id
+ * See Component
+ * @param pageLink
+ * An implementation of IPageLink which will create the page
+ * linked to if and when this hyperlink is clicked at a later
+ * time.
+ */
+ public PageLink(final String id, final IPageLink pageLink)
+ {
+ super(id);
+ this.pageLink = pageLink;
+ }
+
+ /**
* This constructor is ideal if a Page object was passed in from a previous
- * Page. Construct a link to the Page.
- *
- * @param id See component
- * @param page The page
+ * Page. Construct a link to the Page. Warning: DO NOT use this for
+ * constructing links to pages you didn't already have an instance of. This
+ * constructor is strongly discouraged for anything other than linking back
+ * to the same page.
+ *
+ * @param id
+ * See component
+ * @param page
+ * The page
+ * @deprecated rather than using this class/ constructor, use normal
+ * {@link Link links} and call setResponsePage in their
+ * {@link Link#onClick() onClick} methods.
*/
public PageLink(final String id, final Page page)
{
- super(id);
+ super(id);
this.pageLink = new IPageLink()
{
@@ -99,26 +127,6 @@
return page.getClass();
}
};
- }
-
- /**
- * This constructor is ideal for constructing pages lazily.
- *
- * Constructs a link which invokes the getPage() method of the IPageLink
- * interface when the link is clicked. Whatever Page objects is returned by
- * this method will be rendered back to the user.
- *
- * @param id
- * See Component
- * @param pageLink
- * An implementation of IPageLink which will create the page
- * linked to if and when this hyperlink is clicked at a later
- * time.
- */
- public PageLink(final String id, final IPageLink pageLink)
- {
- super(id);
- this.pageLink = pageLink;
}
/**