public class ObjectTableSorter extends javax.swing.RowSorter<ObjectTableModel>
RowSorter for ObjectTableModel| Modifier and Type | Class and Description |
|---|---|
protected class |
ObjectTableSorter.PreserveLastRowComparator |
class |
ObjectTableSorter.Row
View row with model mapping.
|
| Constructor and Description |
|---|
ObjectTableSorter(ObjectTableModel model) |
| Modifier and Type | Method and Description |
|---|---|
void |
allRowsChanged() |
int |
convertRowIndexToModel(int index) |
int |
convertRowIndexToView(int index) |
ObjectTableSorter |
fixLastRow()
Sets
primary comparator to one that don't sort last row. |
protected java.util.Comparator<ObjectTableSorter.Row> |
getComparatorFromSortKey(javax.swing.RowSorter.SortKey sortkey) |
protected java.util.Comparator<?> |
getDefaultComparator(int column)
Builds a default comparator based on model column class.
|
java.util.Comparator<ObjectTableSorter.Row> |
getFallbackComparator() |
ObjectTableModel |
getModel() |
int |
getModelRowCount() |
java.util.Comparator<ObjectTableSorter.Row> |
getPrimaryComparator() |
java.util.List<? extends javax.swing.RowSorter.SortKey> |
getSortKeys() |
java.util.Comparator<?> |
getValueComparator(int column) |
int |
getViewRowCount() |
protected void |
invalidate() |
protected boolean |
isSortable(int column) |
protected boolean |
isSorted() |
protected boolean |
isSorted(int column) |
void |
modelStructureChanged() |
protected void |
rowsChanged(int firstRow,
int endRow,
boolean deleted,
boolean inserted) |
void |
rowsDeleted(int firstRow,
int endRow) |
void |
rowsInserted(int firstRow,
int endRow) |
void |
rowsUpdated(int firstRow,
int endRow) |
void |
rowsUpdated(int firstRow,
int endRow,
int column) |
ObjectTableSorter |
setFallbackComparator(java.util.Comparator<ObjectTableSorter.Row> comparator)
Sets a fallback comparator (defaults to model index comparison) if none
primary, neither
column value comparators can make
differences between two rows. |
ObjectTableSorter |
setPrimaryComparator(java.util.Comparator<ObjectTableSorter.Row> primaryComparator)
Comparator used prior to sorted columns.
|
void |
setSortKey(javax.swing.RowSorter.SortKey sortkey) |
void |
setSortKeys(java.util.List<? extends javax.swing.RowSorter.SortKey> keys) |
ObjectTableSorter |
setValueComparator(int column,
java.util.Comparator<?> comparator)
Assign comparator to given column, if
null a getDefaultComparator(int) default one is used instead. |
protected void |
sort()
Sort table
|
void |
toggleSortOrder(int column) |
protected void |
updateModelToView()
fill in modelToView list with index of view
|
protected void |
validate() |
public ObjectTableSorter(ObjectTableModel model)
public java.util.Comparator<ObjectTableSorter.Row> getPrimaryComparator()
public java.util.Comparator<?> getValueComparator(int column)
column - to be comparedpublic java.util.Comparator<ObjectTableSorter.Row> getFallbackComparator()
public ObjectTableSorter setPrimaryComparator(java.util.Comparator<ObjectTableSorter.Row> primaryComparator)
primaryComparator - Comparator to be used firstthispublic ObjectTableSorter fixLastRow()
primary comparator to one that don't sort last row.thispublic ObjectTableSorter setValueComparator(int column, java.util.Comparator<?> comparator)
null a getDefaultComparator(int) default one is used instead.column - Model column index.comparator - Column value comparator.thisprotected java.util.Comparator<?> getDefaultComparator(int column)
Collator.getInstance() for String,
natural order for Comparable, no sort support for others.column - Model column index.Comparatorpublic ObjectTableSorter setFallbackComparator(java.util.Comparator<ObjectTableSorter.Row> comparator)
primary, neither
column value comparators can make
differences between two rows.comparator - to be used, when all other Comparators can't see a
differencethispublic ObjectTableModel getModel()
getModel in class javax.swing.RowSorter<ObjectTableModel>public void toggleSortOrder(int column)
toggleSortOrder in class javax.swing.RowSorter<ObjectTableModel>public int convertRowIndexToModel(int index)
convertRowIndexToModel in class javax.swing.RowSorter<ObjectTableModel>public int convertRowIndexToView(int index)
convertRowIndexToView in class javax.swing.RowSorter<ObjectTableModel>public void setSortKeys(java.util.List<? extends javax.swing.RowSorter.SortKey> keys)
setSortKeys in class javax.swing.RowSorter<ObjectTableModel>public void setSortKey(javax.swing.RowSorter.SortKey sortkey)
public java.util.List<? extends javax.swing.RowSorter.SortKey> getSortKeys()
getSortKeys in class javax.swing.RowSorter<ObjectTableModel>public int getViewRowCount()
getViewRowCount in class javax.swing.RowSorter<ObjectTableModel>public int getModelRowCount()
getModelRowCount in class javax.swing.RowSorter<ObjectTableModel>public void modelStructureChanged()
modelStructureChanged in class javax.swing.RowSorter<ObjectTableModel>public void allRowsChanged()
allRowsChanged in class javax.swing.RowSorter<ObjectTableModel>public void rowsInserted(int firstRow,
int endRow)
rowsInserted in class javax.swing.RowSorter<ObjectTableModel>public void rowsDeleted(int firstRow,
int endRow)
rowsDeleted in class javax.swing.RowSorter<ObjectTableModel>public void rowsUpdated(int firstRow,
int endRow)
rowsUpdated in class javax.swing.RowSorter<ObjectTableModel>protected void rowsChanged(int firstRow,
int endRow,
boolean deleted,
boolean inserted)
public void rowsUpdated(int firstRow,
int endRow,
int column)
rowsUpdated in class javax.swing.RowSorter<ObjectTableModel>protected boolean isSortable(int column)
protected boolean isSorted(int column)
protected boolean isSorted()
protected void invalidate()
protected void validate()
protected java.util.Comparator<ObjectTableSorter.Row> getComparatorFromSortKey(javax.swing.RowSorter.SortKey sortkey)
protected void sort()
protected void updateModelToView()
Copyright © 1998-2018 Apache Software Foundation. All Rights Reserved.