Class RtfText
java.lang.Object
org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement
org.apache.fop.render.rtf.rtflib.rtfdoc.RtfText
Model of a text run (a piece of text with attributes) in an RTF document.
This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringconstant for align centerstatic final Stringconstant for align distributedstatic final Stringconstant for align justifiedstatic final Stringconstant for align leftstatic final Stringconstant for align rightstatic final String[]RtfText attributes: this must contain all allignment attributes namesstatic final Stringconstant for background colorstatic final Stringconstant for boldstatic final Stringconstant for font colorstatic final Stringconstant for font familystatic final Stringconstant for font sizestatic final Stringconstant for italicstatic final String[]RtfText attributes: this must contain all attribute namesstatic final Stringconstant for underlinestatic final Stringconstant for subscriptstatic final Stringconstant for superscriptstatic final Stringconstant for underlinestatic final Stringconstant for bottom dashed borderstatic final Stringconstant for bottom dotted borderstatic final Stringconstant for bottom double borderstatic final Stringconstant for bottom embossed borderstatic final Stringconstant for bottom single borderstatic final String[]RtfText attributes:: this must contain all border attribute namesstatic final intConstant for the 100% shading of the paragraphstatic final String[]String array of indent constantsstatic final Stringconstant for left indent bodystatic final Stringconstant for left indent firststatic final Stringconstant for right indent bodystatic final Stringconstant for fieldstatic final Stringconstant for field pagestatic final Stringconstant for field resultstatic final StringConstant for the shading of the paragraphstatic final StringConstant for the document's color tableshading of the paragraphstatic final StringSpace after a paragraphstatic final StringSpace before/after a paragraphstatic final Stringconstant for center tabstatic final Stringconstant for tab leader dotsstatic final Stringconstant for tab leader equalsstatic final Stringconstant for tab leader hyphensstatic final Stringconstant for tab leader thickstatic final Stringconstant for tab leader underscoresstatic final Stringconstant for right tabstatic final String[]String array of tab constantsFields inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement
attrib, parent, writer -
Method Summary
Methods inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement
close, getParentOfClass, getRtfAttributes, newLine, okToWriteRtf, toString, writeAttributes, writeControlWord, writeControlWordNS, writeExceptionInRtf, writeGroupMark, writeOneAttribute, writeOneAttributeNS, writeRtf, writeRtfPrefix, writeRtfSuffix, writeStarControlWord, writeStarControlWordNS
-
Field Details
-
ATTR_BOLD
constant for bold- See Also:
-
ATTR_ITALIC
constant for italic- See Also:
-
ATTR_UNDERLINE
constant for underline- See Also:
-
ATTR_STRIKETHROUGH
constant for underline- See Also:
-
ATTR_FONT_SIZE
constant for font size- See Also:
-
ATTR_FONT_FAMILY
constant for font family- See Also:
-
ATTR_FONT_COLOR
constant for font color- See Also:
-
ATTR_BACKGROUND_COLOR
constant for background color- See Also:
-
ATTR_SUPERSCRIPT
constant for superscript- See Also:
-
ATTR_SUBSCRIPT
constant for subscript- See Also:
-
SHADING
Constant for the shading of the paragraph- See Also:
-
SHADING_FRONT_COLOR
Constant for the document's color tableshading of the paragraph- See Also:
-
FULL_SHADING
public static final int FULL_SHADINGConstant for the 100% shading of the paragraph- See Also:
-
ALIGN_CENTER
constant for align center- See Also:
-
ALIGN_LEFT
constant for align left- See Also:
-
ALIGN_RIGHT
constant for align right- See Also:
-
ALIGN_JUSTIFIED
constant for align justified- See Also:
-
ALIGN_DISTRIBUTED
constant for align distributed- See Also:
-
BDR_BOTTOM_SINGLE
constant for bottom single border- See Also:
-
BDR_BOTTOM_DOUBLE
constant for bottom double border- See Also:
-
BDR_BOTTOM_EMBOSS
constant for bottom embossed border- See Also:
-
BDR_BOTTOM_DOTTED
constant for bottom dotted border- See Also:
-
BDR_BOTTOM_DASH
constant for bottom dashed border- See Also:
-
RTF_FIELD
constant for field- See Also:
-
RTF_FIELD_PAGE
constant for field page- See Also:
-
RTF_FIELD_RESULT
constant for field result- See Also:
-
LEFT_INDENT_BODY
constant for left indent body- See Also:
-
LEFT_INDENT_FIRST
constant for left indent first- See Also:
-
RIGHT_INDENT_BODY
constant for right indent body- See Also:
-
TAB_CENTER
constant for center tab- See Also:
-
TAB_RIGHT
constant for right tab- See Also:
-
TAB_LEADER_DOTS
constant for tab leader dots- See Also:
-
TAB_LEADER_HYPHEN
constant for tab leader hyphens- See Also:
-
TAB_LEADER_UNDER
constant for tab leader underscores- See Also:
-
TAB_LEADER_THICK
constant for tab leader thick- See Also:
-
TAB_LEADER_EQUALS
constant for tab leader equals- See Also:
-
SPACE_BEFORE
Space before/after a paragraph- See Also:
-
SPACE_AFTER
Space after a paragraph- See Also:
-
ALIGNMENT
RtfText attributes: this must contain all allignment attributes names -
BORDER
RtfText attributes:: this must contain all border attribute names -
INDENT
String array of indent constants -
TABS
String array of tab constants -
ATTR_NAMES
RtfText attributes: this must contain all attribute names
-
-
Method Details
-
writeRtfContent
Write our text to the RTF stream- Specified by:
writeRtfContentin classRtfElement- Throws:
IOException- for I/O problems
-
getTextContainerAttributes
IRtfTextContainer requirement:- Returns:
- a copy of our attributes
- Throws:
FOPException- if attributes cannot be cloned
-
isEmpty
public boolean isEmpty()Checks whether the text is empty.- Specified by:
isEmptyin classRtfElement- Returns:
- true If m_text is null\n false m_text is set
-
isNbsp
public boolean isNbsp()True if text contains a single non-breaking space (#160). TODO make this more general and/or merge with isEmpty? -- what happen with empty paragraphs, if they will be removed, than NO, else ok- Returns:
- true If m_text is character 160\n false m_text is not a nbsp
-
isTab
public boolean isTab()- Returns:
- true if the text is a tab character
-
isNewLine
public boolean isNewLine()- Returns:
- true if text is a newline character
-
isBold
public boolean isBold(boolean isStart) - Parameters:
isStart- set to true if processing the start of the text (??)- Returns:
- true if text is bold
-
getTextAttributes
- Returns:
- the attributes of our text
-