Class RtfTextrun
java.lang.Object
org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement
org.apache.fop.render.rtf.rtflib.rtfdoc.RtfContainer
org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTextrun
- Direct Known Subclasses:
RtfListItem.RtfListItemLabel
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).
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Constant for a column breakstatic final int
Constant for a even page breakstatic final int
Constant for no page breakstatic final int
Constant for a odd page breakstatic final int
Constant for a normal page breakprotected static final org.apache.commons.logging.Log
logging instanceFields inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement
attrib, parent, writer
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addBookmark
(String id) Inserts a bookmark.Inserts a footnote.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.Inserts paragraph break before all close group marks.void
Add string to children list.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.newImage()
Inserts an image.void
popBlockAttributes
(int breakType) Pops block attributes, notifies all opened blocks about pushing block attributes, addsCloseGroupMark
as a child.void
Pop inline attributes.void
pushBlockAttributes
(RtfAttributes attrs) Pushes block attributes, notifies all opened blocks about pushing block attributes, addsOpenGroupMark
as a child.void
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
write RTF code of all our childrenMethods inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfContainer
addChild, findChildren, getChildCount, getChildren, isEmpty, okToWriteRtf, setChildren, setOptions, toString
Methods inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement
close, getParentOfClass, getRtfAttributes, newLine, writeAttributes, writeControlWord, writeControlWordNS, writeExceptionInRtf, writeGroupMark, writeOneAttribute, writeOneAttributeNS, writeRtf, writeRtfPrefix, writeRtfSuffix, writeStarControlWord, writeStarControlWordNS
-
Field Details
-
BREAK_NONE
public static final int BREAK_NONEConstant for no page break- See Also:
-
BREAK_PAGE
public static final int BREAK_PAGEConstant for a normal page break- See Also:
-
BREAK_COLUMN
public static final int BREAK_COLUMNConstant for a column break- See Also:
-
BREAK_EVEN_PAGE
public static final int BREAK_EVEN_PAGEConstant for a even page break- See Also:
-
BREAK_ODD_PAGE
public static final int BREAK_ODD_PAGEConstant for a odd page break- See Also:
-
log
protected static final org.apache.commons.logging.Log loglogging instance
-
-
Method Details
-
pushBlockAttributes
Pushes block attributes, notifies all opened blocks about pushing block attributes, addsOpenGroupMark
as a child.- Parameters:
attrs
- the block attributes to push- Throws:
IOException
- for I/O problems
-
popBlockAttributes
Pops block attributes, notifies all opened blocks about pushing block attributes, addsCloseGroupMark
as a child.- Parameters:
breakType
- the break type- Throws:
IOException
- for I/O problems
-
pushInlineAttributes
Pushes inline attributes.- Parameters:
attrs
- the inline attributes to push- Throws:
IOException
- for I/O problems
-
addPageNumberCitation
Inserts a page number citation.- Parameters:
refId
- the identifier being referenced- Throws:
IOException
- for I/O problems
-
popInlineAttributes
Pop inline attributes.- Throws:
IOException
- for I/O problems
-
addString
Add string to children list.- Parameters:
s
- string to add- Throws:
IOException
- for I/O problems
-
addFootnote
Inserts a footnote.- Returns:
- inserted footnote
- Throws:
IOException
- for I/O problems
-
addParagraphBreak
Inserts paragraph break before all close group marks.- Returns:
- The paragraph break element
- Throws:
IOException
- for I/O problems
-
addLeader
Inserts a leader.- Parameters:
attrs
- Attributes for the leader- Throws:
IOException
- for I/O problems
-
addPageNumber
Inserts a page number.- Parameters:
attr
- Attributes for the page number to insert.- Throws:
IOException
- for I/O problems
-
addHyperlink
Inserts a hyperlink.- Parameters:
attr
- Attributes for the hyperlink to insert.- Returns:
- inserted hyperlink
- Throws:
IOException
- for I/O problems
-
addBookmark
Inserts a bookmark.- Parameters:
id
- Id for the inserted bookmark- Throws:
IOException
- for I/O problems
-
newImage
Inserts an image.- Returns:
- inserted image
- Throws:
IOException
- for I/O problems
-
getTextrun
public static RtfTextrun getTextrun(RtfContainer container, Writer writer, RtfAttributes attrs) throws IOException Adds a new RtfTextrun to the given container if necessary, and returns it.- Parameters:
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 RtfTextrun- Returns:
- new or existing RtfTextrun object.
- Throws:
IOException
- for I/O problems
-
setSuppressLastPar
public void setSuppressLastPar(boolean bSuppress) specify, if the last paragraph control word (\par) should be suppressed.- Parameters:
bSuppress
- true, if the last \par should be suppressed
-
writeRtfContent
write RTF code of all our children- Overrides:
writeRtfContent
in classRtfContainer
- Throws:
IOException
- for I/O problems
-
setRtfListItem
Set the parent list-item of the textrun.- Parameters:
listItem
- parent list-item of the textrun
-
getRtfListItem
Gets the parent list-item of the textrun.- Returns:
- parent list-item of the textrun
-