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 |
---|---|
java.lang.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(java.lang.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(java.lang.String id)
Added by Boris POUDEROUS on 2002/07/09
|
RtfText |
newText(java.lang.String str)
Close current text run if any and start a new one with default attributes
|
RtfText |
newText(java.lang.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 java.lang.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 java.io.IOException
writeRtfPrefix
in class RtfElement
java.io.IOException
- for I/O problemsprotected void writeRtfSuffix() throws java.io.IOException
writeRtfSuffix
in class RtfElement
java.io.IOException
- for I/O problemspublic RtfText newText(java.lang.String str) throws java.io.IOException
newText
in interface IRtfTextContainer
str
- if not null, added to the RtfText createdjava.io.IOException
- for I/O problemspublic RtfText newText(java.lang.String str, RtfAttributes attr) throws java.io.IOException
newText
in interface IRtfTextContainer
str
- if not null, added to the RtfText createdattr
- attributes of the textjava.io.IOException
- for I/O problemspublic void newPageBreak() throws java.io.IOException
newPageBreak
in interface IRtfPageBreakContainer
java.io.IOException
- for I/O problemspublic void newLineBreak() throws java.io.IOException
newLineBreak
in interface IRtfTextContainer
java.io.IOException
- for I/O problemspublic RtfPageNumber newPageNumber() throws java.io.IOException
newPageNumber
in interface IRtfPageNumberContainer
java.io.IOException
- for I/O problemspublic RtfPageNumberCitation newPageNumberCitation(java.lang.String id) throws java.io.IOException
newPageNumberCitation
in interface IRtfPageNumberCitationContainer
id
- string containing the citation textjava.io.IOException
- for I/O problemspublic RtfHyperLink newHyperLink(java.lang.String str, RtfAttributes attr) throws java.io.IOException
newHyperLink
in interface IRtfHyperLinkContainer
str
- string containing the hyperlink textattr
- attributes of new hyperlinkjava.io.IOException
- for I/O problemspublic RtfExternalGraphic newImage() throws java.io.IOException
newImage
in interface IRtfExternalGraphicContainer
java.io.IOException
- for I/O problemsprotected boolean okToWriteRtf()
okToWriteRtf
in class RtfContainer
public RtfAttributes getTextAttributes()
Copyright 1999-2017 The Apache Software Foundation. All Rights Reserved.