Example usage for org.apache.wicket.request UrlUtils isRelative

List of usage examples for org.apache.wicket.request UrlUtils isRelative

Introduction

In this page you can find the example usage for org.apache.wicket.request UrlUtils isRelative.

Prototype

public static boolean isRelative(final String url) 

Source Link

Document

Checks if the url is relative or absolute

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 www.ja va  2 s. c o m*/
        public String getObject() {

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