Class RtfAnchor

  • All Implemented Interfaces:
    Element, RtfBasicElement, RtfElementInterface

    public class RtfAnchor
    extends RtfField
    The RtfAnchor is the RTF representation of an Anchor object.
    Version:
    $Id: RtfAnchor.java 3580 2008-08-06 15:52:00Z howard_s $
    Author:
    Mark Hall (Mark.Hall@mail.room3b.eu), Werner Daehn (Werner.Daehn@BusinessObjects.com), Thomas Bickel (tmb99@inode.at)
    • Field Detail

      • HYPERLINK

        private static final byte[] HYPERLINK
        Constant for a hyperlink
      • url

        private java.lang.String url
        The url of this RtfAnchor
      • content

        private RtfPhrase content
        The RtfPhrase to display for the url
    • Constructor Detail

      • RtfAnchor

        public RtfAnchor​(RtfDocument doc,
                         Anchor anchor)
        Constructs a RtfAnchor based on a RtfField
        Parameters:
        doc - The RtfDocument this RtfAnchor belongs to
        anchor - The Anchor this RtfAnchor is based on
    • Method Detail

      • writeFieldInstContent

        protected void writeFieldInstContent​(java.io.OutputStream result)
                                      throws java.io.IOException
        Write the field instructions for this RtfAnchor. Sets the field type to HYPERLINK and then writes the url.
        Specified by:
        writeFieldInstContent in class RtfField
        Parameters:
        result - The OutputStream to write to.
        Throws:
        java.io.IOException - on i/o errors.
      • writeFieldResultContent

        protected void writeFieldResultContent​(java.io.OutputStream result)
                                        throws java.io.IOException
        Write the field result for this RtfAnchor. Writes the content of the RtfPhrase.
        Specified by:
        writeFieldResultContent in class RtfField
        Parameters:
        result - The OutputStream to write to.
        Throws:
        java.io.IOException - on i/o errors.