Example usage for org.apache.wicket.markup.html.link BookmarkablePageLink linksTo

List of usage examples for org.apache.wicket.markup.html.link BookmarkablePageLink linksTo

Introduction

In this page you can find the example usage for org.apache.wicket.markup.html.link BookmarkablePageLink linksTo.

Prototype

@Override
public boolean linksTo(final Page page) 

Source Link

Document

Whether this link refers to the given page.

Usage

From source file:org.cdlflex.ui.pages.ExamplePage.java

License:Apache License

@Override
protected void onInitialize() {
    super.onInitialize();

    add(new ListView<LinkItem>("nav-items", links) {
        private static final long serialVersionUID = 1L;

        @Override/*w w  w  .ja  v a  2 s.  com*/
        protected void populateItem(ListItem<LinkItem> item) {
            BookmarkablePageLink<Page> link = item.getModelObject().newLink("link");

            item.add(link);

            if (link.linksTo(getPage())) {
                item.add(new CssClassNameAppender("active"));
            }
        }
    });

    add(newJavaSourcesLink("link-java-sources"));
    add(newHtmlSourcesLink("link-html-sources"));
}