Example usage for org.apache.wicket.markup.html.link ExternalLink setBody

List of usage examples for org.apache.wicket.markup.html.link ExternalLink setBody

Introduction

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

Prototype

public AbstractLink setBody(final IModel<?> bodyModel) 

Source Link

Document

Sets the link's body model

Usage

From source file:net.dontdrinkandroot.wicket.bootstrap.component.item.ExternalLinkItem.java

License:Apache License

@Override
protected Component createLink(String id) {

    ExternalLink link = new ExternalLink(id, this.hrefModel);

    link.add(new AttributeModifier("rel", new AbstractReadOnlyModel<String>() {

        @Override/*from w ww . j a v  a  2s.co m*/
        public String getObject() {

            if (UrlUtils.isRelative(ExternalLinkItem.this.hrefModel.getObject())) {
                return null;
            }
            return "external";
        }
    }));
    link.setBody(this.getModel());
    return link;
}