Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## nextapp.echo2.app.table
Class TableColumn

    java.lang.Object
      nextapp.echo2.app.table.TableColumn

All Implemented Interfaces:
  java.io.Serializable

Direct Known Subclasses:
  SortableTableColumn

    public class TableColumn

extends java.lang.Object
implements java.io.Serializable

A description of a single column of a `Table`.

See Also:
  Serialized Form

Field Summary
`static java.lang.String` | `CELL_RENDERER_CHANGED_PROPERTY`
`static java.lang.String` | `HEADER_RENDERER_CHANGED_PROPERTY`
`static java.lang.String` | `HEADER_VALUE_CHANGED_PROPERTY`
`static java.lang.String` | `IDENTIFIER_CHANGED_PROPERTY`
`static java.lang.String` | `MODEL_INDEX_CHANGED_PROPERTY`
`static java.lang.String` | `WIDTH_CHANGED_PROPERTY`

Constructor Summary
`TableColumn(int modelIndex)` Creates a `TableColumn` with the specified model index, undefined width, and undefined cell and header renderers.
`TableColumn(int modelIndex, Extent width)` Creates a TableColumn with the specified model index and width, and undefined cell and header renderers.
`TableColumn(int modelIndex, Extent width, TableCellRenderer cellRenderer, TableCellRenderer headerRenderer)` Creates a TableColumn with the specified model index, width, and cell and header renderers.

Method Summary
`void` | `addPropertyChangeListener(java.beans.PropertyChangeListener l)` Adds a `PropertyChangeListener` to be notified of property changes to the column.
`TableCellRenderer` | `getCellRenderer()` Retrieves the `TableCellRenderer` used to render values contained in the column.
`TableCellRenderer` | `getHeaderRenderer()` Returns the `TableCellRenderer` used to render the header cell of this column.
`java.lang.Object` | `getHeaderValue()` Returns the header value for this column.
`java.lang.Object` | `getIdentifier()` Returns the identifier for this column.
`int` | `getModelIndex()` Returns the column index of the model which this `TableColumn` represents.
`Extent` | `getWidth()` Returns the width of the column.
`void` | `removePropertyChangeListener(java.beans.PropertyChangeListener l)` Removes a `PropertyChangeListener` from being notified of property changes to the column.
`void` | `setCellRenderer(TableCellRenderer newValue)` Sets the `TableCellRenderer` used to render values contained in the column.
`void` | `setHeaderRenderer(TableCellRenderer newValue)` Sets the `TableCellRenderer` used to render the header cell of this column.
`void` | `setHeaderValue(java.lang.Object newValue)` Sets the header value for this column.
`void` | `setIdentifier(java.lang.Object newValue)` Sets the identifier for this column.
`void` | `setModelIndex(int newValue)` Sets the index of the column in the `TableModel` which this `TableColumn` object represents.
`void` | `setWidth(Extent newValue)` Sets the width of the column.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### CELL_RENDERER_CHANGED_PROPERTY

    public static final java.lang.String CELL_RENDERER_CHANGED_PROPERTY

See Also:
  Constant Field Values

### HEADER_RENDERER_CHANGED_PROPERTY

    public static final java.lang.String HEADER_RENDERER_CHANGED_PROPERTY

See Also:
  Constant Field Values

### HEADER_VALUE_CHANGED_PROPERTY

    public static final java.lang.String HEADER_VALUE_CHANGED_PROPERTY

See Also:
  Constant Field Values

### IDENTIFIER_CHANGED_PROPERTY

    public static final java.lang.String IDENTIFIER_CHANGED_PROPERTY

See Also:
  Constant Field Values

### MODEL_INDEX_CHANGED_PROPERTY

    public static final java.lang.String MODEL_INDEX_CHANGED_PROPERTY

See Also:
  Constant Field Values

### WIDTH_CHANGED_PROPERTY

    public static final java.lang.String WIDTH_CHANGED_PROPERTY

See Also:
  Constant Field Values

Constructor Detail

### TableColumn

    public TableColumn(int modelIndex)

  Creates a `TableColumn` with the specified model index, undefined width, and undefined cell and header renderers.

  Parameters:
    `modelIndex` - the column index of model data visualized by this column

