org.apache.fop.render.rtf.rtflib.rtfdoc

Class RtfTableCell

Implemented Interfaces:
IRtfExternalGraphicContainer, IRtfListContainer, IRtfParagraphContainer, IRtfTableContainer, IRtfTextrunContainer

public class RtfTableCell
extends RtfContainer
implements IRtfParagraphContainer, IRtfListContainer, IRtfTableContainer, IRtfExternalGraphicContainer, IRtfTextrunContainer

A cell in an RTF table, container for paragraphs, lists, etc.
Author:
Bertrand Delacretaz bdelacretaz@codeconsult.ch

Field Summary

static int
DEFAULT_CELL_WIDTH
default cell width (in twips ??)
static int
MERGE_START
cell merging: this cell is the start of a range of merged cells
static int
MERGE_WITH_PREVIOUS
cell merging: this cell is part of (but not the start of) a range of merged cells
static int
NO_MERGE
cell merging: this cell is not merged

Fields inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement

attrib, parent, writer

Method Summary

int
getHMerge()
RtfTableRow
getRow()
Get the parent row.
RtfTextrun
getTextrun()
Returns the current RtfTextrun object.
int
getVMerge()
boolean
isEmpty()
A table cell always contains "useful" content, as it is here to take some space in a row.
RtfExternalGraphic
newImage()
Start a new external graphic after closing current paragraph, list and table
RtfList
newList(RtfAttributes attrib)
Start a new list after closing current paragraph, list and table
RtfParagraph
newParagraph()
Start a new paragraph with default attributes after closing current paragraph, list and table
RtfParagraph
newParagraph(RtfAttributes attrs)
Start a new paragraph after closing current current paragraph, list and table
RtfTable
newTable(ITableColumnsInfo tc)
Start a new nested table after closing current paragraph, list and table
RtfTable
newTable(RtfAttributes attrs, ITableColumnsInfo tc)
Start a new nested table after closing current paragraph, list and table
void
setHMerge(int mergeStatus)
Set horizontal cell merging status
void
setVMerge(int mergeStatus)
protected void
writeRtfContent()
Overriden to avoid writing any it's a merged cell.
protected void
writeRtfPrefix()
Called before writeRtfContent; overriden to avoid writing any it's a merged cell.
protected void
writeRtfSuffix()
The "cell" control word marks the end of a cell

Methods inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfContainer

addChild, getChildCount, getChildren, isEmpty, okToWriteRtf, setChildren, setOptions, toString, writeRtfContent

Methods inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement

close, getRtfAttributes, isEmpty, newLine, okToWriteRtf, toString, writeAttributes, writeControlWord, writeControlWordNS, writeExceptionInRtf, writeGroupMark, writeOneAttribute, writeOneAttributeNS, writeRtf, writeRtfContent, writeRtfPrefix, writeRtfSuffix, writeStarControlWord, writeStarControlWordNS

Field Details

DEFAULT_CELL_WIDTH

public static final int DEFAULT_CELL_WIDTH
default cell width (in twips ??)
Field Value:
2000

MERGE_START

public static final int MERGE_START
cell merging: this cell is the start of a range of merged cells
Field Value:
1

MERGE_WITH_PREVIOUS

public static final int MERGE_WITH_PREVIOUS
cell merging: this cell is part of (but not the start of) a range of merged cells
Field Value:
2

NO_MERGE

public static final int NO_MERGE
cell merging: this cell is not merged
Field Value:
0

Method Details

getHMerge

public int getHMerge()
Returns:
horizontal cell merging status

getRow

public RtfTableRow getRow()
Get the parent row.
Returns:
The parent row.

getTextrun

public RtfTextrun getTextrun()
            throws IOException
Returns the current RtfTextrun object. Opens a new one if necessary.
Specified by:
getTextrun in interface IRtfTextrunContainer
Returns:
The RtfTextrun object

getVMerge

public int getVMerge()
Returns:
vertical cell merging status

isEmpty

public boolean isEmpty()
A table cell always contains "useful" content, as it is here to take some space in a row. Use containsText() to find out if there is really some useful content in the cell. TODO: containsText could use the original isEmpty implementation?
Overrides:
isEmpty in interface RtfContainer
Returns:
false (always)

newImage

public RtfExternalGraphic newImage()
            throws IOException
Start a new external graphic after closing current paragraph, list and table
Specified by:
newImage in interface IRtfExternalGraphicContainer
Returns:
new RtfExternalGraphic object

newList

public RtfList newList(RtfAttributes attrib)
            throws IOException
Start a new list after closing current paragraph, list and table
Specified by:
newList in interface IRtfListContainer
Parameters:
attrib - attributes for new RtfList
Returns:
new RtfList object

newParagraph

public RtfParagraph newParagraph()
            throws IOException
Start a new paragraph with default attributes after closing current paragraph, list and table
Specified by:
newParagraph in interface IRtfParagraphContainer
Returns:
new RtfParagraph object

newParagraph

public RtfParagraph newParagraph(RtfAttributes attrs)
            throws IOException
Start a new paragraph after closing current current paragraph, list and table
Specified by:
newParagraph in interface IRtfParagraphContainer
Parameters:
attrs - attributes of new RtfParagraph
Returns:
new RtfParagraph object

newTable

public RtfTable newTable(ITableColumnsInfo tc)
            throws IOException
Start a new nested table after closing current paragraph, list and table
Specified by:
newTable in interface IRtfTableContainer
Parameters:
tc - table column info for new RtfTable
Returns:
new RtfTable object

newTable

public RtfTable newTable(RtfAttributes attrs,
                         ITableColumnsInfo tc)
            throws IOException
Start a new nested table after closing current paragraph, list and table
Specified by:
newTable in interface IRtfTableContainer
Parameters:
attrs - attributes of new RtfTable
tc - table column info for new RtfTable
Returns:
new RtfTable object

setHMerge

public void setHMerge(int mergeStatus)
Set horizontal cell merging status
Parameters:
mergeStatus - mergeStatus to set

setVMerge

public void setVMerge(int mergeStatus)
Parameters:
mergeStatus - vertical cell merging status to set

writeRtfContent

protected void writeRtfContent()
            throws IOException
Overriden to avoid writing any it's a merged cell.
Overrides:
writeRtfContent in interface RtfContainer

writeRtfPrefix

protected void writeRtfPrefix()
            throws IOException
Called before writeRtfContent; overriden to avoid writing any it's a merged cell.
Overrides:
writeRtfPrefix in interface RtfElement

writeRtfSuffix

protected void writeRtfSuffix()
            throws IOException
The "cell" control word marks the end of a cell
Overrides:
writeRtfSuffix in interface RtfElement

Copyright 1999-2007 The Apache Software Foundation. All Rights Reserved.