|
WebLogic Process Integrator Version 1.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.table.AbstractTableModel | +--com.bea.wlpi.client.common.MappedTableModel | +--com.bea.wlpi.client.common.SortableTableModel
A sorter for TableModel
s. The sorter has a backing model
(conforming to TableModel
) and implements
TableModel
. SortableTableModel
does not store
or copy the data in the TableModel
, instead it maintains a
parallel array of integer indexes into the underlying table model. The
sorter registers itself with the underlying model as a
TableModelListener
and responds to changes in the model by
adjusting or reallocating its index array. As requests are made of the
sorter (like getValueAt(row, col)
it redirects them to its
model via the mapping array. That way the SortableTableModel
appears to hold another copy of the table with the rows in a different
order. The sorter uses a stable algorithm, which means that it does not
move rows around when its comparison function returns 0 to denote that
they are equivalent.
Field Summary | |
static boolean |
debug
|
Fields inherited from class com.bea.wlpi.client.common.MappedTableModel |
model |
Fields inherited from class javax.swing.table.AbstractTableModel |
listenerList |
Constructor Summary | |
SortableTableModel()
Create a new SortableTableModel with no backing model. |
|
SortableTableModel(javax.swing.table.TableModel model)
Create a new SortableTableModel with the specified backing
model. |
Method Summary | |
int |
getMappedRow(int row)
Return a mapped row number. |
int |
getSortIndex()
Return the current sort column index. |
java.lang.Object |
getValueAt(int row,
int col)
Return a table cell value. |
boolean |
isSortAscending()
Check whether sort order is ascending or descending. |
void |
load(java.util.Properties prop,
java.lang.String prefix)
Retrieve the sort column index and sort order from a Properties object. |
void |
setModel(javax.swing.table.TableModel model)
Set the backing model. |
void |
setValueAt(java.lang.Object value,
int row,
int col)
Set a table cell value. |
void |
sort()
Re-sort the table using the previously specified column and order. |
void |
sort(int col)
Sort the table on the specified column in ascending order. |
void |
sort(int col,
boolean ascending)
Sort the table on the specified column in the specified order. |
void |
store(java.util.Properties prop,
java.lang.String prefix)
Store the sort column index and sort order. |
void |
tableChanged(javax.swing.event.TableModelEvent e)
Respond to a "table changed" notification event. |
Methods inherited from class com.bea.wlpi.client.common.MappedTableModel |
getColumnClass,
getColumnCount,
getColumnName,
getModel,
getRowCount,
isCellEditable |
Methods inherited from class javax.swing.table.AbstractTableModel |
addTableModelListener,
findColumn,
fireTableCellUpdated,
fireTableChanged,
fireTableDataChanged,
fireTableRowsDeleted,
fireTableRowsInserted,
fireTableRowsUpdated,
fireTableStructureChanged,
removeTableModelListener |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static boolean debug
Constructor Detail |
public SortableTableModel()
SortableTableModel
with no backing model.public SortableTableModel(javax.swing.table.TableModel model)
SortableTableModel
with the specified backing
model. (The backing model supplies the actual data.)model
- The backing table model.Method Detail |
public void setModel(javax.swing.table.TableModel model)
model
- The backing table model.public void sort()
sort(int)
,
sort(int, boolean)
public void sort(int col)
col
- The column number on which to sort.sort()
,
sort(int, boolean)
public void sort(int col, boolean ascending)
col == -1
, the mapping
reverts to the identity mapping.col
- The column number on which to sort.ascending
- sort()
,
sort(int)
public int getMappedRow(int row)
row
- The logical row number in the JTable.public int getSortIndex()
-1
if
unsorted.public boolean isSortAscending()
true
for ascending sort order.public void store(java.util.Properties prop, java.lang.String prefix)
prop
- A Properties
object in which to store values.prefix
- String with which to prefix the entries (caller must
avoid namespace conflicts).load(java.util.Properties, java.lang.String)
public void load(java.util.Properties prop, java.lang.String prefix)
Properties
object. It is assumed that the
Properties
object contains value from a prior call to
store
.prop
- Properties object in which to store values.prefix
- String with which to prefix the entries (caller must
avoid namespace conflicts).store(java.util.Properties, java.lang.String)
public java.lang.Object getValueAt(int row, int col)
row
- The logical row number.col
- The logical column number.public void setValueAt(java.lang.Object value, int row, int col)
value
- The value to set.row
- The logical row number.col
- The logical column number.public void tableChanged(javax.swing.event.TableModelEvent e)
e
- The notification event.
|
WebLogic Process Integrator Version 1.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |