Class RtfContainer
- java.lang.Object
-
- org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement
-
- org.apache.fop.render.rtf.rtflib.rtfdoc.RtfContainer
-
- Direct Known Subclasses:
RtfAfterBeforeBase
,RtfBookmarkContainerImpl
,RtfDocumentArea
,RtfExtraRowSet
,RtfFile
,RtfFootnote
,RtfHeader
,RtfHyperLink
,RtfJforCmd
,RtfLeader
,RtfList
,RtfListItem
,RtfListTable
,RtfNull
,RtfPage
,RtfPageArea
,RtfPageNumber
,RtfPageNumberCitation
,RtfParagraphKeepTogether
,RtfSection
,RtfTable
,RtfTableCell
,RtfTableRow
,RtfTextrun
public class RtfContainer extends RtfElement
An RtfElement that can contain other elements.
This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch).
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.LinkedList
children
private RtfElement
lastChild
private RtfOptions
options
-
Fields inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement
attrib, parent, writer
-
-
Constructor Summary
Constructors Constructor Description RtfContainer(RtfContainer parent, java.io.Writer w)
Create an RTF container as a child of given containerRtfContainer(RtfContainer parent, java.io.Writer w, RtfAttributes attr)
Create an RTF container as a child of given container with given attributes
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addChild(RtfElement e)
add a child element to this(package private) boolean
containsText()
true if this (recursively) contains at least one RtfText object(package private) void
dump(java.io.Writer w, int indent)
debugging to given Writerint
findChildren(RtfElement aChild)
Find the passed child in the current containerprivate int
findChildren(RtfElement aChild, int iStart)
int
getChildCount()
java.util.List
getChildren()
(package private) RtfOptions
getOptions()
return our optionsboolean
isEmpty()
protected boolean
okToWriteRtf()
can be overridden to suppress all RTF outputboolean
setChildren(java.util.List list)
Add by Boris Poudérous on 07/22/2002 Set the children listvoid
setOptions(RtfOptions opt)
set optionsjava.lang.String
toString()
minimal debugging displayprotected void
writeRtfContent()
write RTF code of all our children-
Methods inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement
close, getParentOfClass, getRtfAttributes, getRtfFile, isClosed, newLine, writeAttributes, writeControlWord, writeControlWordNS, writeExceptionInRtf, writeGroupMark, writeOneAttribute, writeOneAttributeNS, writeRtf, writeRtfPrefix, writeRtfSuffix, writeStarControlWord, writeStarControlWordNS
-
-
-
-
Field Detail
-
children
private java.util.LinkedList children
-
options
private RtfOptions options
-
lastChild
private RtfElement lastChild
-
-
Constructor Detail
-
RtfContainer
RtfContainer(RtfContainer parent, java.io.Writer w) throws java.io.IOException
Create an RTF container as a child of given container- Throws:
java.io.IOException
-
RtfContainer
RtfContainer(RtfContainer parent, java.io.Writer w, RtfAttributes attr) throws java.io.IOException
Create an RTF container as a child of given container with given attributes- Throws:
java.io.IOException
-
-
Method Detail
-
setOptions
public void setOptions(RtfOptions opt)
set options- Parameters:
opt
- options to set
-
addChild
protected void addChild(RtfElement e) throws RtfStructureException
add a child element to this- Parameters:
e
- child element to add- Throws:
RtfStructureException
- for trying to add an invalid child (??)
-
getChildren
public java.util.List getChildren()
- Returns:
- a copy of our children's list
-
getChildCount
public int getChildCount()
- Returns:
- the number of children
-
findChildren
private int findChildren(RtfElement aChild, int iStart)
-
findChildren
public int findChildren(RtfElement aChild)
Find the passed child in the current container- Parameters:
aChild
- the child element- Returns:
- the depth (nested level) inside the current container
-
setChildren
public boolean setChildren(java.util.List list)
Add by Boris Poudérous on 07/22/2002 Set the children list- Parameters:
list
- list of child objects- Returns:
- true if process succeeded
-
writeRtfContent
protected void writeRtfContent() throws java.io.IOException
write RTF code of all our children- Specified by:
writeRtfContent
in classRtfElement
- Throws:
java.io.IOException
- for I/O problems
-
getOptions
RtfOptions getOptions()
return our options
-
containsText
boolean containsText()
true if this (recursively) contains at least one RtfText object
-
dump
void dump(java.io.Writer w, int indent) throws java.io.IOException
debugging to given Writer- Overrides:
dump
in classRtfElement
- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
minimal debugging display- Overrides:
toString
in classRtfElement
- Returns:
- String representation of object contents
-
okToWriteRtf
protected boolean okToWriteRtf()
Description copied from class:RtfElement
can be overridden to suppress all RTF output- Overrides:
okToWriteRtf
in classRtfElement
- Returns:
- false if empty or if our options block writing
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in classRtfElement
- Returns:
- true if this element would generate no "useful" RTF content, i.e. (for RtfContainer) true if it has no children where isEmpty() is false
-
-