org.apache.fop.render.rtf.rtflib.rtfdoc

Class RtfParagraph

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.
Authors:
Bertrand Delacretaz bdelacretaz@codeconsult.ch
Andreas Putz a.putz@skynamics.com
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

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

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, getChildCount, getChildren, isEmpty, okToWriteRtf, setChildren, setOptions, toString, writeRtfContent

Methods inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement

close, getRtfAttributes, isEmpty, newLine, okToWriteRtf, toString, writeAttributes, writeControlWord, writeControlWordNS, writeExceptionInRtf, writeGroupMark, writeOneAttribute, writeOneAttributeNS, writeRtf, writeRtfContent, writeRtfPrefix, writeRtfSuffix, writeStarControlWord, writeStarControlWordNS

Method Details

getText

public String getText()
Accessor for the paragraph text
Returns:
the paragraph text

getTextAttributes

public RtfAttributes getTextAttributes()
accessor for text attributes
Returns:
attributes of the text

getTextContainerAttributes

public RtfAttributes getTextContainerAttributes()
IRtfTextContainer requirement: return a copy of our attributes
Specified by:
getTextContainerAttributes in interface IRtfTextContainer
Returns:
a copy of this paragraphs attributes

newHyperLink

public RtfHyperLink newHyperLink(String str,
                                 RtfAttributes attr)
            throws IOException
Creates a new hyperlink.
Specified by:
newHyperLink in interface IRtfHyperLinkContainer
Parameters:
str - string containing the hyperlink text
attr - attributes of new hyperlink
Returns:
the new RtfHyperLink object

newImage

public RtfExternalGraphic newImage()
            throws IOException
Start a new external graphic after closing all other elements
Specified by:
newImage in interface IRtfExternalGraphicContainer
Returns:
the new RtfExternalGraphic

newLineBreak

public void newLineBreak()
            throws IOException
add a line break
Specified by:
newLineBreak in interface IRtfTextContainer

newPageBreak

public void newPageBreak()
            throws IOException
add a page break
Specified by:
newPageBreak in interface IRtfPageBreakContainer

newPageNumber

public RtfPageNumber newPageNumber()
            throws IOException
Add a page number
Specified by:
newPageNumber in interface IRtfPageNumberContainer
Returns:
new RtfPageNumber object

newPageNumberCitation

public RtfPageNumberCitation newPageNumberCitation(String id)
            throws IOException
Added by Boris POUDEROUS on 2002/07/09
Specified by:
newPageNumberCitation in interface IRtfPageNumberCitationContainer
Parameters:
id - string containing the citation text
Returns:
the new RtfPageNumberCitation object

newText

public RtfText newText(String str)
            throws IOException
Close current text run if any and start a new one with default attributes
Specified by:
newText in interface IRtfTextContainer
Parameters:
str - if not null, added to the RtfText created
Returns:
the new RtfText object

newText

public RtfText newText(String str,
                       RtfAttributes attr)
            throws IOException
Close current text run if any and start a new one
Specified by:
newText in interface IRtfTextContainer
Parameters:
str - if not null, added to the RtfText created
attr - attributes of the text
Returns:
the new RtfText object

okToWriteRtf

protected boolean okToWriteRtf()
Depending on RtfOptions, do not emit any RTF for empty paragraphs
Overrides:
okToWriteRtf in interface RtfContainer
Returns:
true if RTF should be written

setKeepn

public void setKeepn()
Set the keepn attribute for this paragraph

setResetProperties

public void setResetProperties()
Force reset properties

writeRtfPrefix

protected void writeRtfPrefix()
            throws IOException
Overridden to write our attributes before our content
Overrides:
writeRtfPrefix in interface RtfElement

writeRtfSuffix

protected void writeRtfSuffix()
            throws IOException
Overridden to close paragraph
Overrides:
writeRtfSuffix in interface RtfElement

Copyright 1999-2007 The Apache Software Foundation. All Rights Reserved.