|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.table.TableColumn
org.jcreme.swing.table.SortableTableColumn
This is an extension of the standard table columns. The additional features are the ability to handle an order and a comparator. These can be used to implement sorted tables.
Field Summary |
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 | |
SortableTableColumn()
Creates new SortableTableColumn |
|
SortableTableColumn(int modelIndex)
Creates new SortableTableColumn |
|
SortableTableColumn(int modelIndex,
int width)
Creates new SortableTableColumn |
|
SortableTableColumn(int modelIndex,
int width,
javax.swing.table.TableCellRenderer cellRenderer,
javax.swing.table.TableCellEditor cellEditor)
Creates new SortableTableColumn |
Method Summary | |
void |
addTableColumnOrderListener(TableColumnOrderListener listener)
Enables to add a listener that will be activated every time changes happen in the column that may alter the order of the values. |
protected void |
fireTableColumnOrderEvent(TableColumnOrderEvent event)
The method called to activate the listeners. |
java.lang.Class |
getColumnClass()
Gives access to the Class of the elements presented in this Column. |
ComparatorType |
getComparator()
Gives access to the comparator that is in use in this column. |
SortOrder |
getOrder()
Gives access to the sort order of the column. |
java.lang.Integer |
getOrderInSort()
Gives access to the order of the column in the sort. |
void |
removeTableColumnOrderListener(TableColumnOrderListener listener)
Removes a listener from the list of the registered listeners. |
void |
setColumnClass(java.lang.Class clazz)
Enables to change the Class of the elements presented in this Column. |
void |
setComparator(ComparatorType cmp)
This method enables to set a custom comparator for this column. |
void |
setOrder(SortOrder order)
This method enables to set the sort order (ascending, descending, none) for the given column. |
void |
setOrderInSort(java.lang.Integer orderInSort)
Enables to change the order of the column in the sort. |
Methods inherited from class javax.swing.table.TableColumn |
addPropertyChangeListener, createDefaultHeaderRenderer, disableResizedPosting, enableResizedPosting, getCellEditor, getCellRenderer, getHeaderRenderer, getHeaderValue, getIdentifier, getMaxWidth, getMinWidth, getModelIndex, getPreferredWidth, getPropertyChangeListeners, getResizable, getWidth, removePropertyChangeListener, setCellEditor, setCellRenderer, setHeaderRenderer, setHeaderValue, setIdentifier, setMaxWidth, setMinWidth, setModelIndex, setPreferredWidth, setResizable, setWidth, sizeWidthToFit |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SortableTableColumn()
public SortableTableColumn(int modelIndex)
modelIndex
- the index of the column in the column model.public SortableTableColumn(int modelIndex, int width)
modelIndex
- the index of the column in the column model.width
- the width of the column.public SortableTableColumn(int modelIndex, int width, javax.swing.table.TableCellRenderer cellRenderer, javax.swing.table.TableCellEditor cellEditor)
modelIndex
- the index of the column in the column model.width
- the width of the column.cellRenderer
- the renderer to use to display the values in this column.cellEditor
- the editor to use to edit the values in this column.Method Detail |
public void setOrder(SortOrder order)
order
- the custom order. Erase any previously set SortOrder if it is
null or SortOrder.NONE.public SortOrder getOrder()
public void setOrderInSort(java.lang.Integer orderInSort)
orderInSort
- the new order of the column in the sort.public java.lang.Integer getOrderInSort()
public void setColumnClass(java.lang.Class clazz)
clazz
- public java.lang.Class getColumnClass()
public void setComparator(ComparatorType cmp)
cmp
- the custom comparator. Erase any previously set comparator if
it is null.public ComparatorType getComparator()
public void addTableColumnOrderListener(TableColumnOrderListener listener)
listener
- the listener to notify.public void removeTableColumnOrderListener(TableColumnOrderListener listener)
listener
- the listener to remove.protected void fireTableColumnOrderEvent(TableColumnOrderEvent event)
event
- the event to send to the listeners.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |