| Package | org.aswing.table.sorter |
| Class | public class TableSorter |
| Inheritance | TableSorter AbstractTableModel |
| Implements | TableModelListener |
var sorter:TableSorter = new TableSorter(yourTableModel); sorter.setTableHeader(yourTable.getTableHeader()); yourTable.setModel(sorter);
| Property | Defined by | ||
|---|---|---|---|
| ASCENDING : int = 1 [static]
| TableSorter | ||
| DESCENDING : int = -1 [static]
| TableSorter | ||
| LEXICAL_COMPARATOR : Function [static]
| TableSorter | ||
| NOT_SORTED : int = 0 [static]
| TableSorter | ||
| NUMBER_COMAPRATOR : Function [static]
| TableSorter | ||
| Method | Defined by | ||
|---|---|---|---|
|
TableSorter(tableModel:TableModel, tableHeader:JTableHeader)
TableSorter(tableModel:TableModel) TableSorter() | TableSorter | ||
![]() |
Adds a listener to the list that's notified each time a change
to the data model occurs.
| AbstractTableModel | |
|
cancelSorting():void
Cancels all sorting column to be NOT_SORTED.
| TableSorter | ||
![]() |
findColumn(columnName:String):int
Returns a column given its name.
| AbstractTableModel | |
|
getColumnClass(column:int):String
| TableSorter | ||
|
getColumnCount():int
| TableSorter | ||
|
getColumnName(column:int):String
| TableSorter | ||
|
getComparator(column:int):Function
Returns the comparator function for given column.
| TableSorter | ||
|
getHeaderRendererIcon(column:int, size:int):Icon
| TableSorter | ||
|
getRowCount():int
| TableSorter | ||
|
getSortingColumns():Array
| TableSorter | ||
|
getSortingStatus(column:int):int
| TableSorter | ||
| TableSorter | |||
| TableSorter | |||
![]() |
getTableModelListeners():Array
Returns an array of all the table model listeners
registered on this model.
| AbstractTableModel | |
|
getValueAt(row:int, column:int):*
| TableSorter | ||
|
isCellEditable(row:int, column:int):Boolean
| TableSorter | ||
|
isColumnSortable(column:int):Boolean
Returns specified column sortable, default is true.
| TableSorter | ||
|
isSorting():Boolean
| TableSorter | ||
|
modelIndex(viewIndex:int):int
Calculates the model index from the sorted index.
| TableSorter | ||
![]() |
Removes a listener from the list that's notified each time a
change to the data model occurs.
| AbstractTableModel | |
![]() |
setColumnClass(columnIndex:int, className:String):void
Sets class name regardless of
columnIndex. | AbstractTableModel | |
|
setColumnComparator(columnClass:String, comparator:Function):void
Sets a comparator the specified columnClass.
| TableSorter | ||
|
setColumnSortable(column:int, sortable:Boolean):void
Sets specified column sortable, default is true.
| TableSorter | ||
|
setSortingStatus(column:int, status:int):void
Sets specified column to be sort as specified direction.
| TableSorter | ||
|
setTableHeader(tableHeader:JTableHeader):void
Sets the table header
| TableSorter | ||
|
setTableModel(tableModel:TableModel):void
Sets the tableModel
| TableSorter | ||
|
setValueAt(aValue:*, row:int, column:int):void
| TableSorter | ||
|
tableChanged(e:TableModelEvent):void
| TableSorter | ||
![]() |
toString():String
| AbstractTableModel | |
| Method | Defined by | ||
|---|---|---|---|
![]() |
fireTableCellUpdated(row:int, column:int):void
Notifies all listeners that the value of the cell at
[row, column] has been updated. | AbstractTableModel | |
![]() |
fireTableChanged(e:TableModelEvent):void
Forwards the given notification event to all
TableModelListeners that registered
themselves as listeners for this table model. | AbstractTableModel | |
![]() |
fireTableDataChanged():void
Notifies all listeners that all cell values in the table's
rows may have changed.
| AbstractTableModel | |
![]() |
fireTableRowsDeleted(firstRow:int, lastRow:int):void
Notifies all listeners that rows in the range
[firstRow, lastRow], inclusive, have been deleted. | AbstractTableModel | |
![]() |
fireTableRowsInserted(firstRow:int, lastRow:int):void
Notifies all listeners that rows in the range
[firstRow, lastRow], inclusive, have been inserted. | AbstractTableModel | |
![]() |
fireTableRowsUpdated(firstRow:int, lastRow:int):void
Notifies all listeners that rows in the range
[firstRow, lastRow], inclusive, have been updated. | AbstractTableModel | |
![]() |
fireTableStructureChanged():void
Notifies all listeners that the table's structure has changed.
| AbstractTableModel | |
|
nextSortingStatus(curStatus:int, shiftKey:Boolean):int
| TableSorter | ||
| ASCENDING | property |
public static var ASCENDING:int = 1
| DESCENDING | property |
public static var DESCENDING:int = -1
| LEXICAL_COMPARATOR | property |
public static var LEXICAL_COMPARATOR:Function
| NOT_SORTED | property |
public static var NOT_SORTED:int = 0
| NUMBER_COMAPRATOR | property |
public static var NUMBER_COMAPRATOR:Function
| TableSorter | () | constructor |
public function TableSorter(tableModel:TableModel, tableHeader:JTableHeader = null)
TableSorter(tableModel:TableModel, tableHeader:JTableHeader)
TableSorter(tableModel:TableModel)
TableSorter()
tableModel:TableModel |
|
tableHeader:JTableHeader (default = null) |
| cancelSorting | () | method |
public function cancelSorting():voidCancels all sorting column to be NOT_SORTED.
| getColumnClass | () | method |
public override function getColumnClass(column:int):StringParameters
column:int |
String |
| getColumnCount | () | method |
public override function getColumnCount():int
Returns
int |
| getColumnName | () | method |
public override function getColumnName(column:int):StringParameters
column:int |
String |
| getComparator | () | method |
public function getComparator(column:int):FunctionReturns the comparator function for given column.
Parameterscolumn:int |
Function — the comparator function for given column.
|
See also
| getHeaderRendererIcon | () | method |
public function getHeaderRendererIcon(column:int, size:int):IconParameters
column:int |
|
size:int |
Icon |
| getRowCount | () | method |
public override function getRowCount():int
Returns
int |
| getSortingColumns | () | method |
public function getSortingColumns():Array
Returns
Array |
| getSortingStatus | () | method |
public function getSortingStatus(column:int):intParameters
column:int |
int |
| getTableHeader | () | method |
| getTableModel | () | method |
| getValueAt | () | method |
public override function getValueAt(row:int, column:int):*Parameters
row:int |
|
column:int |
* |
| isCellEditable | () | method |
public override function isCellEditable(row:int, column:int):BooleanParameters
row:int |
|
column:int |
Boolean |
| isColumnSortable | () | method |
public function isColumnSortable(column:int):BooleanReturns specified column sortable, default is true.
Parameterscolumn:int |
Boolean — true if the column is sortable, false otherwish
|
| isSorting | () | method |
public function isSorting():Boolean
Returns
Boolean |
| modelIndex | () | method |
public function modelIndex(viewIndex:int):intCalculates the model index from the sorted index.
ParametersviewIndex:int |
int — the index in model from the sorter model index
|
| nextSortingStatus | () | method |
protected function nextSortingStatus(curStatus:int, shiftKey:Boolean):intParameters
curStatus:int |
|
shiftKey:Boolean |
int |
| setColumnComparator | () | method |
public function setColumnComparator(columnClass:String, comparator:Function):voidSets a comparator the specified columnClass. For example:
setColumnComparator("Number", aNumberComparFunction);
Parameters
columnClass:String — the column class name
|
|
comparator:Function — the comparator function should be this spec:
function(o1, o2):int, it should return -1 or 0 or 1.
|
See also
| setColumnSortable | () | method |
public function setColumnSortable(column:int, sortable:Boolean):voidSets specified column sortable, default is true.
Parameterscolumn:int — column
|
|
sortable:Boolean — true to set the column sortable, false to not
|
| setSortingStatus | () | method |
public function setSortingStatus(column:int, status:int):voidSets specified column to be sort as specified direction.
Parameterscolumn:int — the column to be sort
|
|
status:int — sort direction, should be one of these values:
|
| setTableHeader | () | method |
public function setTableHeader(tableHeader:JTableHeader):voidSets the table header
ParameterstableHeader:JTableHeader — the table header
|
| setTableModel | () | method |
public function setTableModel(tableModel:TableModel):voidSets the tableModel
ParameterstableModel:TableModel — the tableModel
|
| setValueAt | () | method |
public override function setValueAt(aValue:*, row:int, column:int):voidParameters
aValue:* |
|
row:int |
|
column:int |
| tableChanged | () | method |