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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetText()Accessor for the paragraph textRtfAttributesgetTextAttributes()accessor for text attributesRtfAttributesgetTextContainerAttributes()IRtfTextContainer requirement: return a copy of our attributesRtfHyperLinknewHyperLink(java.lang.String str, RtfAttributes attr)Creates a new hyperlink.RtfExternalGraphicnewImage()Start a new external graphic after closing all other elementsvoidnewLineBreak()add a line breakvoidnewPageBreak()add a page breakRtfPageNumbernewPageNumber()Add a page numberRtfPageNumberCitationnewPageNumberCitation(java.lang.String id)Added by Boris POUDEROUS on 2002/07/09RtfTextnewText(java.lang.String str)Close current text run if any and start a new one with default attributesRtfTextnewText(java.lang.String str, RtfAttributes attr)Close current text run if any and start a new oneprotected booleanokToWriteRtf()Depending on RtfOptions, do not emit any RTF for empty paragraphsvoidsetKeepn()Set the keepn attribute for this paragraphvoidsetResetProperties()Force reset propertiesprotected voidwriteRtfPrefix()Overridden to write our attributes before our contentprotected voidwriteRtfSuffix()Overridden to close paragraph-
Methods 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 Detail
-
getText
public java.lang.String 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
public RtfAttributes getTextContainerAttributes() throws FOPException
IRtfTextContainer requirement: return a copy of our attributes- Specified by:
getTextContainerAttributesin interfaceIRtfTextContainer- Returns:
- a copy of this paragraphs attributes
- Throws:
FOPException- if attributes cannot be cloned
-
writeRtfPrefix
protected void writeRtfPrefix() throws java.io.IOExceptionOverridden to write our attributes before our content- Overrides:
writeRtfPrefixin classRtfElement- Throws:
java.io.IOException- for I/O problems
-
writeRtfSuffix
protected void writeRtfSuffix() throws java.io.IOExceptionOverridden to close paragraph- Overrides:
writeRtfSuffixin classRtfElement- Throws:
java.io.IOException- for I/O problems
-
newText
public RtfText newText(java.lang.String str) throws java.io.IOException
Close current text run if any and start a new one with default attributes- Specified by:
newTextin interfaceIRtfTextContainer- Parameters:
str- if not null, added to the RtfText created- Returns:
- the new RtfText object
- Throws:
java.io.IOException- for I/O problems
-
newText
public RtfText newText(java.lang.String str, RtfAttributes attr) throws java.io.IOException
Close current text run if any and start a new one- Specified by:
newTextin interfaceIRtfTextContainer- Parameters:
str- if not null, added to the RtfText createdattr- attributes of the text- Returns:
- the new RtfText object
- Throws:
java.io.IOException- for I/O problems
-
newPageBreak
public void newPageBreak() throws java.io.IOExceptionadd a page break- Specified by:
newPageBreakin interfaceIRtfPageBreakContainer- Throws:
java.io.IOException- for I/O problems
-
newLineBreak
public void newLineBreak() throws java.io.IOExceptionadd a line break- Specified by:
newLineBreakin interfaceIRtfTextContainer- Throws:
java.io.IOException- for I/O problems
-
newPageNumber
public RtfPageNumber newPageNumber() throws java.io.IOException
Add a page number- Specified by:
newPageNumberin interfaceIRtfPageNumberContainer- Returns:
- new RtfPageNumber object
- Throws:
java.io.IOException- for I/O problems
-
newPageNumberCitation
public RtfPageNumberCitation newPageNumberCitation(java.lang.String id) throws java.io.IOException
Added by Boris POUDEROUS on 2002/07/09- Specified by:
newPageNumberCitationin interfaceIRtfPageNumberCitationContainer- Parameters:
id- string containing the citation text- Returns:
- the new RtfPageNumberCitation object
- Throws:
java.io.IOException- for I/O problems
-
newHyperLink
public RtfHyperLink newHyperLink(java.lang.String str, RtfAttributes attr) throws java.io.IOException
Creates a new hyperlink.- Specified by:
newHyperLinkin interfaceIRtfHyperLinkContainer- Parameters:
str- string containing the hyperlink textattr- attributes of new hyperlink- Returns:
- the new RtfHyperLink object
- Throws:
java.io.IOException- for I/O problems
-
newImage
public RtfExternalGraphic newImage() throws java.io.IOException
Start a new external graphic after closing all other elements- Specified by:
newImagein interfaceIRtfExternalGraphicContainer- Returns:
- the new RtfExternalGraphic
- Throws:
java.io.IOException- for I/O problems
-
okToWriteRtf
protected boolean okToWriteRtf()
Depending on RtfOptions, do not emit any RTF for empty paragraphs- Overrides:
okToWriteRtfin classRtfContainer- Returns:
- true if RTF should be written
-
getTextAttributes
public RtfAttributes getTextAttributes()
accessor for text attributes- Returns:
- attributes of the text
-
-