org.apache.pivot.wtk
Interface TableView.CellRenderer

All Superinterfaces:
ConstrainedVisual, Renderer, Visual
All Known Implementing Classes:
TableViewBooleanCellRenderer, TableViewCellRenderer, TableViewCheckboxCellRenderer, TableViewDateCellRenderer, TableViewFileSizeCellRenderer, TableViewImageCellRenderer, TableViewMultiCellRenderer, TableViewNumberCellRenderer, TableViewTextAreaCellRenderer, TableViewTriStateCellRenderer, TerraFileBrowserSkin.TableViewFileRenderer
Enclosing class:
TableView

public static interface TableView.CellRenderer
extends Renderer

Renderer interface to customize the appearance of a cell in a TableView.


Method Summary
 void render(Object row, int rowIndex, int columnIndex, TableView tableView, String columnName, boolean selected, boolean highlighted, boolean disabled)
          Prepares the renderer for layout or paint.
 String toString(Object row, String columnName)
          Converts table view cell data to a string representation.
 
Methods inherited from interface org.apache.pivot.wtk.Renderer
getStyles
 
Methods inherited from interface org.apache.pivot.wtk.ConstrainedVisual
getBaseline, getPreferredHeight, getPreferredSize, getPreferredWidth, setSize
 
Methods inherited from interface org.apache.pivot.wtk.Visual
getBaseline, getHeight, getWidth, paint
 

Method Detail

render

void render(Object row,
            int rowIndex,
            int columnIndex,
            TableView tableView,
            String columnName,
            boolean selected,
            boolean highlighted,
            boolean disabled)
Prepares the renderer for layout or paint.

Parameters:
row - The row to render, or null if called to calculate preferred height for skins that assume a fixed renderer height.
rowIndex - The index of the row being rendered, or -1 if value is null.
columnIndex - The index of the column being rendered.
tableView - The host component.
columnName - The name of the column being rendered.
selected - If true, the row is selected.
highlighted - If true, the row is highlighted.
disabled - If true, the row is disabled.

toString

String toString(Object row,
                String columnName)
Converts table view cell data to a string representation.

Parameters:
row -
columnName -
Returns:
The cell data's string representation, or null if the data does not have a string representation.

Note that this method may be called often during keyboard navigation, so implementations should avoid unnecessary string allocations.