Class ComboBoxGlazedListsFilterStrategy<T>
java.lang.Object
org.eclipse.nebula.widgets.nattable.extension.glazedlists.filterrow.DefaultGlazedListsFilterStrategy<T>
org.eclipse.nebula.widgets.nattable.extension.glazedlists.filterrow.DefaultGlazedListsStaticFilterStrategy<T>
org.eclipse.nebula.widgets.nattable.extension.glazedlists.filterrow.ComboBoxGlazedListsFilterStrategy<T>
- All Implemented Interfaces:
IActivatableFilterStrategy<T>
,IFilterStrategy<T>
- Direct Known Subclasses:
ComboBoxGlazedListsWithExcludeFilterStrategy
Specialisation of the DefaultGlazedListsStaticFilterStrategy that is intended
to be used in combination with FilterRowComboBoxCellEditors that allows
filtering via multiselect comboboxes like in Excel. As it extends
DefaultGlazedListsStaticFilterStrategy it also supports static filters which
allows to integrate it with the GlazedListsRowHideShowLayer.
The special case in here is that if nothing is selected in the filter combobox, then everything should be filtered.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.nebula.widgets.nattable.extension.glazedlists.filterrow.DefaultGlazedListsFilterStrategy
DefaultGlazedListsFilterStrategy.ColumnTextFilterator
-
Field Summary
Fields inherited from class org.eclipse.nebula.widgets.nattable.extension.glazedlists.filterrow.DefaultGlazedListsStaticFilterStrategy
staticMatcherEditor
Fields inherited from class org.eclipse.nebula.widgets.nattable.extension.glazedlists.filterrow.DefaultGlazedListsFilterStrategy
columnAccessor, configRegistry, filterList, filterLock
-
Constructor Summary
ConstructorDescriptionComboBoxGlazedListsFilterStrategy
(FilterRowComboBoxDataProvider<T> comboBoxDataProvider, ca.odell.glazedlists.FilterList<T> filterList, ca.odell.glazedlists.matchers.CompositeMatcherEditor<T> matcherEditor, IColumnAccessor<T> columnAccessor, IConfigRegistry configRegistry) ComboBoxGlazedListsFilterStrategy
(FilterRowComboBoxDataProvider<T> comboBoxDataProvider, ca.odell.glazedlists.FilterList<T> filterList, IColumnAccessor<T> columnAccessor, IConfigRegistry configRegistry) -
Method Summary
Modifier and TypeMethodDescriptionvoid
applyFilter
(Map<Integer, Object> filterIndexToObjectMap) Create GlazedLists matcher editors and apply them to facilitate filtering.protected boolean
filterCollectionsEqual
(Collection filter1, Collection filter2) protected String
getStringFromColumnObject
(int columnIndex, Object object) Converts the object inserted to the filter cell at the given column position to the corresponding String.protected boolean
Checks if at least one combobox cell editor is registered.Methods inherited from class org.eclipse.nebula.widgets.nattable.extension.glazedlists.filterrow.DefaultGlazedListsStaticFilterStrategy
activateFilterStrategy, addStaticFilter, addStaticFilter, clearStaticFilter, deactivateFilterStrategy, isActive, removeStaticFilter, removeStaticFilter
Methods inherited from class org.eclipse.nebula.widgets.nattable.extension.glazedlists.filterrow.DefaultGlazedListsFilterStrategy
containsMatcherEditor, getColumnValueProvider, getFilterContentDisplayConverter, getGlazedListsTextMatcherEditorMode, getMatcherEditor, getTextFilterator, getTextMatcherEditor, getThresholdMatcherEditor, matcherEditorEqual
-
Constructor Details
-
ComboBoxGlazedListsFilterStrategy
public ComboBoxGlazedListsFilterStrategy(FilterRowComboBoxDataProvider<T> comboBoxDataProvider, ca.odell.glazedlists.FilterList<T> filterList, IColumnAccessor<T> columnAccessor, IConfigRegistry configRegistry) - Parameters:
comboBoxDataProvider
- The FilterRowComboBoxDataProvider needed to determine whether filters should applied or not. If there are no values specified for filtering of a column then everything should be filtered, if all possible values are given as filter then no filter needs to be applied.filterList
- The CompositeMatcherEditor that is used for GlazedLists filteringcolumnAccessor
- The IColumnAccessor needed to access the row data to perform filteringconfigRegistry
- The IConfigRegistry to retrieve several configurations from
-
ComboBoxGlazedListsFilterStrategy
public ComboBoxGlazedListsFilterStrategy(FilterRowComboBoxDataProvider<T> comboBoxDataProvider, ca.odell.glazedlists.FilterList<T> filterList, ca.odell.glazedlists.matchers.CompositeMatcherEditor<T> matcherEditor, IColumnAccessor<T> columnAccessor, IConfigRegistry configRegistry) - Parameters:
comboBoxDataProvider
- The FilterRowComboBoxDataProvider needed to determine whether filters should applied or not. If there are no values specified for filtering of a column then everything should be filtered, if all possible values are given as filter then no filter needs to be applied.filterList
- The FilterList that is used within the GlazedLists based NatTable for filtering.matcherEditor
- The CompositeMatcherEditor that should be used by this DefaultGlazedListsStaticFilterStrategy.columnAccessor
- The IColumnAccessor necessary to access the column data of the row objects in the FilterList.configRegistry
- The IConfigRegistry necessary to retrieve filter specific configurations.
-
-
Method Details
-
applyFilter
Description copied from class:DefaultGlazedListsStaticFilterStrategy
Create GlazedLists matcher editors and apply them to facilitate filtering. Always adds the static matchers.- Specified by:
applyFilter
in interfaceIFilterStrategy<T>
- Overrides:
applyFilter
in classDefaultGlazedListsStaticFilterStrategy<T>
- Parameters:
filterIndexToObjectMap
- A Map of column indexes to filter text Strings.
-
getStringFromColumnObject
Converts the object inserted to the filter cell at the given column position to the corresponding String.This implementation is able to handle Collections and will generate a regular expression containing all values in the Collection.
- Overrides:
getStringFromColumnObject
in classDefaultGlazedListsFilterStrategy<T>
- Parameters:
columnIndex
- The column index of the filter cell that should be processed.object
- The value set to the filter cell that needs to be converted- Returns:
- The String value for the given filter value.
-
filterCollectionsEqual
-
hasComboBoxFilterEditorRegistered
protected boolean hasComboBoxFilterEditorRegistered()Checks if at least one combobox cell editor is registered. Needed to the matchNone processing if the filter collection is empty.- Returns:
true
if at least one combobox cell editor is registered,false
if not.- Since:
- 2.1
-