com.lowagie.text.rtf

Class RtfTable

public class RtfTable extends Object

Deprecated: Please move to the RtfWriter2 and associated classes.

A Helper Class for the RtfWriter.

Do not use it directly, except if you want to write a DocumentListener for Rtf ONLY FOR USE WITH THE RtfWriter NOT with the RtfWriter2. Parts of this Class were contributed by Steffen Stundzig. Many thanks for the improvements. Updates Benoit Wiart

Field Summary
TableorigTable
Stores the Table, which this RtfTable is based on.
ArrayListrowsList
Stores the different rows.
RtfWriterwriter
Stores the RtfWriter, which created this RtfTable.
Constructor Summary
RtfTable(RtfWriter writer)
Create a new RtfTable.
Method Summary
protected TablegetOriginalTable()
This method allows access to the original Table that led to this RtfTable.
booleanimportTable(Table table, int pageWidth)
Import a Table into the RtfTable.
voidsetMerge(int x, int y, int mergeType, RtfCell mergeCell)
RtfCells call this method to specify that a certain other cell is to be merged with it.
booleanwriteTable(ByteArrayOutputStream os)
Output the content of the RtfTable to an OutputStream.

Field Detail

origTable

private Table origTable
Stores the Table, which this RtfTable is based on.

rowsList

private ArrayList rowsList
Stores the different rows.

writer

private RtfWriter writer
Stores the RtfWriter, which created this RtfTable.

Constructor Detail

RtfTable

public RtfTable(RtfWriter writer)
Create a new RtfTable.

Parameters: writer The RtfWriter that created this Table

Method Detail

getOriginalTable

protected Table getOriginalTable()
This method allows access to the original Table that led to this RtfTable.

Returns: The Table object that is the basis of this RtfTable.

importTable

public boolean importTable(Table table, int pageWidth)
Import a Table into the RtfTable.

Parameters: table A Table specifying the Table to be imported pageWidth An int specifying the page width

Returns: true if importing the table succeeded

setMerge

public void setMerge(int x, int y, int mergeType, RtfCell mergeCell)
RtfCells call this method to specify that a certain other cell is to be merged with it.

Parameters: x The column position of the cell to be merged y The row position of the cell to be merged mergeType The merge type specifies the kind of merge to be applied (MERGE_HORIZ_PREV, MERGE_VERT_PREV, MERGE_BOTH_PREV) mergeCell The RtfCell that the cell at x and y is to be merged with

writeTable

public boolean writeTable(ByteArrayOutputStream os)
Output the content of the RtfTable to an OutputStream.

Parameters: os The OutputStream that the content of the RtfTable is to be written to

Returns: true if writing the table succeeded

Throws: DocumentException IOException