|
swingx Version 2005-08-19 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.table.TableColumn
org.jdesktop.swingx.table.TableColumnExt
public class TableColumnExt
TableColumn extension which adds support for view column configuration features including column-visibility, sorting, and prototype values.
Field Summary | |
---|---|
protected Comparator |
comparator
the comparator to use for this column |
protected boolean |
editable
|
protected Object |
prototypeValue
|
protected Sorter |
sorter
|
protected boolean |
visible
|
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 | |
---|---|
TableColumnExt()
Creates new table view column with a model index = 0. |
|
TableColumnExt(int modelIndex)
Creates new table view column with the specified model index. |
|
TableColumnExt(int modelIndex,
int width)
Creates new table view column with the specified model index and column width. |
|
TableColumnExt(int modelIndex,
int width,
TableCellRenderer cellRenderer,
TableCellEditor cellEditor)
Creates new table view column with the specified model index, column width, cell renderer and cell editor. |
Method Summary | |
---|---|
Object |
clone()
Returns a clone of this TableColumn. |
protected void |
firePropertyChange(String propertyName,
Object oldValue,
Object newValue)
|
Object |
getClientProperty(Object key)
Retrieves the object value using the specified key. |
Comparator |
getComparator()
returns the Comparator to use for this column. |
Object |
getPrototypeValue()
|
boolean |
getResizable()
cosmetic override: don't fool users if resize is not possible due to fixed column width. |
Sorter |
getSorter()
|
String |
getSorterClass()
|
String |
getTitle()
Convenience method which returns the headerValue property after converting it to a string. |
boolean |
isEditable()
|
boolean |
isSortable()
|
boolean |
isVisible()
|
void |
putClientProperty(Object key,
Object value)
Stores the object value using the specified key. |
void |
setComparator(Comparator comparator)
sets the comparator to use for this column. |
void |
setEditable(boolean editable)
Sets the editable property. |
void |
setPrototypeValue(Object value)
Sets the prototypeValue property. |
void |
setSorterClass(String sorterClassName)
Sets a user-defined sorter for this column |
void |
setTitle(String title)
Sets the title of this view column. |
void |
setVisible(boolean visible)
Sets the visible property. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean editable
protected boolean visible
protected Object prototypeValue
protected Sorter sorter
protected Comparator comparator
Constructor Detail |
---|
public TableColumnExt()
public TableColumnExt(int modelIndex)
modelIndex
- index of table model column to which this view column
is bound.public TableColumnExt(int modelIndex, int width)
modelIndex
- index of table model column to which this view column
is bound.width
- pixel width of view columnpublic TableColumnExt(int modelIndex, int width, TableCellRenderer cellRenderer, TableCellEditor cellEditor)
modelIndex
- index of table model column to which this view column
is bound.width
- pixel width of view columncellRenderer
- the cell renderer which will render all cells in this
view columncellEditor
- the cell editor which will edit cells in this view columnMethod Detail |
---|
public boolean getResizable()
getResizable
in class TableColumn
public void setEditable(boolean editable)
true
for isCellEditable
and this
property is false
, then the user will not be permitted to
edit values from this view column, dispite the model setting.
If the model's isCellEditable
returns false
,
then this property will be ignored and cell edits will not be permitted
in this view column.
editable
- boolean indicating whether or not the user may edit cell
values in this view columnisEditable()
,
TableModel.isCellEditable(int, int)
public boolean isEditable()
setEditable(boolean)
public void setPrototypeValue(Object value)
value
- Object containing the value of the prototype to be used
to calculate the initial preferred width of the columngetPrototypeValue()
,
JXTable.getPreferredScrollableViewportSize()
public Object getPrototypeValue()
setPrototypeValue(java.lang.Object)
public void setSorterClass(String sorterClassName)
sorterClassName
- String containing the name of the class which
performs sorting on this view columnpublic String getSorterClass()
public Sorter getSorter()
public Comparator getComparator()
Comparator
to use for this columnpublic void setComparator(Comparator comparator)
comparator
- public boolean isSortable()
public void setTitle(String title)
setHeaderValue
.
title
- String containing the title of this view columnpublic String getTitle()
public void setVisible(boolean visible)
visible
- boolean indicating whether or not this view column is
visible in the tablesetVisible(boolean)
public boolean isVisible()
setVisible(boolean)
public void putClientProperty(Object key, Object value)
key
- Object which is used as key to retrieve valuevalue
- Object containing value of client property
IllegalArgumentException
- if key == nullgetClientProperty(java.lang.Object)
public Object getClientProperty(Object key)
key
- Object which is used as key to retrieve value
putClientProperty(java.lang.Object, java.lang.Object)
public Object clone()
clone
in class Object
protected void firePropertyChange(String propertyName, Object oldValue, Object newValue)
|
swingx Version 2005-08-19 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |