Class RtfAddableElement

  • All Implemented Interfaces:
    Element, RtfBasicElement, RtfElementInterface
    Direct Known Subclasses:
    RtfDirectContent, RtfShape, RtfShapePosition, RtfShapeProperty, RtfTab, RtfTabGroup

    public abstract class RtfAddableElement
    extends Chunk
    implements RtfBasicElement
    The RtfAddableElement is the superclass for all rtf specific elements that need to be added to an iText document. It is an extension of Chunk and it also implements RtfBasicElement. It is an abstract class thus it cannot be instantiated itself and has to be subclassed to be used.
    Version:
    $Id:RtfAddableElement.java 3126 2008-02-07 20:30:46Z hallm $
    Author:
    Mark Hall (Mark.Hall@mail.room3b.eu), Thomas Bickel (tmb99@inode.at)
    • Field Detail

      • doc

        protected RtfDocument doc
        The RtfDocument this RtfAddableElement belongs to.
      • inTable

        protected boolean inTable
        Whether this RtfAddableElement is contained in a table.
      • inHeader

        protected boolean inHeader
        Whether this RtfAddableElement is contained in a header.
    • Constructor Detail

      • RtfAddableElement

        public RtfAddableElement()
        Constructs a new RtfAddableElement. The Chunk content is set to an empty string and the font to the default Font().
    • Method Detail

      • writeContent

        public abstract void writeContent​(java.io.OutputStream out)
                                   throws java.io.IOException
        Writes the element content to the given output stream.
        Specified by:
        writeContent in interface RtfBasicElement
        Parameters:
        out - The OutputStream to write the content to
        Throws:
        java.io.IOException
      • setRtfDocument

        public void setRtfDocument​(RtfDocument doc)
        Sets the RtfDocument this RtfAddableElement belongs to.
        Specified by:
        setRtfDocument in interface RtfBasicElement
        Parameters:
        doc - The @link{com.lowagie.text.rtf.document.RtfDocument} this RtfElement belongs to
      • setInTable

        public void setInTable​(boolean inTable)
        Sets whether this RtfAddableElement is contained in a table.
        Specified by:
        setInTable in interface RtfBasicElement
        Parameters:
        inTable - Whether this RtfBasicElement is in a table
      • setInHeader

        public void setInHeader​(boolean inHeader)
        Sets whether this RtfAddableElement is contained in a header/footer.
        Specified by:
        setInHeader in interface RtfBasicElement
        Parameters:
        inHeader - Whether this RtfBasicElement is in a header
      • intToByteArray

        public byte[] intToByteArray​(int i)
        Transforms an integer into its String representation and then returns the bytes of that string.
        Parameters:
        i - The integer to convert
        Returns:
        A byte array representing the integer
      • isEmpty

        public boolean isEmpty()
        RtfAddableElement subclasses are never assumed to be empty.
        Overrides:
        isEmpty in class Chunk
        Returns:
        false if the Chunk contains other characters than space.