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).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classClass which represents the closing of a RTF group mark.private classClass which represents the opening of a RTF group mark. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intConstant for a column breakstatic final intConstant for a even page breakstatic final intConstant for no page breakstatic final intConstant for a odd page breakstatic final intConstant for a normal page breakprivate booleanprotected static final org.apache.commons.logging.Loglogging instanceprivate RtfListItemprivate RtfSpaceManagerManager for handling space-* property.Fields inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement
attrib, parent, writer -
Constructor Summary
ConstructorsConstructorDescriptionRtfTextrun(RtfContainer parent, Writer w, RtfAttributes attrs) Create an RTF container as a child of given container -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBookmark(String id) Inserts a bookmark.private voidAdds instance ofCloseGroupMarkas a child, but without a break option.private voidaddCloseGroupMark(int breakType) Adds instance ofCloseGroupMarkas a child.Inserts a footnote.addHyperlink(RtfAttributes attr) Inserts a hyperlink.voidaddLeader(RtfAttributes attrs) Inserts a leader.private voidaddOpenGroupMark(RtfAttributes attrs) Adds instance ofOpenGroupMarkas a child with attributes.voidaddPageNumber(RtfAttributes attr) Inserts a page number.voidaddPageNumberCitation(String refId) Inserts a page number citation.Inserts paragraph break before all close group marks.voidAdd string to children list.Gets the parent list-item of the textrun.static RtfTextrungetTextrun(RtfContainer container, Writer writer, RtfAttributes attrs) Adds a new RtfTextrun to the given container if necessary, and returns it.newImage()Inserts an image.voidpopBlockAttributes(int breakType) Pops block attributes, notifies all opened blocks about pushing block attributes, addsCloseGroupMarkas a child.voidPop inline attributes.voidpushBlockAttributes(RtfAttributes attrs) Pushes block attributes, notifies all opened blocks about pushing block attributes, addsOpenGroupMarkas a child.voidPushes inline attributes.voidsetRtfListItem(RtfListItem listItem) Set the parent list-item of the textrun.voidsetSuppressLastPar(boolean bSuppress) specify, if the last paragraph control word (\par) should be suppressed.protected voidwrite RTF code of all our childrenMethods inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfContainer
addChild, containsText, dump, findChildren, getChildCount, getChildren, getOptions, isEmpty, okToWriteRtf, setChildren, setOptions, toStringMethods inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement
close, getParentOfClass, getRtfAttributes, getRtfFile, isClosed, 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:
-
bSuppressLastPar
private boolean bSuppressLastPar -
rtfListItem
-
log
protected static final org.apache.commons.logging.Log loglogging instance -
rtfSpaceManager
Manager for handling space-* property.
-
-
Constructor Details
-
RtfTextrun
RtfTextrun(RtfContainer parent, Writer w, RtfAttributes attrs) throws IOException Create an RTF container as a child of given container- Throws:
IOException
-
-
Method Details
-
addOpenGroupMark
Adds instance ofOpenGroupMarkas a child with attributes.- Parameters:
attrs- attributes to add- Throws:
IOException- for I/O problems
-
addCloseGroupMark
Adds instance ofCloseGroupMarkas a child.- Throws:
IOException- for I/O problems
-
addCloseGroupMark
Adds instance ofCloseGroupMarkas a child, but without a break option. Inline attributes do not need that for example- Throws:
IOException- for I/O problems
-
pushBlockAttributes
Pushes block attributes, notifies all opened blocks about pushing block attributes, addsOpenGroupMarkas 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, addsCloseGroupMarkas 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:
writeRtfContentin 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
-