org.jfor.jfor.rtflib.rtfdoc
Class RtfSection

java.lang.Object
  extended byorg.jfor.jfor.rtflib.rtfdoc.RtfElement
      extended byorg.jfor.jfor.rtflib.rtfdoc.RtfContainer
          extended byorg.jfor.jfor.rtflib.rtfdoc.RtfSection
All Implemented Interfaces:
IRtfAfterContainer, IRtfBeforeContainer, IRtfExternalGraphicContainer, IRtfJforCmdContainer, IRtfListContainer, IRtfParagraphContainer, IRtfParagraphKeepTogetherContainer, IRtfTableContainer

public class RtfSection
extends RtfContainer
implements IRtfParagraphContainer, IRtfTableContainer, IRtfListContainer, IRtfExternalGraphicContainer, IRtfBeforeContainer, IRtfParagraphKeepTogetherContainer, IRtfAfterContainer, IRtfJforCmdContainer

Models a section in an RTF document

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) RtfSection(RtfDocumentArea parent, java.io.Writer w)
          Create an RTF container as a child of given container
 
Method Summary
 RtfAfter newAfter(RtfAttributes attrs)
          IRtfAfterContainer
 RtfBefore newBefore(RtfAttributes attrs)
          IRtfBeforeContainer
 RtfExternalGraphic newImage()
          start a new external graphic after closing current paragraph, list and table
 RtfJforCmd newJforCmd(RtfAttributes attrs)
           
 RtfList newList(RtfAttributes attrs)
          start a new list after closing current paragraph, list and table
 RtfParagraph newParagraph()
          close current paragraph if any and start a new one with default attributes
 RtfParagraph newParagraph(RtfAttributes attrs)
          start a new paragraph after closing current paragraph, list and table
 RtfParagraphKeepTogether newParagraphKeepTogether()
          close current paragraph if any and start a new one
 RtfTable newTable(ITableColumnsInfo tc)
          start a new table after closing current paragraph, list and table
 RtfTable newTable(RtfAttributes attrs, ITableColumnsInfo tc)
          start a new table after closing current paragraph, list and table
protected  void writeRtfPrefix()
          can be overridden to write RTF prefix code, what comes before our children
protected  void writeRtfSuffix()
          can be overridden to write RTF suffix code, what comes after our children
 
Methods inherited from class org.jfor.jfor.rtflib.rtfdoc.RtfContainer
addChild, containsText, dump, getChildCount, getChildren, getOptions, isEmpty, okToWriteRtf, setChildren, setOptions, toString, writeRtfContent
 
Methods inherited from class org.jfor.jfor.rtflib.rtfdoc.RtfElement
close, getParentOfClass, getRtfAttributes, getRtfFile, isClosed, writeAttributes, writeControlWord, writeControlWordNS, writeExceptionInRtf, writeGroupMark, writeOneAttribute, writeOneAttributeNS, writeRtf, writeStarControlWord, writeStarControlWordNS
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RtfSection

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

Method Detail

newImage

public RtfExternalGraphic newImage()
                            throws java.io.IOException
start a new external graphic after closing current paragraph, list and table

Specified by:
newImage in interface IRtfExternalGraphicContainer
Throws:
java.io.IOException - On error

newParagraph

public RtfParagraph newParagraph(RtfAttributes attrs)
                          throws java.io.IOException
start a new paragraph after closing current paragraph, list and table

Specified by:
newParagraph in interface IRtfParagraphContainer
Throws:
java.io.IOException

newParagraph

public RtfParagraph newParagraph()
                          throws java.io.IOException
close current paragraph if any and start a new one with default attributes

Specified by:
newParagraph in interface IRtfParagraphContainer
Throws:
java.io.IOException

newParagraphKeepTogether

public RtfParagraphKeepTogether newParagraphKeepTogether()
                                                  throws java.io.IOException
close current paragraph if any and start a new one

Specified by:
newParagraphKeepTogether in interface IRtfParagraphKeepTogetherContainer
Throws:
java.io.IOException

newTable

public RtfTable newTable(ITableColumnsInfo tc)
                  throws java.io.IOException
start a new table after closing current paragraph, list and table

Specified by:
newTable in interface IRtfTableContainer
Parameters:
tc - Table context used for number-columns-spanned attribute (added by Boris Poud?rous on july 2002)
Throws:
java.io.IOException

newTable

public RtfTable newTable(RtfAttributes attrs,
                         ITableColumnsInfo tc)
                  throws java.io.IOException
start a new table after closing current paragraph, list and table

Specified by:
newTable in interface IRtfTableContainer
Parameters:
tc - Table context used for number-columns-spanned attribute (added by Boris Poud?rous on july 2002)
Throws:
java.io.IOException

newList

public RtfList newList(RtfAttributes attrs)
                throws java.io.IOException
start a new list after closing current paragraph, list and table

Specified by:
newList in interface IRtfListContainer
Throws:
java.io.IOException

newBefore

public RtfBefore newBefore(RtfAttributes attrs)
                    throws java.io.IOException
IRtfBeforeContainer

Specified by:
newBefore in interface IRtfBeforeContainer
Throws:
java.io.IOException

newAfter

public RtfAfter newAfter(RtfAttributes attrs)
                  throws java.io.IOException
IRtfAfterContainer

Specified by:
newAfter in interface IRtfAfterContainer
Throws:
java.io.IOException

newJforCmd

public RtfJforCmd newJforCmd(RtfAttributes attrs)
                      throws java.io.IOException
Specified by:
newJforCmd in interface IRtfJforCmdContainer
Throws:
java.io.IOException

writeRtfPrefix

protected void writeRtfPrefix()
                       throws java.io.IOException
can be overridden to write RTF prefix code, what comes before our children

Overrides:
writeRtfPrefix in class RtfElement
Throws:
java.io.IOException

writeRtfSuffix

protected void writeRtfSuffix()
                       throws java.io.IOException
can be overridden to write RTF suffix code, what comes after our children

Overrides:
writeRtfSuffix in class RtfElement
Throws:
java.io.IOException