T
- the object type of the header valuepublic class TreeTableColumn<T> extends NamedObject
IColumnModel
,
KeyColumn
,
IColumnHeaderRenderer
,
ITreeTableModel.getColumnValue(Object, int)
Modifier and Type | Field and Description |
---|---|
static String |
PROPERTY_COLUMN_CLASS
A property constant used for property change events that get fired when
the column class of the column gets changed.
|
static String |
PROPERTY_HEADER_VALUE
A property constant used for property change events that get fired when
the header value of the column gets changed.
|
static String |
PROPERTY_MAX_WIDTH
A property constant used for property change events that get fired when
the maximum width of the column gets changed.
|
static String |
PROPERTY_MIN_WIDTH
A property constant used for property change events that get fired when
the minimum width of the column gets changed.
|
static String |
PROPERTY_MODEL_INDEX
A property constant used for property change events that get fired when
the model index of the column gets changed.
|
static String |
PROPERTY_WIDTH
A property constant used for property change events that get fired when
the width of the column gets changed.
|
PROPERTY_NAME
Constructor and Description |
---|
TreeTableColumn(String name,
Class columnClass)
Constructs a new tree table column.
|
TreeTableColumn(String name,
Class columnClass,
int modelIndex)
Constructs a new tree table column.
|
Modifier and Type | Method and Description |
---|---|
ITreeTableCellRenderer |
getCellRenderer()
Returns the cell renderer used for values in this column.
|
Class |
getColumnClass()
Returns the object type of the data shown in the column.
|
T |
getHeaderValue()
Returns the object that represents the value used for the header
renderer.
|
int |
getMaximumWidth()
Returns the column's maximum width.
|
int |
getMinimumWidth()
Returns the minimum width of the column.
|
int |
getModelIndex()
Returns the column's model index which is independent of the column's
current position within the tree table.
|
SortDirection[] |
getSupportedSortDirections()
Returns the sort directions that are supported by the tree table header.
|
int |
getWidth()
Returns the current width of the column.
|
boolean |
isSortable()
Determines if the column is sortable at all, when it supports
SortDirection.ASCENDING or SortDirection.DESCENDING . |
boolean |
isSupported(SortDirection direction)
Determines if the given sort direction is supported by the tree table
header.
|
void |
setCellRenderer(ITreeTableCellRenderer renderer)
/**
Sets the cell renderer used for values in this column.
|
void |
setColumnClass(Class cl)
Specifies a new object type for the data shown in the column.
|
void |
setHeaderValue(T value)
Sets a new value that will be used by a
IColumnHeaderRenderer to
draw a header for the column. |
void |
setMaximumWidth(int maxWidth)
Sets a new maximum width on the column.
|
void |
setMinimumWidth(int minWidth)
Sets a new minimum width on the column.
|
void |
setModelIndex(int index)
Specifies a new model index represented by the column.
|
void |
setSupportedSortDirections(SortDirection[] directions)
Sets the sort directions that are supported by the tree table header.
|
void |
setWidth(int width)
Sets the preferred width of the column.
|
String |
toString()
Returns the result of
headerValue.toString() . |
addPropertyChangeListener, compareTo, getChangeSupport, getName, removePropertyChangeListener, setName
public static final String PROPERTY_WIDTH
public static final String PROPERTY_HEADER_VALUE
public static final String PROPERTY_MIN_WIDTH
public static final String PROPERTY_MAX_WIDTH
public static final String PROPERTY_COLUMN_CLASS
public static final String PROPERTY_MODEL_INDEX
public TreeTableColumn(String name, Class columnClass, int modelIndex)
name
- the name of the column (used for sorting and in menus)columnClass
- the object type of the objects shown in the column (used for
looking up the correct editor and renderer for cells where no
value can be found)modelIndex
- the index of the data in the tree table modelpublic TreeTableColumn(String name, Class columnClass)
name
- the name of the column (used for sorting and in menus)columnClass
- the object type of the objects shown in the column (used for
looking up the correct editor and renderer for cells where no
value can be found)public T getHeaderValue()
IColumnHeaderRenderer
public void setHeaderValue(T value)
IColumnHeaderRenderer
to
draw a header for the column.value
- the new value used for rendering the header of the columnpublic boolean isSortable()
SortDirection.ASCENDING
or SortDirection.DESCENDING
.isSupported(SortDirection)
public int getModelIndex()
public void setModelIndex(int index)
index
- public void setWidth(int width)
PROPERTY_WIDTH
.width
- the width of the columnpublic int getWidth()
setWidth(int)
public String toString()
headerValue.toString()
.toString
in class NamedObject
public int getMinimumWidth()
setMinimumWidth(int)
public void setMinimumWidth(int minWidth)
PROPERTY_MIN_WIDTH
.minWidth
- the new minimum width of the columngetMinimumWidth()
public int getMaximumWidth()
setMaximumWidth(int)
public void setMaximumWidth(int maxWidth)
PROPERTY_MAX_WIDTH
.maxWidth
- the new maximum width of the columngetMaximumWidth()
public Class getColumnClass()
setColumnClass(Class)
public void setColumnClass(Class cl)
cl
- the column value's object typegetColumnClass()
public SortDirection[] getSupportedSortDirections()
public void setSupportedSortDirections(SortDirection[] directions)
directions
- the supported sort directionspublic boolean isSupported(SortDirection direction)
direction
- the sort direction to checkpublic ITreeTableCellRenderer getCellRenderer()
public void setCellRenderer(ITreeTableCellRenderer renderer)
renderer
- the column cell rendererCopyright © 2006–2016 Dirk Lemmermann Software & Consulting. All rights reserved.