Example usage for com.google.gwt.dom.client AnchorElement setRel

List of usage examples for com.google.gwt.dom.client AnchorElement setRel

Introduction

In this page you can find the example usage for com.google.gwt.dom.client AnchorElement setRel.

Prototype

public void setRel(String rel) 

Source Link

Document

Forward link type.

Usage

From source file:org.xwiki.gwt.wysiwyg.client.plugin.link.LinkConfigDOMWriter.java

License:Open Source License

/**
 * {@inheritDoc}/* w w  w  .j  a v a 2  s.  c  o m*/
 * 
 * @see ConfigDOMWriter#write(Object, com.google.gwt.dom.client.Element)
 */
public void write(LinkConfig config, AnchorElement anchor) {
    // Required attributes.
    updateMetaData(anchor, config.getReference(), config.getType());
    anchor.setHref(config.getUrl());
    // Optional attributes.
    updateAttribute(anchor, "title", config.getTooltip());
    if (config.isOpenInNewWindow()) {
        anchor.setRel(TARGET_BLANK);
    } else if (TARGET_BLANK.equalsIgnoreCase(anchor.getRel())) {
        anchor.removeAttribute("rel");
    }
    // Update the content.
    if (!anchor.getInnerHTML().equals(config.getLabel())) {
        // Inner HTML listeners have to be notified in order to extract the meta data.
        Element.as(anchor).xSetInnerHTML(config.getLabel());
    }
}