Class RtfExtraRowSet
- 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.RtfExtraRowSet
-
public class RtfExtraRowSet extends RtfContainer
Used to add extra table rows after a row that contains a nested table:
- created by RtfTableRow before generating RTF code
- an RtfTableCell that contains a nested table can ask this to put some of its children in extra rows that after the current row
- once RtfTableRow is done rendering its children, it renders this, causing extra rows to be generated, with content that can come from several RtfTableCells
See org.apache.fop.rtf.rtflib.testdocs.NestedTable for an example of usage.
This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
RtfExtraRowSet.PositionedCell
-
Field Summary
Fields Modifier and Type Field Description private java.util.List
cells
While a top-level RtfTableRow is being rendered, we build a list of RtfTableCells that must be rendered in extra rows.(package private) static int
DEFAULT_IDNUM
private int
maxRowIndex
our maximum row indexprivate ITableColumnsInfo
parentITableColumnsInfo
Parent table context (added by Boris Poudérous on july 2002 in order to process nested tables)-
Fields inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement
attrib, parent, writer
-
-
Constructor Summary
Constructors Constructor Description RtfExtraRowSet(java.io.Writer w)
an RtfExtraRowSet has no parent, it is only used temporary during generation of RTF for an RtfTableRow
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addRow(RtfTableRow row, int rowIndex, int xOffset)
add all cells of given row to this set(package private) int
addTable(RtfTable tbl, int rowIndex, int xOffset)
Add all cells of given Table to this set for later rendering in extra rowsprivate static boolean
allCellsEmpty(java.util.List cells)
true if all cells of given list are empty(package private) RtfTableCell
createExtraCell(int rowIndex, int xOffset, int cellWidth, RtfAttributes parentCellAttributes)
create an extra cell to hold content that comes after a nested table in a cell Modified by Boris Poudérous in order to permit the extra cell to have the attributes of its parent cellITableColumnsInfo
getParentITableColumnsInfo()
boolean
isEmpty()
As this contains cells from several rows, we say that it's empty only if we have no cells.void
setParentITableColumnsInfo(ITableColumnsInfo parentITableColumnsInfo)
private void
writeRow(java.util.List cells)
write one RtfTableRow containing given PositionedCellsprotected void
writeRtfContent()
render extra RtfTableRows containing all the extra RtfTableCells that we contain-
Methods inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfContainer
addChild, containsText, dump, findChildren, getChildCount, getChildren, getOptions, okToWriteRtf, setChildren, setOptions, toString
-
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
-
DEFAULT_IDNUM
static final int DEFAULT_IDNUM
- See Also:
- Constant Field Values
-
parentITableColumnsInfo
private ITableColumnsInfo parentITableColumnsInfo
Parent table context (added by Boris Poudérous on july 2002 in order to process nested tables)
-
cells
private final java.util.List cells
While a top-level RtfTableRow is being rendered, we build a list of RtfTableCells that must be rendered in extra rows. This holds a cell with positioning information
-
maxRowIndex
private int maxRowIndex
our maximum row index
-
-
Method Detail
-
addTable
int addTable(RtfTable tbl, int rowIndex, int xOffset)
Add all cells of given Table to this set for later rendering in extra rows- Parameters:
rowIndex
- index of first extra row to create to hold cells of tblxOffset
- horizontal position of left edge of first column of tbl- Returns:
- index of extra row to use for elements that follow this table in the same cell
-
addRow
private void addRow(RtfTableRow row, int rowIndex, int xOffset)
add all cells of given row to this set
-
createExtraCell
RtfTableCell createExtraCell(int rowIndex, int xOffset, int cellWidth, RtfAttributes parentCellAttributes) throws java.io.IOException
create an extra cell to hold content that comes after a nested table in a cell Modified by Boris Poudérous in order to permit the extra cell to have the attributes of its parent cell- Throws:
java.io.IOException
-
writeRtfContent
protected void writeRtfContent() throws java.io.IOException
render extra RtfTableRows containing all the extra RtfTableCells that we contain- Overrides:
writeRtfContent
in classRtfContainer
- Throws:
java.io.IOException
- for I/O problems
-
writeRow
private void writeRow(java.util.List cells) throws java.io.IOException
write one RtfTableRow containing given PositionedCells- Throws:
java.io.IOException
-
allCellsEmpty
private static boolean allCellsEmpty(java.util.List cells)
true if all cells of given list are empty- Parameters:
cells
- List of PositionedCell objects
-
isEmpty
public boolean isEmpty()
As this contains cells from several rows, we say that it's empty only if we have no cells. writeRow makes the decision about rendering specific rows- Overrides:
isEmpty
in classRtfContainer
- Returns:
- false (always)
-
getParentITableColumnsInfo
public ITableColumnsInfo getParentITableColumnsInfo()
- Returns:
- The table context of the parent table Added by Boris Poudérous on july 2002 in order to process nested tables
-
setParentITableColumnsInfo
public void setParentITableColumnsInfo(ITableColumnsInfo parentITableColumnsInfo)
- Parameters:
parentITableColumnsInfo
- table context to set
-
-