Class GlazedListsFilterRowComboBoxDataProvider<T>
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.filterrow.combobox.FilterRowComboBoxDataProvider<T>
-
- org.eclipse.nebula.widgets.nattable.extension.glazedlists.filterrow.GlazedListsFilterRowComboBoxDataProvider<T>
-
- All Implemented Interfaces:
ca.odell.glazedlists.event.ListEventListener<T>
,EventListener
,IComboBoxDataProvider
,ILayerListener
public class GlazedListsFilterRowComboBoxDataProvider<T> extends FilterRowComboBoxDataProvider<T> implements ca.odell.glazedlists.event.ListEventListener<T>
Special implementation of FilterRowComboBoxDataProvider that performs FilterRowComboUpdateEvents if the underlying list is changed.This implementation is necessary for a special case. If a filter is applied and a new row is added to the data model, the FilterList won't show the new row because the current applied filter is not aware of the new values. This is because of the inverse filter logic in then Excel like filter row. As the FilterList doesn't show the new value, there is no ListEvent fired further, so the FilterRowComboBoxDataProvider is not informed about the structural change.
This implementation solves this issue by listening to the wrapped source EventList of the FilterList instead of the NatTable IStructuralChangeEvent.
-
-
Field Summary
-
Fields inherited from class org.eclipse.nebula.widgets.nattable.filterrow.combobox.FilterRowComboBoxDataProvider
cachingEnabled, lazyLoading
-
-
Constructor Summary
Constructors Constructor Description GlazedListsFilterRowComboBoxDataProvider(ILayer bodyLayer, Collection<T> baseCollection, IColumnAccessor<T> columnAccessor)
GlazedListsFilterRowComboBoxDataProvider(ILayer bodyLayer, Collection<T> baseCollection, IColumnAccessor<T> columnAccessor, boolean lazy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
Cleanup acquired resources.void
handleLayerEvent(ILayerEvent event)
Handle an event notification from anILayer
void
listChanged(ca.odell.glazedlists.event.ListEvent<T> listChanges)
-
Methods inherited from class org.eclipse.nebula.widgets.nattable.filterrow.combobox.FilterRowComboBoxDataProvider
addCacheUpdateListener, buildUpdateEvent, buildValueCache, collectValues, disableUpdateEvents, enableUpdateEvents, fireCacheUpdateEvent, getCachedColumnIndexes, getValueCache, getValueCacheLock, getValues, isCachingEnabled, isUpdateEventsEnabled, removeCacheUpdateListener, setCachingEnabled
-
-
-
-
Constructor Detail
-
GlazedListsFilterRowComboBoxDataProvider
public GlazedListsFilterRowComboBoxDataProvider(ILayer bodyLayer, Collection<T> baseCollection, IColumnAccessor<T> columnAccessor)
- Parameters:
bodyLayer
- A layer in the body region. Usually the DataLayer or a layer that is responsible for list event handling. Needed to register ourself as listener for data changes.baseCollection
- The base collection used to collect the unique values from. This need to be a collection that is not filtered, otherwise after modifications the content of the filter row combo boxes will only contain the current visible (not filtered) elements.columnAccessor
- The IColumnAccessor to be able to read the values out of the base collection objects.
-
GlazedListsFilterRowComboBoxDataProvider
public GlazedListsFilterRowComboBoxDataProvider(ILayer bodyLayer, Collection<T> baseCollection, IColumnAccessor<T> columnAccessor, boolean lazy)
- Parameters:
bodyLayer
- A layer in the body region. Usually the DataLayer or a layer that is responsible for list event handling. Needed to register ourself as listener for data changes.baseCollection
- The base collection used to collect the unique values from. This need to be a collection that is not filtered, otherwise after modifications the content of the filter row combo boxes will only contain the current visible (not filtered) elements.columnAccessor
- The IColumnAccessor to be able to read the values out of the base collection objects.lazy
-true
to configure thisFilterRowComboBoxDataProvider
should load the combobox values lazily,false
to pre-build the value cache.- Since:
- 1.4
-
-
Method Detail
-
listChanged
public void listChanged(ca.odell.glazedlists.event.ListEvent<T> listChanges)
- Specified by:
listChanged
in interfaceca.odell.glazedlists.event.ListEventListener<T>
-
handleLayerEvent
public void handleLayerEvent(ILayerEvent event)
Description copied from interface:ILayerListener
Handle an event notification from anILayer
- Specified by:
handleLayerEvent
in interfaceILayerListener
- Overrides:
handleLayerEvent
in classFilterRowComboBoxDataProvider<T>
- Parameters:
event
- the event
-
dispose
public void dispose()
Description copied from class:FilterRowComboBoxDataProvider
Cleanup acquired resources.- Overrides:
dispose
in classFilterRowComboBoxDataProvider<T>
-
-