|
||||||||||
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 boolean |
editable
|
protected java.lang.Object |
prototypeValue
|
protected Sorter |
sorter
|
static java.lang.String |
SORTER_COMPARATOR
|
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,
javax.swing.table.TableCellRenderer cellRenderer,
javax.swing.table.TableCellEditor cellEditor)
Creates new table view column with the specified model index, column width, cell renderer and cell editor. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Returns a clone of this TableColumn. |
protected void |
firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
|
java.lang.Object |
getClientProperty(java.lang.Object key)
Retrieves the object value using the specified key. |
java.lang.Object |
getPrototypeValue()
|
boolean |
getResizable()
cosmetic override: don't fool users if resize is not possible due to fixed column width. |
Sorter |
getSorter()
|
java.lang.String |
getSorterClass()
|
java.lang.String |
getTitle()
Convenience method which returns the headerValue property after converting it to a string. |
boolean |
isEditable()
|
boolean |
isSortable()
|
boolean |
isVisible()
|
void |
putClientProperty(java.lang.Object key,
java.lang.Object value)
Stores the object value using the specified key. |
void |
setEditable(boolean editable)
Sets the editable property. |
void |
setPrototypeValue(java.lang.Object value)
Sets the prototypeValue property. |
void |
setSorterClass(java.lang.String sorterClassName)
Sets a user-defined sorter for this column |
void |
setTitle(java.lang.String title)
Sets the title of this view column. |
void |
setVisible(boolean visible)
Sets the visible property. |
Methods inherited from class javax.swing.table.TableColumn |
---|
addPropertyChangeListener, createDefaultHeaderRenderer, disableResizedPosting, enableResizedPosting, getCellEditor, getCellRenderer, getHeaderRenderer, getHeaderValue, getIdentifier, getMaxWidth, getMinWidth, getModelIndex, getPreferredWidth, getPropertyChangeListeners, getWidth, removePropertyChangeListener, setCellEditor, setCellRenderer, setHeaderRenderer, setHeaderValue, setIdentifier, setMaxWidth, setMinWidth, setModelIndex, setPreferredWidth, setResizable, setWidth, sizeWidthToFit |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SORTER_COMPARATOR
protected boolean editable
protected boolean visible
protected java.lang.Object prototypeValue
protected Sorter sorter
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, javax.swing.table.TableCellRenderer cellRenderer, javax.swing.table.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 javax.swing.table.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(java.lang.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 java.lang.Object getPrototypeValue()
setPrototypeValue(java.lang.Object)
public void setSorterClass(java.lang.String sorterClassName)
sorterClassName
- String containing the name of the class which
performs sorting on this view columnpublic java.lang.String getSorterClass()
public Sorter getSorter()
public boolean isSortable()
public void setTitle(java.lang.String title)
setHeaderValue
.
title
- String containing the title of this view columnpublic java.lang.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(java.lang.Object key, java.lang.Object value)
key
- Object which is used as key to retrieve valuevalue
- Object containing value of client propertygetClientProperty(java.lang.Object)
public java.lang.Object getClientProperty(java.lang.Object key)
key
- Object which is used as key to retrieve value
putClientProperty(java.lang.Object, java.lang.Object)
public java.lang.Object clone()
clone
in class java.lang.Object
protected void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |