Class HeaderDetailTableRowSorter<H,M extends BufferedHeaderDetailTableModel<H>>
- java.lang.Object
-
- javax.swing.RowSorter<MODEL>
-
- io.github.jonestimd.swing.table.sort.BeanModelRowSorter<H,M,HeaderDetailTableRowSorter.HeaderDetailViewToModel<H>>
-
- io.github.jonestimd.swing.table.sort.HeaderDetailTableRowSorter<H,M>
-
- Type Parameters:
H
- the class of the header beans in the tableM
- the class of the table model
- All Implemented Interfaces:
MixedRowTableRowSorter
public class HeaderDetailTableRowSorter<H,M extends BufferedHeaderDetailTableModel<H>> extends BeanModelRowSorter<H,M,HeaderDetailTableRowSorter.HeaderDetailViewToModel<H>> implements MixedRowTableRowSorter
A row sorter for header/detail table.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
HeaderDetailTableRowSorter.HeaderDetailTableRowComparator<H>
The comparator used to sort rows of a header/detail table.static class
HeaderDetailTableRowSorter.HeaderDetailViewToModel<BEAN>
A mapping between the view and the model.protected class
HeaderDetailTableRowSorter.ModelChange
A helper class for updating the view/model mappings.
-
Field Summary
-
Fields inherited from class io.github.jonestimd.swing.table.sort.BeanModelRowSorter
modelToView, viewToModel
-
-
Constructor Summary
Constructors Modifier Constructor Description HeaderDetailTableRowSorter(MixedRowTable<H,M> table)
protected
HeaderDetailTableRowSorter(MixedRowTable<H,M> table, HeaderDetailTableRowSorter.HeaderDetailTableRowComparator<H> rowComparator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected H
getBean(int rowIndex)
int
getViewGroup(int viewIndex)
protected java.util.List<HeaderDetailTableRowSorter.HeaderDetailViewToModel<H>>
newModelRows(int firstRow, int endRow)
Create a list of view/model mappings.int
nextViewGroup(int viewIndex)
protected void
postSort()
void
rowsDeleted(int firstRow, int endRow)
void
rowsUpdated(int firstRow, int endRow)
void
rowsUpdated(int firstRow, int endRow, int column)
protected void
updateModelIndex(int firstRow, int deltaRows)
-
Methods inherited from class io.github.jonestimd.swing.table.sort.BeanModelRowSorter
allRowsChanged, convertRowIndexToModel, convertRowIndexToView, createViewFilter, getModel, getModelRowCount, getSortKeys, getViewRowCount, isVisible, modelStructureChanged, reset, rowsInserted, setRowFilter, setSortKeys, toggleSortOrder
-
-
-
-
Constructor Detail
-
HeaderDetailTableRowSorter
public HeaderDetailTableRowSorter(MixedRowTable<H,M> table)
-
HeaderDetailTableRowSorter
protected HeaderDetailTableRowSorter(MixedRowTable<H,M> table, HeaderDetailTableRowSorter.HeaderDetailTableRowComparator<H> rowComparator)
-
-
Method Detail
-
getViewGroup
public int getViewGroup(int viewIndex)
- Specified by:
getViewGroup
in interfaceMixedRowTableRowSorter
-
nextViewGroup
public int nextViewGroup(int viewIndex)
- Specified by:
nextViewGroup
in interfaceMixedRowTableRowSorter
- Returns:
- the view index of the lead row of the next group.
-
updateModelIndex
protected void updateModelIndex(int firstRow, int deltaRows)
- Overrides:
updateModelIndex
in classBeanModelRowSorter<H,M extends BufferedHeaderDetailTableModel<H>,HeaderDetailTableRowSorter.HeaderDetailViewToModel<H>>
-
rowsDeleted
public void rowsDeleted(int firstRow, int endRow)
- Overrides:
rowsDeleted
in classBeanModelRowSorter<H,M extends BufferedHeaderDetailTableModel<H>,HeaderDetailTableRowSorter.HeaderDetailViewToModel<H>>
-
rowsUpdated
public void rowsUpdated(int firstRow, int endRow)
- Overrides:
rowsUpdated
in classBeanModelRowSorter<H,M extends BufferedHeaderDetailTableModel<H>,HeaderDetailTableRowSorter.HeaderDetailViewToModel<H>>
-
rowsUpdated
public void rowsUpdated(int firstRow, int endRow, int column)
- Overrides:
rowsUpdated
in classBeanModelRowSorter<H,M extends BufferedHeaderDetailTableModel<H>,HeaderDetailTableRowSorter.HeaderDetailViewToModel<H>>
-
getBean
protected H getBean(int rowIndex)
- Overrides:
getBean
in classBeanModelRowSorter<H,M extends BufferedHeaderDetailTableModel<H>,HeaderDetailTableRowSorter.HeaderDetailViewToModel<H>>
-
postSort
protected void postSort()
- Specified by:
postSort
in classBeanModelRowSorter<H,M extends BufferedHeaderDetailTableModel<H>,HeaderDetailTableRowSorter.HeaderDetailViewToModel<H>>
-
newModelRows
protected java.util.List<HeaderDetailTableRowSorter.HeaderDetailViewToModel<H>> newModelRows(int firstRow, int endRow)
Description copied from class:BeanModelRowSorter
Create a list of view/model mappings.- Specified by:
newModelRows
in classBeanModelRowSorter<H,M extends BufferedHeaderDetailTableModel<H>,HeaderDetailTableRowSorter.HeaderDetailViewToModel<H>>
- Parameters:
firstRow
- the starting model index (inclusive)endRow
- the ending model index (inclusive)- Returns:
- a new list of view/model mappings
-
-