Class RtfStyleSheetTable

java.lang.Object
org.apache.fop.render.rtf.rtflib.rtfdoc.RtfStyleSheetTable

public final class RtfStyleSheetTable extends Object
Singelton of the RTF style sheet table. This class belongs to the jfor:stylesheet tag processing. This work was originally authored by Andreas Putz
  • Field Details

    • startIndex

      private static int startIndex
      Start index number for the stylesheet reference table
    • STATUS_OK

      public static final int STATUS_OK
      OK status value for attribute handling
      See Also:
    • STATUS_DEFAULT

      public static final int STATUS_DEFAULT
      Status value for attribute handling, if the stylesheet not found and the stylesheet set to the default stylesheet
      See Also:
    • STANDARD_STYLE

      private static final String STANDARD_STYLE
      Standard style name
      See Also:
    • instance

      private static RtfStyleSheetTable instance
      Singelton instance
    • styles

      private Hashtable styles
      Table of styles
    • attrTable

      private Hashtable attrTable
      Used, style attributes to this vector
    • nameTable

      private Vector nameTable
      Used, style names to this vector
    • defaultStyleName

      private String defaultStyleName
      Default style
  • Constructor Details

    • RtfStyleSheetTable

      private RtfStyleSheetTable()
      Constructor.
  • Method Details

    • getInstance

      public static RtfStyleSheetTable getInstance()
      Singelton.
      Returns:
      The instance of RtfStyleSheetTable
    • setDefaultStyle

      public void setDefaultStyle(String styleName)
      Sets the default style.
      Parameters:
      styleName - Name of the default style, defined in the stylesheet
    • getDefaultStyleName

      public String getDefaultStyleName()
      Gets the name of the default style.
      Returns:
      Default style name.
    • addStyle

      public void addStyle(String name, RtfAttributes attrs)
      Adds a style to the table.
      Parameters:
      name - Name of style to add
      attrs - Rtf attributes which defines the style
    • addStyleToAttributes

      public int addStyleToAttributes(String name, RtfAttributes attr)
      Adds the style attributes to the given attributes.
      Parameters:
      name - Name of style, of which the attributes will copied to attr
      attr - Default rtf attributes
      Returns:
      Status value
    • writeStyleSheet

      public void writeStyleSheet(RtfHeader header) throws IOException
      Writes the rtf style sheet table.
      Parameters:
      header - Rtf header is the parent
      Throws:
      IOException - On write error
    • getRtfStyleReference

      private String getRtfStyleReference(String name)
      Gets the rtf style reference from the table.
      Parameters:
      name - Name of Style
      Returns:
      Rtf attribute of the style reference