Example usage for com.lowagie.text ElementTags REFERENCE

List of usage examples for com.lowagie.text ElementTags REFERENCE

Introduction

In this page you can find the example usage for com.lowagie.text ElementTags REFERENCE.

Prototype

String REFERENCE

To view the source code for com.lowagie.text ElementTags REFERENCE.

Click Source Link

Document

attribute of anchor tag

Usage

From source file:org.apache.maven.doxia.module.itext.ITextSink.java

License:Apache License

/** {@inheritDoc} */
public void link(String name) {
    if (name == null) {
        throw new NullPointerException("Link name cannot be null!");
    }//from   ww w.j a v  a  2s .  co  m

    font.setColor(Color.BLUE);
    font.addUnderlined();

    writeStartElement(ElementTags.ANCHOR);
    if (StringUtils.isNotEmpty(name) && name.startsWith("#") && StringUtils.isNotEmpty(header.getTitle())) {
        name = "#" + DoxiaUtils.encodeId(header.getTitle(), true) + "_" + name.substring(1);
    }
    writeAddAttribute(ElementTags.REFERENCE, HtmlTools.escapeHTML(name));
    writeAddAttribute(ElementTags.FONT, font.getFontName());
    writeAddAttribute(ElementTags.SIZE, font.getFontSize());
    writeAddAttribute(ElementTags.STYLE, font.getFontStyle());
    writeAddAttribute(ElementTags.BLUE, font.getFontColorBlue());
    writeAddAttribute(ElementTags.GREEN, font.getFontColorGreen());
    writeAddAttribute(ElementTags.RED, font.getFontColorRed());

    actionContext.setAction(SinkActionContext.LINK);
}