Module is.codion.swing.common.model
Interface FilterTableModel<R,C>
- Type Parameters:
R
- the type representing the rows in this table modelC
- the type used to identify columns in this table model, Integer for indexed identification for example
- All Superinterfaces:
FilterModel<R>
,TableModel
- All Known Implementing Classes:
SwingEntityTableModel
Specifies a table model supporting selection as well as filtering.
A
FilterTableModel
can not contain null items.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
A builder for aFilterTableModel
.static interface
Provides access to table column valuesstatic interface
static enum
Specifies how the data in a table model is refreshed.static interface
Handles the editing of rowsstatic interface
Specifies the columns for a table model, their identifiers, their class and how to extract their value from a row instance.static interface
A selection model for aFilterTableModel
.Nested classes/interfaces inherited from interface is.codion.common.model.FilterModel
FilterModel.AbstractRefresher<T>, FilterModel.FilteredItems<T>, FilterModel.Items<T>, FilterModel.Refresher<T>, FilterModel.VisibleItems<T>
-
Field Summary
Fields inherited from interface is.codion.common.model.FilterModel
ASYNC_REFRESH
-
Method Summary
Modifier and TypeMethodDescriptionstatic <R,
C> FilterTableModel.Builder<R, C> builder
(FilterTableModel.TableColumns<R, C> columns) Instantiates a new table model builder.columns()
filters()
void
Notifies all listeners that all cell values in the table's rows may have changed.void
fireTableRowsUpdated
(int fromIndex, int toIndex) Notifies all listeners that the given rows have changedClass<?>
getColumnClass
(C identifier) Returns the class of the column with the given identifieritems()
sort()
values()
Provides access to column valuesMethods inherited from interface javax.swing.table.TableModel
addTableModelListener, getColumnClass, getColumnCount, getColumnName, getRowCount, getValueAt, isCellEditable, removeTableModelListener, setValueAt
-
Method Details
-
columns
FilterTableModel.TableColumns<R,C> columns()- Returns:
- the table columns
-
getColumnClass
Returns the class of the column with the given identifier- Parameters:
identifier
- the column identifier- Returns:
- the Class representing the given column
-
items
FilterTableModel.FilterTableModelItems<R> items()- Specified by:
items
in interfaceFilterModel<R>
- Returns:
- the model items
-
values
FilterTableModel.ColumnValues<C> values()Provides access to column values- Returns:
- the
FilterTableModel.ColumnValues
-
selection
FilterTableModel.TableSelection<R> selection()- Specified by:
selection
in interfaceFilterModel<R>
- Returns:
- the
FilterTableModel.TableSelection
instance used by this table model
-
filters
TableConditionModel<C> filters()- Returns:
- the
TableConditionModel
used to filter this table model
-
sort
FilterTableSortModel<R,C> sort()- Returns:
- the sort model
-
fireTableDataChanged
void fireTableDataChanged()Notifies all listeners that all cell values in the table's rows may have changed. The number of rows may also have changed and the JTable should redraw the table from scratch. The structure of the table (as in the order of the columns) is assumed to be the same. -
fireTableRowsUpdated
void fireTableRowsUpdated(int fromIndex, int toIndex) Notifies all listeners that the given rows have changed- Parameters:
fromIndex
- the from indextoIndex
- the to index
-
builder
Instantiates a new table model builder.- Type Parameters:
R
- the row typeC
- the column identifier type- Parameters:
columns
- the columns- Returns:
- a new builder instance
- Throws:
NullPointerException
- in casecolumnValues
is null
-