public class RtfTableCell extends RtfContainer implements IRtfParagraphContainer, IRtfListContainer, IRtfTableContainer, IRtfExternalGraphicContainer, IRtfTextrunContainer
A cell in an RTF table, container for paragraphs, lists, etc.
This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch).
Modifier and Type | Field and Description |
---|---|
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
|
attrib, parent, writer
Modifier and Type | Method and Description |
---|---|
void |
finish()
The last paragraph break was just stored before,
now the control word is really switched
|
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 |
setLastParagraph(RtfParagraphBreak parBreak,
int breakDepth)
The table cell decides whether or not a newly added paragraph break
will be used to write the cell-end control word.
|
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
|
addChild, findChildren, getChildCount, getChildren, okToWriteRtf, setChildren, setOptions, toString
close, getParentOfClass, getRtfAttributes, newLine, writeAttributes, writeControlWord, writeControlWordNS, writeExceptionInRtf, writeGroupMark, writeOneAttribute, writeOneAttributeNS, writeRtf, writeStarControlWord, writeStarControlWordNS
public static final int DEFAULT_CELL_WIDTH
public static final int NO_MERGE
public static final int MERGE_START
public static final int MERGE_WITH_PREVIOUS
public RtfParagraph newParagraph(RtfAttributes attrs) throws java.io.IOException
newParagraph
in interface IRtfParagraphContainer
attrs
- attributes of new RtfParagraphjava.io.IOException
- for I/O problemspublic RtfExternalGraphic newImage() throws java.io.IOException
newImage
in interface IRtfExternalGraphicContainer
java.io.IOException
- for I/O problemspublic RtfParagraph newParagraph() throws java.io.IOException
newParagraph
in interface IRtfParagraphContainer
java.io.IOException
- for I/O problemspublic RtfList newList(RtfAttributes attrib) throws java.io.IOException
newList
in interface IRtfListContainer
attrib
- attributes for new RtfListjava.io.IOException
- for I/O problemspublic RtfTable newTable(ITableColumnsInfo tc) throws java.io.IOException
newTable
in interface IRtfTableContainer
tc
- table column info for new RtfTablejava.io.IOException
- for I/O problemspublic RtfTable newTable(RtfAttributes attrs, ITableColumnsInfo tc) throws java.io.IOException
newTable
in interface IRtfTableContainer
attrs
- attributes of new RtfTabletc
- table column info for new RtfTablejava.io.IOException
- for I/O problemsprotected void writeRtfContent() throws java.io.IOException
writeRtfContent
in class RtfContainer
java.io.IOException
- for I/O problemsprotected void writeRtfPrefix() throws java.io.IOException
writeRtfPrefix
in class RtfElement
java.io.IOException
- for I/O problemsprotected void writeRtfSuffix() throws java.io.IOException
writeRtfSuffix
in class RtfElement
java.io.IOException
- for I/O problemspublic void setVMerge(int mergeStatus)
mergeStatus
- vertical cell merging status to setpublic int getVMerge()
public void setHMerge(int mergeStatus)
mergeStatus
- mergeStatus to setpublic int getHMerge()
public boolean isEmpty()
isEmpty
in class RtfContainer
public RtfTextrun getTextrun() throws java.io.IOException
getTextrun
in interface IRtfTextrunContainer
java.io.IOException
- Thrown when an IO-problem occurspublic RtfTableRow getRow()
public void setLastParagraph(RtfParagraphBreak parBreak, int breakDepth)
parBreak
- the paragraph break elementbreakDepth
- The depth is necessary for picking the correct break element.
If it is deeper inside the whole cell it will be used, and if there is something on
the same level (depth) it is also set because the method is called for all breaks
in the correct order.public void finish()
Copyright 1999-2012 The Apache Software Foundation. All Rights Reserved.