|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
PageProvider
@Deprecated public interface IPageLink
Interface that is used to implement delayed page linking. The getPage() method returns an instance of Page when a link is actually clicked (thus avoiding the need to create a destination Page object for every link on a given Page in advance). The getPageIdentity() method returns the subclass of Page that getPage() will return if and when it is called.
This way of arranging things is useful in determining whether a link links to a given page, which is in turn useful for deciding how to display the link (because links in a navigation which link to a page itself are not useful and generally should instead indicate where the user is in the navigation).
To understand how getPageIdentity() is used in this way, take a look at the Link.linksTo() method and its override in PageLink. Also, see the documentation for getPageIdentity() below.
Link.linksTo(Page)
Method Summary | |
---|---|
Page |
getPage()
Deprecated. Gets the page to go to. |
Class<? extends Page> |
getPageIdentity()
Deprecated. Gets the class of the destination page, which serves as a form of identity that can be used to determine if a link is on the same Page that it links to. |
Method Detail |
---|
Page getPage()
Class<? extends Page> getPageIdentity()
A page's identity is important because links which are on the same page that they link to often need to be displayed in a different way to indicate that they are 'disabled' and don't go anywhere. Links can be manually disabled by calling Link.setDisabled(). Links which have setAutoEnable(true) will automatically enable or disable themselves depending on whether or not Link.linksTo() returns true. The default implementation of PageLink.linksTo() therefore looks like this:
private final IPageLink pageLink; public boolean linksTo(final Page page) { return page.getClass() == pageLink.getPageIdentity(); }
Link.linksTo(Page)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |