Package com.nuix.nx.controls.filters
Class DynamicTableRegexFilter
- java.lang.Object
-
- com.nuix.nx.controls.filters.DynamicTableFilterProvider
-
- com.nuix.nx.controls.filters.DynamicTableRegexFilter
-
public class DynamicTableRegexFilter extends DynamicTableFilterProvider
-
-
Constructor Summary
Constructors Constructor Description DynamicTableRegexFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterFiltering()
Called once after filtering.void
beforeFiltering(java.lang.String filterExpression, java.util.List<java.lang.Object> allRecords)
Invoked once before filtering begins, allowing for up front work to be performed that might then be leveraged in subsequent calls toDynamicTableFilterProvider.keepRecord(int, boolean, String, Object, Map)
.boolean
handlesExpression(java.lang.String filterExpression)
Whether this filter provider handles the given filter expression.boolean
keepRecord(int sourceIndex, boolean isChecked, java.lang.String filterExpression, java.lang.Object record, java.util.Map<java.lang.String,java.lang.Object> rowValues)
IfDynamicTableFilterProvider.handlesExpression(String)
returns true, this method will be invoked for each record.
-
-
-
Method Detail
-
handlesExpression
public boolean handlesExpression(java.lang.String filterExpression)
Whether this filter provider handles the given filter expression. If true is returned,DynamicTableFilterProvider.keepRecord(int, boolean, String, Object, Map)
will be called for each record to determine whether the given record is filtered out or not. If false is returned then the dynamic table model will continue looking for a filter handler. Filter expression should never be null or an all whitespace or empty string sinceDynamicTableModel
has built in logic to handle that before asking filters.
This is meant to be a fallback filter so it will happily accept any filter expression except when given value does not correctly compile to a regular expression.- Specified by:
handlesExpression
in classDynamicTableFilterProvider
- Parameters:
filterExpression
- The expression the user has provided.- Returns:
- True if this filter should handle this expression. False otherwise.
-
keepRecord
public boolean keepRecord(int sourceIndex, boolean isChecked, java.lang.String filterExpression, java.lang.Object record, java.util.Map<java.lang.String,java.lang.Object> rowValues)
Description copied from class:DynamicTableFilterProvider
IfDynamicTableFilterProvider.handlesExpression(String)
returns true, this method will be invoked for each record. It should return true for records that should make it into the final collection and false for records that should be filtered out.- Specified by:
keepRecord
in classDynamicTableFilterProvider
- Parameters:
sourceIndex
- The index of the record in the full un-filtered source collection.isChecked
- Whether the given record is currently checkedfilterExpression
- The filter expression provided by the user. This value should never be null, only whitespace or empty.record
- The record to inspect and make a decision about.rowValues
- A map of the values actual represented as columns in the table. Relies on table model'sDynamicTableValueCallback
.- Returns:
- True to keep the record, false to filter it out.
-
beforeFiltering
public void beforeFiltering(java.lang.String filterExpression, java.util.List<java.lang.Object> allRecords)
Description copied from class:DynamicTableFilterProvider
Invoked once before filtering begins, allowing for up front work to be performed that might then be leveraged in subsequent calls toDynamicTableFilterProvider.keepRecord(int, boolean, String, Object, Map)
. Override in derived implementation, default implementation does nothing.- Overrides:
beforeFiltering
in classDynamicTableFilterProvider
- Parameters:
filterExpression
- The filter expression that was providedallRecords
- All the of records pre-filtering
-
afterFiltering
public void afterFiltering()
Description copied from class:DynamicTableFilterProvider
Called once after filtering. Can be used to clean up any resources that may have been created by calls toDynamicTableFilterProvider.beforeFiltering(String, List)
and/orDynamicTableFilterProvider.keepRecord(int, boolean, String, Object, Map)
.- Overrides:
afterFiltering
in classDynamicTableFilterProvider
-
-