Package groovy.swing.model

# Class DefaultTableColumn

java.lang.Object
javax.swing.table.TableColumn
groovy.swing.model.DefaultTableColumn

All Implemented Interfaces:
  `Serializable`

public class DefaultTableColumn extends TableColumn
A `TableColumn` backed by a `ValueModel` for reading and writing cell values.

See Also:
  - Serialized Form

- ## Field Summary

  ### Fields inherited from class javax.swing.table.TableColumn

  `CELL_RENDERER_PROPERTY, cellEditor, cellRenderer, COLUMN_WIDTH_PROPERTY, HEADER_RENDERER_PROPERTY, HEADER_VALUE_PROPERTY, headerRenderer, headerValue, identifier, isResizable, maxWidth, minWidth, modelIndex, resizedPostingDisableCount, width`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DefaultTableColumn(ValueModel valueModel)`
  Creates a column backed by the supplied value model.
  `DefaultTableColumn(Object header, ValueModel valueModel)`
  Creates a column with a header value and backing value model.
  `DefaultTableColumn(Object headerValue, Object identifier, ValueModel columnValueModel)`
  Creates a column with header and identifier values.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Class`
  `getType()`
  `Object`
  `getValue(Object row, int rowIndex, int columnIndex)`
  Evaluates the value of a cell
  `ValueModel`
  `getValueModel()`
  Returns the value model used by this column.
  `void`
  `setValue(Object row, Object value, int rowIndex, int columnIndex)`
  Writes a cell value through the backing value model.
  `String`
  `toString()`
  Returns a debug-friendly description of this column and its backing value model.

  ### Methods inherited from class javax.swing.table.TableColumn

  `addPropertyChangeListener, createDefaultHeaderRenderer, disableResizedPosting, enableResizedPosting, getCellEditor, getCellRenderer, getHeaderRenderer, getHeaderValue, getIdentifier, getMaxWidth, getMinWidth, getModelIndex, getPreferredWidth, getPropertyChangeListeners, getResizable, getWidth, removePropertyChangeListener, setCellEditor, setCellRenderer, setHeaderRenderer, setHeaderValue, setIdentifier, setMaxWidth, setMinWidth, setModelIndex, setPreferredWidth, setResizable, setWidth, sizeWidthToFit`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### DefaultTableColumn

    public DefaultTableColumn(ValueModel valueModel)
    Creates a column backed by the supplied value model.
    Parameters:
      `valueModel` - the value model used to access cell values

  - ### DefaultTableColumn

    public DefaultTableColumn(Object header, ValueModel valueModel)
    Creates a column with a header value and backing value model.
    Parameters:
      `header` - the column header value
      `valueModel` - the value model used to access cell values

  - ### DefaultTableColumn

    public DefaultTableColumn(Object headerValue, Object identifier, ValueModel columnValueModel)
    Creates a column with header and identifier values.
    Parameters:
      `headerValue` - the column header value
      `identifier` - the logical identifier for the column
      `columnValueModel` - the value model used to access cell values

- ## Method Details

  - ### toString

    public String toString()
    Returns a debug-friendly description of this column and its backing value model.
    Overrides:
      `toString` in class `Object`
    Returns:
      the column description

  - ### getValue

    public Object getValue(Object row, int rowIndex, int columnIndex)
    Evaluates the value of a cell
    Parameters:
      `row` - the row of interest
      `rowIndex` - the index of the row of interest
      `columnIndex` - the column of interest
    Returns:
      the value

  - ### setValue

    public void setValue(Object row, Object value, int rowIndex, int columnIndex)
    Writes a cell value through the backing value model.
    Parameters:
      `row` - the row object that owns the value
      `value` - the new cell value
      `rowIndex` - the source row index
      `columnIndex` - the source column index

  - ### getType

    public Class getType()
    Returns:
      the column type

  - ### getValueModel

    public ValueModel getValueModel()
    Returns the value model used by this column.
    Returns:
      the backing value model