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).
attrib, parent, writer
Modifier and Type | Method and Description |
---|---|
String |
getText()
Accessor for the paragraph text
|
RtfAttributes |
getTextAttributes()
accessor for text attributes
|
RtfAttributes |
getTextContainerAttributes()
IRtfTextContainer requirement: return a copy of our attributes
|
RtfHyperLink |
newHyperLink(String str,
RtfAttributes attr)
Creates a new hyperlink.
|
RtfExternalGraphic |
newImage()
Start a new external graphic after closing all other elements
|
void |
newLineBreak()
add a line break
|
void |
newPageBreak()
add a page break
|
RtfPageNumber |
newPageNumber()
Add a page number
|
RtfPageNumberCitation |
newPageNumberCitation(String id)
Added by Boris POUDEROUS on 2002/07/09
|
RtfText |
newText(String str)
Close current text run if any and start a new one with default attributes
|
RtfText |
newText(String str,
RtfAttributes attr)
Close current text run if any and start a new one
|
protected boolean |
okToWriteRtf()
Depending on RtfOptions, do not emit any RTF for empty paragraphs
|
void |
setKeepn()
Set the keepn attribute for this paragraph
|
void |
setResetProperties()
Force reset properties
|
protected void |
writeRtfPrefix()
Overridden to write our attributes before our content
|
protected void |
writeRtfSuffix()
Overridden to close paragraph
|
newBookmark
addChild, findChildren, getChildCount, getChildren, isEmpty, setChildren, setOptions, toString, writeRtfContent
close, getParentOfClass, getRtfAttributes, newLine, writeAttributes, writeControlWord, writeControlWordNS, writeExceptionInRtf, writeGroupMark, writeOneAttribute, writeOneAttributeNS, writeRtf, writeStarControlWord, writeStarControlWordNS
public String getText()
public void setKeepn()
public void setResetProperties()
public RtfAttributes getTextContainerAttributes() throws FOPException
getTextContainerAttributes
in interface IRtfTextContainer
FOPException
- if attributes cannot be clonedprotected void writeRtfPrefix() throws IOException
writeRtfPrefix
in class RtfElement
IOException
- for I/O problemsprotected void writeRtfSuffix() throws IOException
writeRtfSuffix
in class RtfElement
IOException
- for I/O problemspublic RtfText newText(String str) throws IOException
newText
in interface IRtfTextContainer
str
- if not null, added to the RtfText createdIOException
- for I/O problemspublic RtfText newText(String str, RtfAttributes attr) throws IOException
newText
in interface IRtfTextContainer
str
- if not null, added to the RtfText createdattr
- attributes of the textIOException
- for I/O problemspublic void newPageBreak() throws IOException
newPageBreak
in interface IRtfPageBreakContainer
IOException
- for I/O problemspublic void newLineBreak() throws IOException
newLineBreak
in interface IRtfTextContainer
IOException
- for I/O problemspublic RtfPageNumber newPageNumber() throws IOException
newPageNumber
in interface IRtfPageNumberContainer
IOException
- for I/O problemspublic RtfPageNumberCitation newPageNumberCitation(String id) throws IOException
newPageNumberCitation
in interface IRtfPageNumberCitationContainer
id
- string containing the citation textIOException
- for I/O problemspublic RtfHyperLink newHyperLink(String str, RtfAttributes attr) throws IOException
newHyperLink
in interface IRtfHyperLinkContainer
str
- string containing the hyperlink textattr
- attributes of new hyperlinkIOException
- for I/O problemspublic RtfExternalGraphic newImage() throws IOException
newImage
in interface IRtfExternalGraphicContainer
IOException
- for I/O problemsprotected boolean okToWriteRtf()
okToWriteRtf
in class RtfContainer
public RtfAttributes getTextAttributes()
Copyright © 2025 Apache Software Foundation. All rights reserved.