public class RtfTextrun extends RtfContainer
Class which contains a linear text run. It has methods to add attributes, text, paragraph breaks....
This work was authored by Peter Herweg (pherweg@web.de).
| Modifier and Type | Field and Description |
|---|---|
static int |
BREAK_COLUMN
Constant for a column break
|
static int |
BREAK_EVEN_PAGE
Constant for a even page break
|
static int |
BREAK_NONE
Constant for no page break
|
static int |
BREAK_ODD_PAGE
Constant for a odd page break
|
static int |
BREAK_PAGE
Constant for a normal page break
|
protected static org.apache.commons.logging.Log |
log
logging instance
|
attrib, parent, writer| Modifier and Type | Method and Description |
|---|---|
void |
addBookmark(String id)
Inserts a bookmark.
|
RtfFootnote |
addFootnote()
Inserts a footnote.
|
RtfHyperLink |
addHyperlink(RtfAttributes attr)
Inserts a hyperlink.
|
void |
addLeader(RtfAttributes attrs)
Inserts a leader.
|
void |
addPageNumber(RtfAttributes attr)
Inserts a page number.
|
void |
addPageNumberCitation(String refId)
Inserts a page number citation.
|
RtfParagraphBreak |
addParagraphBreak()
Inserts paragraph break before all close group marks.
|
void |
addString(String s)
Add string to children list.
|
RtfListItem |
getRtfListItem()
Gets the parent list-item of the textrun.
|
static RtfTextrun |
getTextrun(RtfContainer container,
Writer writer,
RtfAttributes attrs)
Adds a new RtfTextrun to the given container if necessary, and returns it.
|
RtfExternalGraphic |
newImage()
Inserts an image.
|
void |
popBlockAttributes(int breakType)
Pops block attributes, notifies all opened blocks about pushing block
attributes, adds
CloseGroupMark as a child. |
void |
popInlineAttributes()
Pop inline attributes.
|
void |
pushBlockAttributes(RtfAttributes attrs)
Pushes block attributes, notifies all opened blocks about pushing block
attributes, adds
OpenGroupMark as a child. |
void |
pushInlineAttributes(RtfAttributes attrs)
Pushes inline attributes.
|
void |
setRtfListItem(RtfListItem listItem)
Set the parent list-item of the textrun.
|
void |
setSuppressLastPar(boolean bSuppress)
specify, if the last paragraph control word (\par) should be suppressed.
|
protected void |
writeRtfContent()
write RTF code of all our children
|
addChild, findChildren, getChildCount, getChildren, isEmpty, okToWriteRtf, setChildren, setOptions, toStringclose, getParentOfClass, getRtfAttributes, newLine, writeAttributes, writeControlWord, writeControlWordNS, writeExceptionInRtf, writeGroupMark, writeOneAttribute, writeOneAttributeNS, writeRtf, writeRtfPrefix, writeRtfSuffix, writeStarControlWord, writeStarControlWordNSpublic static final int BREAK_NONE
public static final int BREAK_PAGE
public static final int BREAK_COLUMN
public static final int BREAK_EVEN_PAGE
public static final int BREAK_ODD_PAGE
protected static final org.apache.commons.logging.Log log
public void pushBlockAttributes(RtfAttributes attrs) throws IOException
OpenGroupMark as a child.attrs - the block attributes to pushIOException - for I/O problemspublic void popBlockAttributes(int breakType)
throws IOException
CloseGroupMark as a child.breakType - the break typeIOException - for I/O problemspublic void pushInlineAttributes(RtfAttributes attrs) throws IOException
attrs - the inline attributes to pushIOException - for I/O problemspublic void addPageNumberCitation(String refId) throws IOException
refId - the identifier being referencedIOException - for I/O problemspublic void popInlineAttributes()
throws IOException
IOException - for I/O problemspublic void addString(String s) throws IOException
s - string to addIOException - for I/O problemspublic RtfFootnote addFootnote() throws IOException
IOException - for I/O problemspublic RtfParagraphBreak addParagraphBreak() throws IOException
IOException - for I/O problemspublic void addLeader(RtfAttributes attrs) throws IOException
attrs - Attributes for the leaderIOException - for I/O problemspublic void addPageNumber(RtfAttributes attr) throws IOException
attr - Attributes for the page number to insert.IOException - for I/O problemspublic RtfHyperLink addHyperlink(RtfAttributes attr) throws IOException
attr - Attributes for the hyperlink to insert.IOException - for I/O problemspublic void addBookmark(String id) throws IOException
id - Id for the inserted bookmarkIOException - for I/O problemspublic RtfExternalGraphic newImage() throws IOException
IOException - for I/O problemspublic static RtfTextrun getTextrun(RtfContainer container, Writer writer, RtfAttributes attrs) throws IOException
container - RtfContainer, which is the parent of the returned RtfTextrunwriter - Writer of the given RtfContainerattrs - RtfAttributes which are to write at the beginning of the RtfTextrunIOException - for I/O problemspublic void setSuppressLastPar(boolean bSuppress)
bSuppress - true, if the last \par should be suppressedprotected void writeRtfContent()
throws IOException
writeRtfContent in class RtfContainerIOException - for I/O problemspublic void setRtfListItem(RtfListItem listItem)
listItem - parent list-item of the textrunpublic RtfListItem getRtfListItem()
Copyright © 2023 Apache Software Foundation. All rights reserved.