### TableColumn

    public TableColumn(int modelIndex,
                       Extent width)

  Creates a TableColumn with the specified model index and width, and undefined cell and header renderers.

  Parameters:
    `modelIndex` - the column index of model data visualized by this column
    `width` - the column width

### TableColumn

    public TableColumn(int modelIndex,
                       Extent width,
                       TableCellRenderer cellRenderer,
                       TableCellRenderer headerRenderer)

  Creates a TableColumn with the specified model index, width, and cell and header renderers.

  Parameters:
    `modelIndex` - the column index of model data visualized by this column
    `width` - the column width
    `cellRenderer` - the renderer to use for rendering model values
    `headerRenderer` - the renderer to use for rendering the header cell

Method Detail

### addPropertyChangeListener

    public void addPropertyChangeListener(java.beans.PropertyChangeListener l)

  Adds a `PropertyChangeListener` to be notified of property changes to the column.

  Parameters:
    `l` - the listener to add

### getCellRenderer

    public TableCellRenderer getCellRenderer()

  Retrieves the `TableCellRenderer` used to render values contained in the column. The value of this property may be null, in which case the table should revert to using its default cell renderer.

  Returns:
    the cell renderer for this column

### getHeaderRenderer

    public TableCellRenderer getHeaderRenderer()

  Returns the `TableCellRenderer` used to render the header cell of this column. The value of this property may be null, in which case the table should revert to using its default cell renderer.

  Returns:
    the header cell renderer for this column

### getHeaderValue

    public java.lang.Object getHeaderValue()

  Returns the header value for this column. The header value is the object that will be provided to the header renderer to produce a component that will be used as the table header for this column.

  Returns:
    the header value for this column

### getIdentifier

    public java.lang.Object getIdentifier()

  Returns the identifier for this column. Each table column may have an identifier. Identifiers are provided as a convenience to the application developer, and are neither used nor required by the `Table` component.

  Returns:
    the identifier for this column

### getModelIndex

    public int getModelIndex()

  Returns the column index of the model which this `TableColumn` represents. This value is independent of the column's position within the column model, such that columns may be displayed in an arbitrary order.

  Returns:
    the index of the column in the model

### getWidth

    public Extent getWidth()

  Returns the width of the column. This property supports `Extent`s with fixed or percentile units.

  Returns:
    the width

### removePropertyChangeListener

    public void removePropertyChangeListener(java.beans.PropertyChangeListener l)

  Removes a `PropertyChangeListener` from being notified of property changes to the column.

  Parameters:
    `l` - the listener to remove

### setCellRenderer

    public void setCellRenderer(TableCellRenderer newValue)

  Sets the `TableCellRenderer` used to render values contained in the column. The value of this property may be null, in which case the table should revert to using its default cell renderer.

  Parameters:
    `newValue` - the new cell renderer

### setHeaderRenderer

    public void setHeaderRenderer(TableCellRenderer newValue)

  Sets the `TableCellRenderer` used to render the header cell of this column. The value of this property may be null, in which case the table should revert to using its default cell renderer.

  Parameters:
    `newValue` - the new header cell renderer

### setHeaderValue

    public void setHeaderValue(java.lang.Object newValue)

  Sets the header value for this column. The header value is the object that will be provided to the header renderer to produce a component that will be used as the table header for this column.

  Parameters:
    `newValue` - the new header value

### setIdentifier

    public void setIdentifier(java.lang.Object newValue)

  Sets the identifier for this column. Each table column may have an identifier. Identifiers are provided as a convenience to the application developer, and are neither used nor required by the Table component.

  Parameters:
    `newValue` - The new identifier for this column.

### setModelIndex

    public void setModelIndex(int newValue)

  Sets the index of the column in the `TableModel` which this `TableColumn` object represents. This value is independent of the column's position within the column model, such that columns may be displayed in an arbitrary order.

  Parameters:
    `newValue` - the index of the column in the model

### setWidth

    public void setWidth(Extent newValue)

  Sets the width of the column. This property supports `Extent`s with fixed or percentile units.

  Parameters:
    `newValue` - the new width

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD