Class RtfTabGroup

  • All Implemented Interfaces:
    Element, RtfBasicElement, RtfElementInterface

    public class RtfTabGroup
    extends RtfAddableElement
    The RtfTabGroup is a convenience class if the same tabs are to be added to multiple paragraphs.

    RtfTabGroup tabs = new RtfTabGroup();
    tabs.add(new RtfTab(70, RtfTab.TAB_LEFT_ALIGN));
    tabs.add(new RtfTab(160, RtfTab.TAB_CENTER_ALIGN));
    tabs.add(new RtfTab(250, RtfTab.TAB_DECIMAL_ALIGN));
    tabs.add(new RtfTab(500, RtfTab.TAB_RIGHT_ALIGN));
    Paragraph para = new Paragraph();
    para.add(tabs);
    para.add("\tLeft aligned\tCentre aligned\t12,45\tRight aligned");
    Version:
    $Id: RtfTabGroup.java 3373 2008-05-12 16:21:24Z xlv $
    Author:
    Mark Hall (Mark.Hall@mail.room3b.eu), Thomas Bickel (tmb99@inode.at)
    • Field Detail

      • tabs

        private java.util.ArrayList tabs
        The tabs to add.
    • Constructor Detail

      • RtfTabGroup

        public RtfTabGroup()
        Constructs an empty RtfTabGroup.
      • RtfTabGroup

        public RtfTabGroup​(java.util.ArrayList tabs)
        Constructs a RtfTabGroup with a set of tabs.
        Parameters:
        tabs - An ArrayList with the RtfTabs to group in this RtfTabGroup.
    • Method Detail

      • add

        public void add​(RtfTab tab)
        Adds a RtfTab to the list of grouped tabs.
        Parameters:
        tab - The RtfTab to add.
      • writeContent

        public void writeContent​(java.io.OutputStream result)
                          throws java.io.IOException
        Combines the tab output form all grouped tabs.
        Specified by:
        writeContent in interface RtfBasicElement
        Specified by:
        writeContent in class RtfAddableElement
        Parameters:
        result - The OutputStream to write the content to
        Throws:
        java.io.IOException