StyleRange(s).
toString() is guaranteed to return a valid formatted string only after
close() has been called.
Whole and partial lines and line breaks can be written. Lines will be
formatted using the styles queried from the LineStyleListener,
if set, or those set directly in the widget. All styles are applied to
the stream like they are rendered by the widget. In addition, the
widget font name and size is used for the whole text.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final StyledText |
| Access | Constructor and Description |
|---|---|
| public | StyledTextWriterBase(StyledText
the widget to produce the RTF from styledText, int start offset of content to write, 0 based from beginning of document start, int length of content to write length)Creates a writer that processed content starting at offset "start" in the document. |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv abstract String | Returns: the escaped textthe text to escape text)Takes plain text and returns the same text escaped using the rules of the output format. |
| pack-priv abstract void | |
| pack-priv void | writeEscaped(String
string to copy a segment from. Must not contain line breaks.
Line breaks should be written using string, int writeLineDelimiter()start offset of segment. 0 based. start, int end offset of segment end)Appends the specified segment of "string" to the output data. |
| pack-priv abstract void | |
| public void | writeLine(String
line text to write. Must not contain line breaks
Line breaks should be written using line, int writeLineDelimiter(String)offset of the line. 0 based from the start of the
widget document. Any text occurring before the start offset or after the
end offset specified during object creation is ignored. lineOffset)Overrides org. |
| pack-priv void | writeLineEnd(String
the leftover text prepared by prepared)writeLineStartInvoked at the end of of each line in the original widget. |
| pack-priv abstract String | Returns: the text to append at the end of the lineInvoked at the beginning of each line in the original widget. |
| pack-priv void | writeSpanEnd(String
the leftover text prepared by prepared)writeSpanStartInvoked at the end of of each styled span fragment in the original widget. |
| pack-priv abstract String | Returns: the text to append at the end of the styled spanInvoked at the beginning of each styled span fragment in the original widget. |
| pack-priv void | writeStyledLine(String
line text to write as RTF. Must not contain line breaks
Line breaks should be written using writeLineDelimiter() line, int offset of the line. 0 based from the start of the
widget document. Any text occurring before the start offset or after the
end offset specified during object creation is ignored. lineOffset, int[] ranges, StyleRange[] styles to use for formatting. Must not be null. styles, Color line background color to use for formatting.
May be null. lineBackground, int indent, int verticalIndent, int alignment, boolean justify)Appends the specified line text to the output data. |
| styledText | back to summary |
|---|---|
| pack-priv final StyledText styledText | |
| StyledTextWriterBase | back to summary |
|---|---|
| public StyledTextWriterBase(StyledText styledText, int start, int length) Creates a writer that processed content starting at offset "start"
in the document.
| |
| escapeText | back to summary |
|---|---|
| pack-priv abstract String escapeText(String text) Takes plain text and returns the same text escaped using the rules of the output format. | |
| writeEmptyLine | back to summary |
|---|---|
| pack-priv abstract void writeEmptyLine() Invoked at the end of each line, writeLineEnd, if there was no text output. This is needed for HTML, which does not render empty paragraphs. | |
| writeEscaped | back to summary |
|---|---|
| pack-priv void writeEscaped(String string, int start, int end) Appends the specified segment of "string" to the output data.
Copy from
| |
| writeHeader | back to summary |
|---|---|
| pack-priv abstract void writeHeader() Writes the part that only shows once, at the beginning of the output data. | |
| writeLine | back to summary |
|---|---|
| public void writeLine(String line, int lineOffset) Overrides org. Appends the specified line text to the output data. Lines will be formatted using the styles queried from the LineStyleListener, if set, or those set directly in the widget.
| |
| writeLineEnd | back to summary |
|---|---|
| pack-priv void writeLineEnd(String prepared) Invoked at the end of of each line in the original widget. It receives whatever text
| |
| writeLineStart | back to summary |
|---|---|
| pack-priv abstract String writeLineStart(Color lineBackground, int indent, int verticalIndent, int alignment, boolean justify) Invoked at the beginning of each line in the original widget. It should output whatever tags are appropriate to start a new line in the output format.
| |
| writeSpanEnd | back to summary |
|---|---|
| pack-priv void writeSpanEnd(String prepared) Invoked at the end of of each styled span fragment in the original widget. It receives whatever text
| |
| writeSpanStart | back to summary |
|---|---|
| pack-priv abstract String writeSpanStart(StyleRange style) Invoked at the beginning of each styled span fragment in the original widget. It should output whatever tags are appropriate to start a formatted span in the output format.
| |
| writeStyledLine | back to summary |
|---|---|
| pack-priv void writeStyledLine(String line, int lineOffset, int[] ranges, StyleRange[] styles, Color lineBackground, int indent, int verticalIndent, int alignment, boolean justify) Appends the specified line text to the output data. Use the colors and font styles specified in
| |