Class ColumnFilterDialogModel<R>
java.lang.Object
docking.widgets.table.constraint.dialog.ColumnFilterDialogModel<R>
- Type Parameters:
R
- the row type for the table
This class is for constructing and editing
ColumnBasedTableFilter
. It is used by the
ColumnFilterDialog
and exists primarily to make testing easier.-
Constructor Summary
ConstructorDescriptionColumnFilterDialogModel
(RowObjectFilterModel<R> model, TableColumnModel columnModel, ColumnBasedTableFilter<R> currentColumnTableFilter) Constructs a new ColumnFilterModel -
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(TableFilterDialogModelListener listener) Adds a listener to be notified for various changes that occur in this filter model.void
clear()
Clears the model of all filters.createFilterRow
(LogicOperation logicOperation) Creates a new filter row (a new major row in the dialog filter panel)void
deleteFilterRow
(DialogFilterRow filterRow) Deletes a filter row (a major row in the dialog filter panel)void
dispose()
clean up.List
<ColumnFilterData<?>> Returns a list of the columnFilterData for all filterable columns in the tablestatic <R> List
<ColumnFilterData<?>> getAllColumnFilterData
(RowObjectFilterModel<R> model, TableColumnModel columnModel) Returns a list of all filter rows in this model.Builds a ColumnTableFilter from this model if the model is valid.boolean
Returns true if this model has changes that make the filter different from the currently applied filter.boolean
isEmpty()
Return true if there are no conditions (valid or invalid) defined for this filter model.boolean
isValid()
Checks if this model represents a valid filter.void
removeListener
(TableFilterDialogModelListener listener) Removes the given listener.void
setCurrentlyAppliedFilter
(ColumnBasedTableFilter<R> tableColumnFilter)
-
Constructor Details
-
ColumnFilterDialogModel
public ColumnFilterDialogModel(RowObjectFilterModel<R> model, TableColumnModel columnModel, ColumnBasedTableFilter<R> currentColumnTableFilter) Constructs a new ColumnFilterModel- Parameters:
model
- the RowObjectFilterModel of the table being filtered.columnModel
- the TableColumnModel of the table being filtered.currentColumnTableFilter
- the currently applied TableColumnFilter or null if there is no current TableColumnFilter applied.
-
-
Method Details
-
getAllColumnFilterData
public static <R> List<ColumnFilterData<?>> getAllColumnFilterData(RowObjectFilterModel<R> model, TableColumnModel columnModel) -
dispose
public void dispose()clean up. -
createFilterRow
Creates a new filter row (a new major row in the dialog filter panel)- Parameters:
logicOperation
- the logical operation for how this row interacts with preceding rows- Returns:
- the new filter row that represents a major row in the dialog filter panel
-
deleteFilterRow
Deletes a filter row (a major row in the dialog filter panel)- Parameters:
filterRow
- the row to delete.
-
getFilterRows
Returns a list of all filter rows in this model.- Returns:
- a list of all filter rows in this model.
-
addListener
Adds a listener to be notified for various changes that occur in this filter model.- Parameters:
listener
- the listener to add.
-
removeListener
Removes the given listener.- Parameters:
listener
- the listener to remove.
-
isValid
public boolean isValid()Checks if this model represents a valid filter. While editing, some elements of the filter may be incomplete or invalid and if so, then this method will return false.- Returns:
- true if the model represents a valid filter.
-
getTableColumnFilter
Builds a ColumnTableFilter from this model if the model is valid.- Returns:
- a new ColumnTableFilter based on the configuration of this model or null if the model is invalid.
-
clear
public void clear()Clears the model of all filters. -
getAllColumnFilterData
Returns a list of the columnFilterData for all filterable columns in the table- Returns:
- a list of the columnFilterData for all filterable columns in the table
-
isEmpty
public boolean isEmpty()Return true if there are no conditions (valid or invalid) defined for this filter model.- Returns:
- true if there are no conditions (valid or invalid) defined for this filter model.
-
hasUnappliedChanges
public boolean hasUnappliedChanges()Returns true if this model has changes that make the filter different from the currently applied filter.- Returns:
- if there are unapplied user changes to the filter.
-
setCurrentlyAppliedFilter
-