Class RtfTOCEntry

  • All Implemented Interfaces:
    com.lowagie.text.Element, RtfBasicElement, com.lowagie.text.RtfElementInterface

    public class RtfTOCEntry
    extends RtfField
    The RtfTOCEntry is used together with the RtfTableOfContents to generate a table of contents. Add the RtfTOCEntry in those locations in the document where table of contents entries should link to
    Version:
    $Id: RtfTOCEntry.java 3580 2008-08-06 15:52:00Z howard_s $
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String entry
      The entry text of this RtfTOCEntry
      private boolean showPageNumber
      Whether to show page numbers in the table of contents
      private static byte[] TEXT_HIDDEN_OFF
      Constant for the end of hidden text
      private static byte[] TEXT_HIDDEN_ON
      Constant for the beginning of hidden text
      private static byte[] TOC_ENTRY_NO_PAGE_NUMBER
      Constant for a TOC entry without page numbers
      private static byte[] TOC_ENTRY_PAGE_NUMBER
      Constant for a TOC entry with page numbers
      • Fields inherited from class com.lowagie.text.Chunk

        ACTION, attributes, BACKGROUND, CHAR_SPACING, COLOR, content, ENCODING, GENERICTAG, HSCALE, HYPHENATION, IMAGE, LOCALDESTINATION, LOCALGOTO, NEWLINE, NEWPAGE, NEXTPAGE, OBJECT_REPLACEMENT_CHARACTER, PDFANNOTATION, REMOTEGOTO, SEPARATOR, SKEW, SPLITCHARACTER, SUBSUPSCRIPT, TAB, TEXTRENDERMODE, UNDERLINE
      • Fields inherited from interface com.lowagie.text.Element

        ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_JUSTIFIED, ALIGN_JUSTIFIED_ALL, ALIGN_LEFT, ALIGN_MIDDLE, ALIGN_RIGHT, ALIGN_TOP, ALIGN_UNDEFINED, ANCHOR, ANNOTATION, AUTHOR, CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFBLOCK, CCITT_ENDOFLINE, CCITTG3_1D, CCITTG3_2D, CCITTG4, CELL, CHAPTER, CHUNK, CREATIONDATE, CREATOR, FOOTNOTE, HEADER, IMGRAW, IMGTEMPLATE, JBIG2, JPEG, JPEG2000, KEYWORDS, LIST, LISTITEM, MARKED, MODIFICATIONDATE, MULTI_COLUMN_TEXT, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TABLE, TITLE, YMARK
    • Constructor Summary

      Constructors 
      Constructor Description
      RtfTOCEntry​(java.lang.String entry)
      Constructs a RtfTOCEntry with a certain entry text.
    • Field Detail

      • TEXT_HIDDEN_ON

        private static final byte[] TEXT_HIDDEN_ON
        Constant for the beginning of hidden text
      • TEXT_HIDDEN_OFF

        private static final byte[] TEXT_HIDDEN_OFF
        Constant for the end of hidden text
      • TOC_ENTRY_PAGE_NUMBER

        private static final byte[] TOC_ENTRY_PAGE_NUMBER
        Constant for a TOC entry with page numbers
      • TOC_ENTRY_NO_PAGE_NUMBER

        private static final byte[] TOC_ENTRY_NO_PAGE_NUMBER
        Constant for a TOC entry without page numbers
      • entry

        private java.lang.String entry
        The entry text of this RtfTOCEntry
      • showPageNumber

        private boolean showPageNumber
        Whether to show page numbers in the table of contents
    • Constructor Detail

      • RtfTOCEntry

        public RtfTOCEntry​(java.lang.String entry)
        Constructs a RtfTOCEntry with a certain entry text.
        Parameters:
        entry - The entry text to display
    • Method Detail

      • writeContent

        public void writeContent​(java.io.OutputStream result)
                          throws java.io.IOException
        Writes the content of the RtfTOCEntry.
        Specified by:
        writeContent in interface RtfBasicElement
        Overrides:
        writeContent in class RtfField
        Parameters:
        result - The OutputStream to write to.
        Throws:
        java.io.IOException - on i/o errors.
      • setShowPageNumber

        public void setShowPageNumber​(boolean showPageNumber)
        Sets whether to display a page number in the table of contents, or not
        Parameters:
        showPageNumber - Whether to display a page number or not
      • writeFieldInstContent

        protected void writeFieldInstContent​(java.io.OutputStream out)
                                      throws java.io.IOException
        unused
        Specified by:
        writeFieldInstContent in class RtfField
        Parameters:
        out - The OutputStream to write to.
        Throws:
        java.io.IOException
      • writeFieldResultContent

        protected void writeFieldResultContent​(java.io.OutputStream out)
                                        throws java.io.IOException
        unused
        Specified by:
        writeFieldResultContent in class RtfField
        Parameters:
        out - The OutputStream to write to.
        Throws:
        java.io.IOException - on i/o errors.