Class 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.

    • 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 this FilterRowComboBoxDataProvider should load the combobox values lazily, false to pre-build the value cache.
        Since:
        1.4