Class RtfSection
- java.lang.Object
-
- org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement
-
- org.apache.fop.render.rtf.rtflib.rtfdoc.RtfContainer
-
- org.apache.fop.render.rtf.rtflib.rtfdoc.RtfSection
-
- All Implemented Interfaces:
IRtfAfterContainer
,IRtfBeforeContainer
,IRtfExternalGraphicContainer
,IRtfJforCmdContainer
,IRtfListContainer
,IRtfParagraphContainer
,IRtfParagraphKeepTogetherContainer
,IRtfTableContainer
,IRtfTextrunContainer
public class RtfSection extends RtfContainer implements IRtfParagraphContainer, IRtfTableContainer, IRtfListContainer, IRtfExternalGraphicContainer, IRtfBeforeContainer, IRtfParagraphKeepTogetherContainer, IRtfAfterContainer, IRtfJforCmdContainer, IRtfTextrunContainer
Models a section in an RTF document
This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch).
-
-
Field Summary
Fields Modifier and Type Field Description private RtfAfter
after
private RtfBefore
before
private RtfExternalGraphic
externalGraphic
private RtfJforCmd
jforCmd
private RtfList
list
private RtfParagraph
paragraph
private RtfTable
table
-
Fields inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement
attrib, parent, writer
-
-
Constructor Summary
Constructors Constructor Description RtfSection(RtfDocumentArea parent, java.io.Writer w)
Create an RTF container as a child of given container
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
closeAll()
private void
closeCurrentBefore()
private void
closeCurrentExternalGraphic()
private void
closeCurrentList()
private void
closeCurrentParagraph()
private void
closeCurrentTable()
RtfTextrun
getTextrun()
Returns the current RtfTextrun.RtfAfter
newAfter(RtfAttributes attrs)
IRtfAfterContainerRtfBefore
newBefore(RtfAttributes attrs)
IRtfBeforeContainerRtfExternalGraphic
newImage()
Start a new external graphic after closing current paragraph, list and tableRtfJforCmd
newJforCmd(RtfAttributes attrs)
RtfList
newList(RtfAttributes attrs)
Start a new list after closing current paragraph, list and tableRtfParagraph
newParagraph()
Close current paragraph if any and start a new one with default attributesRtfParagraph
newParagraph(RtfAttributes attrs)
Start a new paragraph after closing current paragraph, list and tableRtfParagraphKeepTogether
newParagraphKeepTogether()
Close current paragraph if any and start a new oneRtfTable
newTable(ITableColumnsInfo tc)
Start a new table after closing current paragraph, list and tableRtfTable
newTable(RtfAttributes attrs, ITableColumnsInfo tc)
Start a new table after closing current paragraph, list and tableprotected void
writeRtfPrefix()
Can be overridden to write RTF prefix code, what comes before our childrenprotected void
writeRtfSuffix()
Can be overridden to write RTF suffix code, what comes after our children-
Methods inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfContainer
addChild, containsText, dump, findChildren, getChildCount, getChildren, getOptions, isEmpty, okToWriteRtf, setChildren, setOptions, toString, writeRtfContent
-
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, writeStarControlWord, writeStarControlWordNS
-
-
-
-
Field Detail
-
paragraph
private RtfParagraph paragraph
-
table
private RtfTable table
-
list
private RtfList list
-
externalGraphic
private RtfExternalGraphic externalGraphic
-
before
private RtfBefore before
-
after
private RtfAfter after
-
jforCmd
private RtfJforCmd jforCmd
-
-
Constructor Detail
-
RtfSection
RtfSection(RtfDocumentArea parent, java.io.Writer w) throws java.io.IOException
Create an RTF container as a child of given container- Throws:
java.io.IOException
-
-
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 interfaceIRtfExternalGraphicContainer
- Returns:
- new RtfExternalGraphic object
- Throws:
java.io.IOException
- for I/O problems
-
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 interfaceIRtfParagraphContainer
- Parameters:
attrs
- attributes for new RtfParagraph- Returns:
- new RtfParagraph object
- Throws:
java.io.IOException
- for I/O problems
-
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 interfaceIRtfParagraphContainer
- Returns:
- new RtfParagraph
- Throws:
java.io.IOException
- for I/O problems
-
newParagraphKeepTogether
public RtfParagraphKeepTogether newParagraphKeepTogether() throws java.io.IOException
Close current paragraph if any and start a new one- Specified by:
newParagraphKeepTogether
in interfaceIRtfParagraphKeepTogetherContainer
- Returns:
- new RtfParagraphKeepTogether
- Throws:
java.io.IOException
- for I/O problems
-
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 interfaceIRtfTableContainer
- Parameters:
tc
- Table context used for number-columns-spanned attribute (added by Boris Poudérous on july 2002)- Returns:
- new RtfTable object
- Throws:
java.io.IOException
- for I/O problems
-
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 interfaceIRtfTableContainer
- Parameters:
attrs
- attributes of new RtfTabletc
- Table context used for number-columns-spanned attribute (added by Boris Poudérous on july 2002)- Returns:
- new RtfTable object
- Throws:
java.io.IOException
- for I/O problems
-
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 interfaceIRtfListContainer
- Parameters:
attrs
- attributes of new RftList object- Returns:
- new RtfList
- Throws:
java.io.IOException
- for I/O problems
-
newBefore
public RtfBefore newBefore(RtfAttributes attrs) throws java.io.IOException
IRtfBeforeContainer- Specified by:
newBefore
in interfaceIRtfBeforeContainer
- Parameters:
attrs
- attributes of new RtfBefore object- Returns:
- new RtfBefore object
- Throws:
java.io.IOException
- for I/O problems
-
newAfter
public RtfAfter newAfter(RtfAttributes attrs) throws java.io.IOException
IRtfAfterContainer- Specified by:
newAfter
in interfaceIRtfAfterContainer
- Parameters:
attrs
- attributes of new RtfAfter object- Returns:
- new RtfAfter object
- Throws:
java.io.IOException
- for I/O problems
-
newJforCmd
public RtfJforCmd newJforCmd(RtfAttributes attrs) throws java.io.IOException
- Specified by:
newJforCmd
in interfaceIRtfJforCmdContainer
- Parameters:
attrs
- attributes of new RtfJforCmd- Returns:
- the new RtfJforCmd
- Throws:
java.io.IOException
- for I/O problems
-
writeRtfPrefix
protected void writeRtfPrefix() throws java.io.IOException
Can be overridden to write RTF prefix code, what comes before our children- Overrides:
writeRtfPrefix
in classRtfElement
- Throws:
java.io.IOException
- for I/O problems
-
writeRtfSuffix
protected void writeRtfSuffix() throws java.io.IOException
Can be overridden to write RTF suffix code, what comes after our children- Overrides:
writeRtfSuffix
in classRtfElement
- Throws:
java.io.IOException
- for I/O problems
-
closeCurrentTable
private void closeCurrentTable() throws java.io.IOException
- Throws:
java.io.IOException
-
closeCurrentParagraph
private void closeCurrentParagraph() throws java.io.IOException
- Throws:
java.io.IOException
-
closeCurrentList
private void closeCurrentList() throws java.io.IOException
- Throws:
java.io.IOException
-
closeCurrentExternalGraphic
private void closeCurrentExternalGraphic() throws java.io.IOException
- Throws:
java.io.IOException
-
closeCurrentBefore
private void closeCurrentBefore() throws java.io.IOException
- Throws:
java.io.IOException
-
closeAll
private void closeAll() throws java.io.IOException
- Throws:
java.io.IOException
-
getTextrun
public RtfTextrun getTextrun() throws java.io.IOException
Returns the current RtfTextrun.- Specified by:
getTextrun
in interfaceIRtfTextrunContainer
- Returns:
- Current RtfTextrun
- Throws:
java.io.IOException
- Thrown when an IO-problem occurs.
-
-