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

Class RtfTextrun

Known Direct Subclasses:
RtfListItem.RtfListItemLabel

public class RtfTextrun
extends RtfContainer

Class which contains a linear text run. It has methods to add attributes, text, paragraph breaks....
Author:
Peter Herweg, pherweg@web.de

Field Summary

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

attrib, parent, writer

Method Summary

void
addBookmark(String id)
Inserts a bookmark.
RtfFootnote
addFootnote()
Inserts a footnote.
RtfHyperLink
addHyperlink(RtfAttributes attr)
Inserts a hyperlink.
void
addPageNumber(RtfAttributes attr)
Inserts a page number.
void
addParagraphBreak()
Inserts paragraph break before all close group marks.
void
addString(String s)
Add string to children list.
RtfListItem
getRtfListItem()
Gets the parent list-item of the textrun.
static RtfTextrun
getTextrun(RtfContainer container, Writer writer, RtfAttributes attrs)
Adds a new RtfTextrun to the given container if necessary, and returns it.
RtfExternalGraphic
newImage()
Inserts an image.
void
popBlockAttributes()
Pops block attributes, notifies all opened blocks about pushing block attributes, adds CloseGroupMark as a child.
void
popInlineAttributes()
Pop inline attributes.
void
pushBlockAttributes(RtfAttributes attrs)
Pushes block attributes, notifies all opened blocks about pushing block attributes, adds OpenGroupMark as a child.
void
pushInlineAttributes(RtfAttributes attrs)
Pushes inline attributes.
void
setRtfListItem(RtfListItem listItem)
Set the parent list-item of the textrun.
void
setSuppressLastPar(boolean bSuppress)
specify, if the last paragraph control word (\par) should be suppressed.
protected void
writeRtfContent()
write RTF code of all our children

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

addBookmark

public void addBookmark(String id)
            throws IOException
Inserts a bookmark.
Parameters:
id - Id for the inserted bookmark

addFootnote

public RtfFootnote addFootnote()
            throws IOException
Inserts a footnote.
Returns:
inserted footnote

addHyperlink

public RtfHyperLink addHyperlink(RtfAttributes attr)
            throws IOException
Inserts a hyperlink.
Parameters:
attr - Attributes for the hyperlink to insert.
Returns:
inserted hyperlink

addPageNumber

public void addPageNumber(RtfAttributes attr)
            throws IOException
Inserts a page number.
Parameters:
attr - Attributes for the page number to insert.

addParagraphBreak

public void addParagraphBreak()
            throws IOException
Inserts paragraph break before all close group marks.

addString

public void addString(String s)
            throws IOException
Add string to children list.
Parameters:
s - string to add

getRtfListItem

public RtfListItem getRtfListItem()
Gets the parent list-item of the textrun.
Returns:
parent list-item of the textrun

getTextrun

public static RtfTextrun getTextrun(RtfContainer container,
                                    Writer writer,
                                    RtfAttributes attrs)
            throws IOException
Adds a new RtfTextrun to the given container if necessary, and returns it.
Parameters:
container - RtfContainer, which is the parent of the returned RtfTextrun
writer - Writer of the given RtfContainer
attrs - RtfAttributes which are to write at the beginning of the RtfTextrun
Returns:
new or existing RtfTextrun object.

newImage

public RtfExternalGraphic newImage()
            throws IOException
Inserts an image.
Returns:
inserted image

popBlockAttributes

public void popBlockAttributes()
            throws IOException
Pops block attributes, notifies all opened blocks about pushing block attributes, adds CloseGroupMark as a child.

popInlineAttributes

public void popInlineAttributes()
            throws IOException
Pop inline attributes.

pushBlockAttributes

public void pushBlockAttributes(RtfAttributes attrs)
            throws IOException
Pushes block attributes, notifies all opened blocks about pushing block attributes, adds OpenGroupMark as a child.
Parameters:
attrs - the block attributes to push

pushInlineAttributes

public void pushInlineAttributes(RtfAttributes attrs)
            throws IOException
Pushes inline attributes.
Parameters:
attrs - the inline attributes to push

setRtfListItem

public void setRtfListItem(RtfListItem listItem)
Set the parent list-item of the textrun.
Parameters:
listItem - parent list-item of the textrun

setSuppressLastPar

public void setSuppressLastPar(boolean bSuppress)
specify, if the last paragraph control word (\par) should be suppressed.
Parameters:
bSuppress - true, if the last \par should be suppressed

writeRtfContent

protected void writeRtfContent()
            throws IOException
write RTF code of all our children
Overrides:
writeRtfContent in interface RtfContainer

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