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 examplepublic interface FilteredTableModel<R,C> extends TableModel, FilteredModel<R>
Modifier and Type | Interface and Description |
---|---|
static interface |
FilteredTableModel.ColumnValueProvider<R,C>
Provides the column value for a row and column
|
static interface |
FilteredTableModel.RowsRemoved
Specifies the from and to rows of a row removal operation.
|
ASYNC_REFRESH
Modifier and Type | Method and Description |
---|---|
void |
addClearListener(EventListener listener) |
void |
addDataChangedListener(EventListener listener) |
void |
addRowsRemovedListener(EventDataListener<FilteredTableModel.RowsRemoved> listener)
Adds a listener that is notified each time rows are removed from this model.
|
void |
addSortListener(EventListener listener) |
boolean |
allowSelectionChange() |
void |
clear()
Clears all items from this table model
|
<T> ColumnConditionModel<C,T> |
columnFilterModel(C columnIdentifier)
Returns the
ColumnConditionModel for the column with the given identifier. |
Map<C,ColumnConditionModel<? extends C,?>> |
columnFilterModels() |
FilteredTableColumnModel<C> |
columnModel() |
Optional<ColumnSummaryModel> |
columnSummaryModel(C columnIdentifier)
Returns the
ColumnSummaryModel associated with columnIdentifier |
Class<?> |
getColumnClass(C columnIdentifier)
Returns the class of the column with the given identifier
|
String |
getStringValueAt(int rowIndex,
C columnIdentifier)
Returns a String representation of the value for the given row and column.
|
int |
indexOf(R item) |
boolean |
isMergeOnRefresh() |
R |
itemAt(int rowIndex) |
void |
refresh()
Refreshes the items in this table model, respecting the selection, filtering as well as sorting states.
|
void |
removeClearListener(EventListener listener) |
void |
removeDataChangedListener(EventListener listener) |
void |
removeItem(R item)
Removes the given item from this table model
|
void |
removeItemAt(int index)
Removes from this table model the visible element whose index is between index
|
void |
removeItems(Collection<R> items)
Removes the given items from this table model
|
void |
removeItems(int fromIndex,
int toIndex)
Removes from this table model all visible elements whose index is between fromIndex, inclusive and toIndex, exclusive
|
void |
removeRowsRemovedListener(EventDataListener<FilteredTableModel.RowsRemoved> listener) |
void |
removeSortListener(EventListener listener) |
FilteredTableSearchModel |
searchModel() |
<T> Collection<T> |
selectedValues(C columnIdentifier) |
FilteredTableSelectionModel<R> |
selectionModel() |
void |
setMergeOnRefresh(boolean mergeOnRefresh) |
void |
sortItems()
Sorts the visible items according to the
FilteredTableSortModel , keeping the selected items. |
FilteredTableSortModel<R,C> |
sortModel() |
<T> Collection<T> |
values(C columnIdentifier) |
addTableModelListener, getColumnClass, getColumnCount, getColumnName, getRowCount, getValueAt, isCellEditable, removeTableModelListener, setValueAt
addFilterListener, addRefreshFailedListener, addRefreshListener, containsItem, filteredItemCount, filteredItems, filterItems, getIncludeCondition, isAsyncRefresh, isFiltered, isVisible, items, refreshingObserver, refreshThen, removeFilterListener, removeRefreshFailedListener, removeRefreshListener, setAsyncRefresh, setIncludeCondition, visibleItemCount, visibleItems
void addSortListener(EventListener listener)
listener
- a listener to be notified each time the model has been sortedvoid removeSortListener(EventListener listener)
listener
- the listener to removevoid addDataChangedListener(EventListener listener)
listener
- a listener to be notified each time the table data changesvoid removeDataChangedListener(EventListener listener)
listener
- the listener to removevoid addClearListener(EventListener listener)
listener
- a listener to be notified each time the table model is clearedvoid removeClearListener(EventListener listener)
listener
- the listener to removevoid addRowsRemovedListener(EventDataListener<FilteredTableModel.RowsRemoved> listener)
listener
- the listenervoid removeRowsRemovedListener(EventDataListener<FilteredTableModel.RowsRemoved> listener)
listener
- the listener to removeboolean allowSelectionChange()
int indexOf(R item)
item
- the itemR itemAt(int rowIndex)
rowIndex
- the row indexString getStringValueAt(int rowIndex, C columnIdentifier)
rowIndex
- the row indexcolumnIdentifier
- the column identifiervoid removeItems(Collection<R> items)
items
- the items to remove from the modelvoid removeItem(R item)
item
- the item to remove from the modelvoid removeItemAt(int index)
index
- the index of the row to be removedIndexOutOfBoundsException
- in case the indexe is out of boundsvoid removeItems(int fromIndex, int toIndex)
fromIndex
- index of first row to be removedtoIndex
- index after last row to be removedIndexOutOfBoundsException
- in case the indexes are out of boundsFilteredTableColumnModel<C> columnModel()
Optional<ColumnSummaryModel> columnSummaryModel(C columnIdentifier)
ColumnSummaryModel
associated with columnIdentifier
columnIdentifier
- the column identifierMap<C,ColumnConditionModel<? extends C,?>> columnFilterModels()
<T> ColumnConditionModel<C,T> columnFilterModel(C columnIdentifier)
ColumnConditionModel
for the column with the given identifier.T
- the column value typecolumnIdentifier
- the column identifierIllegalArgumentException
- in case no filter model exists for the given column<T> Collection<T> values(C columnIdentifier)
T
- the value typecolumnIdentifier
- the identifier of the column for which to retrieve the valuesClass<?> getColumnClass(C columnIdentifier)
columnIdentifier
- the column identifier<T> Collection<T> selectedValues(C columnIdentifier)
T
- the value typecolumnIdentifier
- the identifier of the column for which to retrieve the valuesboolean isMergeOnRefresh()
void setMergeOnRefresh(boolean mergeOnRefresh)
mergeOnRefresh
- true if merge on refresh should be enabledvoid sortItems()
FilteredTableSortModel
, keeping the selected items.
Calling this method with the sort model disabled has no effect.FilteredTableSelectionModel<R> selectionModel()
FilteredTableSortModel<R,C> sortModel()
FilteredTableSearchModel searchModel()
void refresh()
FilteredModel.setAsyncRefresh(boolean)
.
Note that an empty selection event will be triggered during a normal refresh, since the model is cleared
before it is repopulated, during which the selection is cleared as well. Using merge on insert
(setMergeOnRefresh(boolean)
) will prevent that at a considerable performance cost.refresh
in interface FilteredModel<R>
RuntimeException
- in case of an exception when refresh is run synchronouslyFilteredModel.addRefreshFailedListener(EventDataListener)
,
FilteredModel.setAsyncRefresh(boolean)
void clear()