org.jfor.jfor.rtflib.rtfdoc
Class RtfContainer

java.lang.Object
  extended byorg.jfor.jfor.rtflib.rtfdoc.RtfElement
      extended byorg.jfor.jfor.rtflib.rtfdoc.RtfContainer
Direct Known Subclasses:
RtfAfterBeforeBase, RtfBookmarkContainerImpl, RtfDocumentArea, RtfExtraRowSet, RtfFile, RtfHeader, RtfHyperLink, RtfJforCmd, RtfList, RtfListItem, RtfListTable, RtfNull, RtfPage, RtfPageArea, RtfPageNumber, RtfPageNumberCitation, RtfParagraphKeepTogether, RtfSection, RtfTable, RtfTableCell, RtfTableRow

public class RtfContainer
extends RtfElement

An RtfElement that can contain other elements.

Author:
Bertrand Delacretaz bdelacretaz@codeconsult.ch

Field Summary
 
Fields inherited from class org.jfor.jfor.rtflib.rtfdoc.RtfElement
m_attrib, m_parent, m_writer
 
Constructor Summary
(package private) RtfContainer(RtfContainer parent, java.io.Writer w)
          Create an RTF container as a child of given container
(package private) RtfContainer(RtfContainer parent, java.io.Writer w, RtfAttributes attr)
          Create an RTF container as a child of given container with given attributes
 
Method Summary
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 Writer
 int getChildCount()
          return the number of children
 java.util.List getChildren()
          return a copy of our children's list
(package private)  RtfOptions getOptions()
          return our options
 boolean isEmpty()
          true if this element would generate no "useful" RTF content.
protected  boolean okToWriteRtf()
          don't write any RTF if empty of if our options block it
 boolean setChildren(java.util.List children)
          Add by Boris Poud?rous on 07/22/2002 Set the children list
 void setOptions(RtfOptions opt)
          set options
 java.lang.String toString()
          minimal debugging display
protected  void writeRtfContent()
          write RTF code of all our children
 
Methods inherited from class org.jfor.jfor.rtflib.rtfdoc.RtfElement
close, getParentOfClass, getRtfAttributes, getRtfFile, isClosed, writeAttributes, writeControlWord, writeControlWordNS, writeExceptionInRtf, writeGroupMark, writeOneAttribute, writeOneAttributeNS, writeRtf, writeRtfPrefix, writeRtfSuffix, writeStarControlWord, writeStarControlWordNS
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RtfContainer

RtfContainer(RtfContainer parent,
             java.io.Writer w)
       throws java.io.IOException
Create an RTF container as a child of given container


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

Method Detail

setOptions

public void setOptions(RtfOptions opt)
set options


addChild

protected void addChild(RtfElement e)
                 throws RtfStructureException
add a child element to this

Throws:
RtfStructureException

getChildren

public java.util.List getChildren()
return a copy of our children's list


getChildCount

public int getChildCount()
return the number of children


setChildren

public boolean setChildren(java.util.List children)
Add by Boris Poud?rous on 07/22/2002 Set the children list


writeRtfContent

protected void writeRtfContent()
                        throws java.io.IOException
write RTF code of all our children

Specified by:
writeRtfContent in class RtfElement
Throws:
java.io.IOException

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 class RtfElement
Throws:
java.io.IOException

toString

public java.lang.String toString()
minimal debugging display

Overrides:
toString in class RtfElement

okToWriteRtf

protected boolean okToWriteRtf()
don't write any RTF if empty of if our options block it

Overrides:
okToWriteRtf in class RtfElement

isEmpty

public boolean isEmpty()
true if this element would generate no "useful" RTF content. For an RtfContainer, true if it has no children where isEmpty() is false

Specified by:
isEmpty in class RtfElement