Class RtfParagraph
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.RtfBookmarkContainerImpl
org.apache.fop.render.rtf.rtflib.rtfdoc.RtfParagraph
- All Implemented Interfaces:
IRtfBookmarkContainer
,IRtfExternalGraphicContainer
,IRtfHyperLinkContainer
,IRtfPageBreakContainer
,IRtfPageNumberCitationContainer
,IRtfPageNumberContainer
,IRtfTextContainer
public class RtfParagraph
extends RtfBookmarkContainerImpl
implements IRtfTextContainer, IRtfPageBreakContainer, IRtfHyperLinkContainer, IRtfExternalGraphicContainer, IRtfPageNumberContainer, IRtfPageNumberCitationContainer
Model of an RTF paragraph, which can contain RTF text elements.
This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch), Andreas Putz (a.putz@skynamics.com), and Boris Poudérous (boris.pouderous@free.fr).
-
Field Summary
Fields inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement
attrib, parent, writer
-
Method Summary
Modifier and TypeMethodDescriptiongetText()
Accessor for the paragraph textaccessor for text attributesIRtfTextContainer requirement: return a copy of our attributesnewHyperLink
(String str, RtfAttributes attr) Creates a new hyperlink.newImage()
Start a new external graphic after closing all other elementsvoid
add a line breakvoid
add a page breakAdd a page numberAdded by Boris POUDEROUS on 2002/07/09Close current text run if any and start a new one with default attributesnewText
(String str, RtfAttributes attr) Close current text run if any and start a new oneprotected boolean
Depending on RtfOptions, do not emit any RTF for empty paragraphsvoid
setKeepn()
Set the keepn attribute for this paragraphvoid
Force reset propertiesprotected void
Overridden to write our attributes before our contentprotected void
Overridden to close paragraphMethods inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfBookmarkContainerImpl
newBookmark
Methods inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfContainer
addChild, findChildren, getChildCount, getChildren, isEmpty, setChildren, setOptions, toString, writeRtfContent
Methods inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement
close, getParentOfClass, getRtfAttributes, newLine, writeAttributes, writeControlWord, writeControlWordNS, writeExceptionInRtf, writeGroupMark, writeOneAttribute, writeOneAttributeNS, writeRtf, writeStarControlWord, writeStarControlWordNS
-
Method Details
-
getText
Accessor for the paragraph text- Returns:
- the paragraph text
-
setKeepn
public void setKeepn()Set the keepn attribute for this paragraph -
setResetProperties
public void setResetProperties()Force reset properties -
getTextContainerAttributes
IRtfTextContainer requirement: return a copy of our attributes- Specified by:
getTextContainerAttributes
in interfaceIRtfTextContainer
- Returns:
- a copy of this paragraphs attributes
- Throws:
FOPException
- if attributes cannot be cloned
-
writeRtfPrefix
Overridden to write our attributes before our content- Overrides:
writeRtfPrefix
in classRtfElement
- Throws:
IOException
- for I/O problems
-
writeRtfSuffix
Overridden to close paragraph- Overrides:
writeRtfSuffix
in classRtfElement
- Throws:
IOException
- for I/O problems
-
newText
Close current text run if any and start a new one with default attributes- Specified by:
newText
in interfaceIRtfTextContainer
- Parameters:
str
- if not null, added to the RtfText created- Returns:
- the new RtfText object
- Throws:
IOException
- for I/O problems
-
newText
Close current text run if any and start a new one- Specified by:
newText
in interfaceIRtfTextContainer
- Parameters:
str
- if not null, added to the RtfText createdattr
- attributes of the text- Returns:
- the new RtfText object
- Throws:
IOException
- for I/O problems
-
newPageBreak
add a page break- Specified by:
newPageBreak
in interfaceIRtfPageBreakContainer
- Throws:
IOException
- for I/O problems
-
newLineBreak
add a line break- Specified by:
newLineBreak
in interfaceIRtfTextContainer
- Throws:
IOException
- for I/O problems
-
newPageNumber
Add a page number- Specified by:
newPageNumber
in interfaceIRtfPageNumberContainer
- Returns:
- new RtfPageNumber object
- Throws:
IOException
- for I/O problems
-
newPageNumberCitation
Added by Boris POUDEROUS on 2002/07/09- Specified by:
newPageNumberCitation
in interfaceIRtfPageNumberCitationContainer
- Parameters:
id
- string containing the citation text- Returns:
- the new RtfPageNumberCitation object
- Throws:
IOException
- for I/O problems
-
newHyperLink
Creates a new hyperlink.- Specified by:
newHyperLink
in interfaceIRtfHyperLinkContainer
- Parameters:
str
- string containing the hyperlink textattr
- attributes of new hyperlink- Returns:
- the new RtfHyperLink object
- Throws:
IOException
- for I/O problems
-
newImage
Start a new external graphic after closing all other elements- Specified by:
newImage
in interfaceIRtfExternalGraphicContainer
- Returns:
- the new RtfExternalGraphic
- Throws:
IOException
- for I/O problems
-
okToWriteRtf
protected boolean okToWriteRtf()Depending on RtfOptions, do not emit any RTF for empty paragraphs- Overrides:
okToWriteRtf
in classRtfContainer
- Returns:
- true if RTF should be written
-
getTextAttributes
accessor for text attributes- Returns:
- attributes of the text
-