protected class XJTable.SortingModel extends AbstractTableModel implements TableModelListener
Modifier and Type | Class and Description |
---|---|
protected class |
XJTable.SortingModel.ValueHolder |
protected class |
XJTable.SortingModel.ValueHolderComparator |
Modifier and Type | Field and Description |
---|---|
protected XJTable.SortingModel.ValueHolderComparator |
compWrapper |
protected TableModel |
sourceModel |
protected int[] |
sourceToTarget
The direct index
|
protected int[] |
targetToSource
The reverse index.
|
listenerList
Constructor and Description |
---|
SortingModel(TableModel sourceModel) |
Modifier and Type | Method and Description |
---|---|
protected void |
buildTargetToSourceIndex()
Builds the reverse index based on the new sorting order.
|
Class<?> |
getColumnClass(int columnIndex) |
int |
getColumnCount() |
String |
getColumnName(int columnIndex) |
int |
getRowCount() |
Object |
getValueAt(int row,
int column) |
protected void |
init(TableModel sourceModel) |
boolean |
isCellEditable(int rowIndex,
int columnIndex) |
void |
setValueAt(Object aValue,
int rowIndex,
int columnIndex) |
void |
sort()
Sorts the table using the values in the specified column and sorting order.
|
int |
sourceToTarget(int index)
Converts an index from the source coordinates to the target ones.
|
void |
tableChanged(TableModelEvent e)
This gets events from the source model and forwards them to the UI
|
int |
targetToSource(int index)
Converts an index from the target coordinates to the source ones.
|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
protected int[] sourceToTarget
protected int[] targetToSource
protected TableModel sourceModel
protected XJTable.SortingModel.ValueHolderComparator compWrapper
public SortingModel(TableModel sourceModel)
protected void init(TableModel sourceModel)
public void tableChanged(TableModelEvent e)
tableChanged
in interface TableModelListener
public int getRowCount()
getRowCount
in interface TableModel
public int getColumnCount()
getColumnCount
in interface TableModel
public String getColumnName(int columnIndex)
getColumnName
in interface TableModel
getColumnName
in class AbstractTableModel
public Class<?> getColumnClass(int columnIndex)
getColumnClass
in interface TableModel
getColumnClass
in class AbstractTableModel
public boolean isCellEditable(int rowIndex, int columnIndex)
isCellEditable
in interface TableModel
isCellEditable
in class AbstractTableModel
public void setValueAt(Object aValue, int rowIndex, int columnIndex)
setValueAt
in interface TableModel
setValueAt
in class AbstractTableModel
public Object getValueAt(int row, int column)
getValueAt
in interface TableModel
public void sort()
public int sourceToTarget(int index)
index
- the index in the source coordinates.public int targetToSource(int index)
index
- the index in the target coordinates.
Used to propagate events from the view (e.g. editing) to the source
data source (table model).protected void buildTargetToSourceIndex()
Copyright © 2024 GATE. All rights reserved.