Class RtfStyleSheetTable
java.lang.Object
org.apache.fop.render.rtf.rtflib.rtfdoc.RtfStyleSheetTable
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
FieldsModifier and TypeFieldDescriptionprivate HashtableUsed, style attributes to this vectorprivate StringDefault styleprivate static RtfStyleSheetTableSingelton instanceprivate VectorUsed, style names to this vectorprivate static final StringStandard style nameprivate static intStart index number for the stylesheet reference tablestatic final intStatus value for attribute handling, if the stylesheet not found and the stylesheet set to the default stylesheetstatic final intOK status value for attribute handlingprivate HashtableTable of styles -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddStyle(String name, RtfAttributes attrs) Adds a style to the table.intaddStyleToAttributes(String name, RtfAttributes attr) Adds the style attributes to the given attributes.Gets the name of the default style.static RtfStyleSheetTableSingelton.private StringgetRtfStyleReference(String name) Gets the rtf style reference from the table.voidsetDefaultStyle(String styleName) Sets the default style.voidwriteStyleSheet(RtfHeader header) Writes the rtf style sheet table.
-
Field Details
-
startIndex
private static int startIndexStart index number for the stylesheet reference table -
STATUS_OK
public static final int STATUS_OKOK status value for attribute handling- See Also:
-
STATUS_DEFAULT
public static final int STATUS_DEFAULTStatus value for attribute handling, if the stylesheet not found and the stylesheet set to the default stylesheet- See Also:
-
STANDARD_STYLE
Standard style name- See Also:
-
instance
Singelton instance -
styles
Table of styles -
attrTable
Used, style attributes to this vector -
nameTable
Used, style names to this vector -
defaultStyleName
Default style
-
-
Constructor Details
-
RtfStyleSheetTable
private RtfStyleSheetTable()Constructor.
-
-
Method Details
-
getInstance
Singelton.- Returns:
- The instance of RtfStyleSheetTable
-
setDefaultStyle
Sets the default style.- Parameters:
styleName- Name of the default style, defined in the stylesheet
-
getDefaultStyleName
Gets the name of the default style.- Returns:
- Default style name.
-
addStyle
Adds a style to the table.- Parameters:
name- Name of style to addattrs- Rtf attributes which defines the style
-
addStyleToAttributes
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
Writes the rtf style sheet table.- Parameters:
header- Rtf header is the parent- Throws:
IOException- On write error
-
getRtfStyleReference
Gets the rtf style reference from the table.- Parameters:
name- Name of Style- Returns:
- Rtf attribute of the style reference
-