Class RtfStyleSheetTable
- java.lang.Object
-
- org.apache.fop.render.rtf.rtflib.rtfdoc.RtfStyleSheetTable
-
public final class RtfStyleSheetTable extends java.lang.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 Summary
Fields Modifier and Type Field Description private java.util.Hashtable
attrTable
Used, style attributes to this vectorprivate java.lang.String
defaultStyleName
Default styleprivate static RtfStyleSheetTable
instance
Singelton instanceprivate java.util.Vector
nameTable
Used, style names to this vectorprivate static java.lang.String
STANDARD_STYLE
Standard style nameprivate static int
startIndex
Start index number for the stylesheet reference tablestatic int
STATUS_DEFAULT
Status value for attribute handling, if the stylesheet not found and the stylesheet set to the default stylesheetstatic int
STATUS_OK
OK status value for attribute handlingprivate java.util.Hashtable
styles
Table of styles
-
Constructor Summary
Constructors Modifier Constructor Description private
RtfStyleSheetTable()
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addStyle(java.lang.String name, RtfAttributes attrs)
Adds a style to the table.int
addStyleToAttributes(java.lang.String name, RtfAttributes attr)
Adds the style attributes to the given attributes.java.lang.String
getDefaultStyleName()
Gets the name of the default style.static RtfStyleSheetTable
getInstance()
Singelton.private java.lang.String
getRtfStyleReference(java.lang.String name)
Gets the rtf style reference from the table.void
setDefaultStyle(java.lang.String styleName)
Sets the default style.void
writeStyleSheet(RtfHeader header)
Writes the rtf style sheet table.
-
-
-
Field Detail
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
STANDARD_STYLE
private static final java.lang.String STANDARD_STYLE
Standard style name- See Also:
- Constant Field Values
-
instance
private static RtfStyleSheetTable instance
Singelton instance
-
styles
private java.util.Hashtable styles
Table of styles
-
attrTable
private java.util.Hashtable attrTable
Used, style attributes to this vector
-
nameTable
private java.util.Vector nameTable
Used, style names to this vector
-
defaultStyleName
private java.lang.String defaultStyleName
Default style
-
-
Method Detail
-
getInstance
public static RtfStyleSheetTable getInstance()
Singelton.- Returns:
- The instance of RtfStyleSheetTable
-
setDefaultStyle
public void setDefaultStyle(java.lang.String styleName)
Sets the default style.- Parameters:
styleName
- Name of the default style, defined in the stylesheet
-
getDefaultStyleName
public java.lang.String getDefaultStyleName()
Gets the name of the default style.- Returns:
- Default style name.
-
addStyle
public void addStyle(java.lang.String name, RtfAttributes attrs)
Adds a style to the table.- Parameters:
name
- Name of style to addattrs
- Rtf attributes which defines the style
-
addStyleToAttributes
public int addStyleToAttributes(java.lang.String name, RtfAttributes attr)
Adds the style attributes to the given attributes.- Parameters:
name
- Name of style, of which the attributes will copied to attrattr
- Default rtf attributes- Returns:
- Status value
-
writeStyleSheet
public void writeStyleSheet(RtfHeader header) throws java.io.IOException
Writes the rtf style sheet table.- Parameters:
header
- Rtf header is the parent- Throws:
java.io.IOException
- On write error
-
getRtfStyleReference
private java.lang.String getRtfStyleReference(java.lang.String name)
Gets the rtf style reference from the table.- Parameters:
name
- Name of Style- Returns:
- Rtf attribute of the style reference
-
-