Package uk.ac.starlink.topcat

# Class ColumnCellRenderer

java.lang.Object
uk.ac.starlink.topcat.ColumnCellRenderer

All Implemented Interfaces:
  `ListCellRenderer<TableColumn>`

public class ColumnCellRenderer extends Object implements ListCellRenderer<TableColumn>
List cell renderer which will render StarTableColumn objects sensibly.

Since:
  20 Feb 2004
Author:
  Mark Taylor (Starlink)

## Constructor Summary

Constructors
Constructor
Description
`ColumnCellRenderer()`
Constructs a default renderer.
`ColumnCellRenderer(JComboBox<TableColumn> comboBox)`
Sets up a ColumnCellRenderer for a given combo box.

## Method Summary

Modifier and Type
Method
Description
`Component`
`getListCellRendererComponent(JList<? extends TableColumn> list, TableColumn col, int index, boolean isSelected, boolean hasFocus)`
`void`
`setNullRepresentation(Object nullRep)`
Sets the representation for the null item.

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

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

## Constructor Details

### ColumnCellRenderer

public ColumnCellRenderer(JComboBox<TableColumn> comboBox)
Sets up a ColumnCellRenderer for a given combo box. The only use of the combo box is that its tooltip text will be set to that of the description of the selected column (if there is one).

Parameters:
  `comboBox` - box to watch

### ColumnCellRenderer

public ColumnCellRenderer()
Constructs a default renderer.

## Method Details

### getListCellRendererComponent

public Component getListCellRendererComponent(JList<? extends TableColumn> list, TableColumn col, int index, boolean isSelected, boolean hasFocus)

Specified by:
  `getListCellRendererComponent` in interface `ListCellRenderer<TableColumn>`

### setNullRepresentation

public void setNullRepresentation(Object nullRep)
Sets the representation for the null item.

Parameters:
  `nullRep` - null representation object to appear in combo box