|
HOME | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.table.AbstractTableModel | +--javax.swing.table.DefaultTableModel | +--com.ultraswing.DefaultSortableTableModel
This is an implementation of SortableTableModel
Field Summary |
Fields inherited from class javax.swing.table.DefaultTableModel |
columnIdentifiers, dataVector |
Fields inherited from class javax.swing.table.AbstractTableModel |
listenerList |
Constructor Summary | |
DefaultSortableTableModel()
Constructs a DefaultSortableTableModel |
|
DefaultSortableTableModel(int rowCount,
int columnCount)
Constructs a DefaultSortableTableModel with rowCount and columnCount of null object values. |
|
DefaultSortableTableModel(Object[][] data,
Object[] columnNames)
Constructs a DefaultSortableTableModel and initializes the table
by passing data and columnNames
to the setDataVector
method. |
|
DefaultSortableTableModel(Object[] columnNames,
int numRows)
Constructs a DefaultSortableTableModel with as many
columns as there are elements in columnNames
and numRows of null
object values. |
|
DefaultSortableTableModel(Vector columnNames,
int numRows)
Constructs a DefaultSortableTableModel with as many columns
as there are elements in columnNames
and numRows of null
object values. |
|
DefaultSortableTableModel(Vector data,
Vector columnNames)
Constructs a DefaultSortableTableModel and initializes the table
by passing data and columnNames
to the setDataVector method. |
Method Summary | |
int |
getSortedColumnIndex()
Returns the sorted column, or -1 if no column is sorted |
boolean |
isAscending()
Returns true if it's ascending order |
boolean |
isSortable(int col)
Returns true if this table model is sortable |
void |
setSortByColumn(int column,
boolean ascending)
Sets the sorting order of colum |
Methods inherited from class javax.swing.table.DefaultTableModel |
addColumn, addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getColumnCount, getColumnName, getDataVector, getRowCount, getValueAt, insertRow, insertRow, isCellEditable, moveRow, newDataAvailable, newRowsAdded, removeRow, rowsRemoved, setColumnCount, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setRowCount, setValueAt |
Methods inherited from class javax.swing.table.AbstractTableModel |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.swing.table.TableModel |
addTableModelListener, getColumnClass, getColumnCount, getColumnName, getRowCount, getValueAt, isCellEditable, removeTableModelListener, setValueAt |
Constructor Detail |
public DefaultSortableTableModel()
DefaultSortableTableModel
public DefaultSortableTableModel(int rowCount, int columnCount)
DefaultSortableTableModel
with rowCount
and columnCount
of null object values.
public DefaultSortableTableModel(Object[][] data, Object[] columnNames)
DefaultSortableTableModel
and initializes the table
by passing data
and columnNames
to the setDataVector
method. The first index in the Object[][]
array is
the row index and the second is the column index.
data
- the data of the tablecolumnNames
- the names of the columnspublic DefaultSortableTableModel(Object[] columnNames, int numRows)
DefaultSortableTableModel
with as many
columns as there are elements in columnNames
and numRows
of null
object values. Each column's name will be taken from
the columnNames
array.
columnNames
- array
containing the names
of the new columns. If this is
null
then the model has no columnsnumRows
- the number of rows the table holdspublic DefaultSortableTableModel(Vector columnNames, int numRows)
DefaultSortableTableModel
with as many columns
as there are elements in columnNames
and numRows
of null
object values. Each column's name will be taken from
the columnNames
vector.
columnNames
- vector
containing the names
of the new columns. If this is
null
then the model has no columnsnumRows
- the number of rows the table holdsDefaultTableModel.setDataVector(java.util.Vector, java.util.Vector)
,
DefaultTableModel.setValueAt(java.lang.Object, int, int)
public DefaultSortableTableModel(Vector data, Vector columnNames)
DefaultSortableTableModel
and initializes the table
by passing data
and columnNames
to the setDataVector
method.
data
- the data of the tablecolumnNames
- vector
containing the names
of the new columnsMethod Detail |
public boolean isSortable(int col)
isSortable
in interface SortableTableModel
public void setSortByColumn(int column, boolean ascending)
colum
setSortByColumn
in interface SortableTableModel
column
- colum indexascending
- if true, sort the specified column into ascending orderpublic boolean isAscending()
isAscending
in interface SortableTableModel
public int getSortedColumnIndex()
getSortedColumnIndex
in interface SortableTableModel
|
HOME | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |