Selecting a Cell

A table cell is actually a text shape, which can be formatted just like any other text shape. To set a cell value or change its appearance, you first need to access the cell's text shape.

To access a cell's corresponding text shape use:

TextShape getCell(int row, int column)

Note that if you've selected the redundant part of a merged cell (see 'Cell Numbering System') this will return null.

Once you have the text shape you can work with it directly, e.g. adding and formatting text, adding a color etc. (for more about formatting text shapes see Formatting in the Working with Text Shapes chapter later in this Guide).

When working with text shapes in tables, it is important not to do anything with the cell that will compromise or interfere with the overall table structure, e.g. update its size or position, or move it. Primarily, this means do not call setBounds() or cut() on a table cell.


Page generated: 2008-01-18 02:53:28 GMT TonicPoint Builder Developer's Guide -- Version 2.3