public class TableSorter
extends javax.swing.table.AbstractTableModel
Modifier and Type | Field and Description |
---|---|
static int |
ASCENDING |
static java.util.Comparator |
COMPARABLE_COMAPRATOR |
static int |
DESCENDING |
static java.util.Comparator |
LEXICAL_COMPARATOR |
static int |
NOT_SORTED |
protected javax.swing.table.TableModel |
tableModel |
Constructor and Description |
---|
TableSorter() |
TableSorter(javax.swing.table.TableModel tableModel) |
TableSorter(javax.swing.table.TableModel tableModel,
javax.swing.table.JTableHeader tableHeader) |
Modifier and Type | Method and Description |
---|---|
java.lang.Class |
getColumnClass(int column) |
int |
getColumnCount() |
java.lang.String |
getColumnName(int column) |
protected java.util.Comparator |
getComparator(int column) |
protected javax.swing.Icon |
getHeaderRendererIcon(int column,
int size) |
int |
getRowCount() |
int |
getSortingStatus(int column) |
javax.swing.table.JTableHeader |
getTableHeader() |
javax.swing.table.TableModel |
getTableModel() |
java.lang.Object |
getValueAt(int row,
int column) |
boolean |
isCellEditable(int row,
int column) |
boolean |
isSorting() |
int |
modelIndex(int viewIndex) |
void |
setColumnComparator(java.lang.Class type,
java.util.Comparator comparator) |
void |
setSortingStatus(int column,
int status) |
void |
setTableHeader(javax.swing.table.JTableHeader tableHeader) |
void |
setTableModel(javax.swing.table.TableModel tableModel) |
void |
setValueAt(java.lang.Object aValue,
int row,
int column) |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
protected javax.swing.table.TableModel tableModel
public static final int DESCENDING
public static final int NOT_SORTED
public static final int ASCENDING
public static final java.util.Comparator COMPARABLE_COMAPRATOR
public static final java.util.Comparator LEXICAL_COMPARATOR
public TableSorter()
public TableSorter(javax.swing.table.TableModel tableModel)
public TableSorter(javax.swing.table.TableModel tableModel, javax.swing.table.JTableHeader tableHeader)
public javax.swing.table.TableModel getTableModel()
public void setTableModel(javax.swing.table.TableModel tableModel)
public javax.swing.table.JTableHeader getTableHeader()
public void setTableHeader(javax.swing.table.JTableHeader tableHeader)
public boolean isSorting()
public int getSortingStatus(int column)
public void setSortingStatus(int column, int status)
protected javax.swing.Icon getHeaderRendererIcon(int column, int size)
public void setColumnComparator(java.lang.Class type, java.util.Comparator comparator)
protected java.util.Comparator getComparator(int column)
public int modelIndex(int viewIndex)
public int getRowCount()
public int getColumnCount()
public java.lang.String getColumnName(int column)
getColumnName
in interface javax.swing.table.TableModel
getColumnName
in class javax.swing.table.AbstractTableModel
public java.lang.Class getColumnClass(int column)
getColumnClass
in interface javax.swing.table.TableModel
getColumnClass
in class javax.swing.table.AbstractTableModel
public boolean isCellEditable(int row, int column)
isCellEditable
in interface javax.swing.table.TableModel
isCellEditable
in class javax.swing.table.AbstractTableModel
public java.lang.Object getValueAt(int row, int column)
public void setValueAt(java.lang.Object aValue, int row, int column)
setValueAt
in interface javax.swing.table.TableModel
setValueAt
in class javax.swing.table.AbstractTableModel