Class DefaultGlazedListsStaticFilterStrategy<T>

java.lang.Object
org.eclipse.nebula.widgets.nattable.extension.glazedlists.filterrow.DefaultGlazedListsFilterStrategy<T>
org.eclipse.nebula.widgets.nattable.extension.glazedlists.filterrow.DefaultGlazedListsStaticFilterStrategy<T>
Type Parameters:
T - the type of the objects shown within the NatTable
All Implemented Interfaces:
IActivatableFilterStrategy<T>, IFilterStrategy<T>
Direct Known Subclasses:
ComboBoxGlazedListsFilterStrategy

public class DefaultGlazedListsStaticFilterStrategy<T> extends DefaultGlazedListsFilterStrategy<T> implements IActivatableFilterStrategy<T>
Default implementation of an IFilterStrategy for the filter row which can also take static filters and combine them with the filter logic from the filter row.
  • Field Details

    • staticMatcherEditor

      protected Map<ca.odell.glazedlists.matchers.Matcher<T>,ca.odell.glazedlists.matchers.MatcherEditor<T>> staticMatcherEditor
  • Constructor Details

    • DefaultGlazedListsStaticFilterStrategy

      public DefaultGlazedListsStaticFilterStrategy(ca.odell.glazedlists.FilterList<T> filterList, IColumnAccessor<T> columnAccessor, IConfigRegistry configRegistry)
      Create a new DefaultGlazedListsStaticFilterStrategy on top of the given FilterList.

      Note: Using this constructor you don't need to create and set the CompositeMatcherEditor as MatcherEditor on the FilterList yourself! The necessary steps to get it working is done within this constructor.

      Parameters:
      filterList - The FilterList that is used within the GlazedLists based NatTable for filtering.
      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.
    • DefaultGlazedListsStaticFilterStrategy

      public DefaultGlazedListsStaticFilterStrategy(ca.odell.glazedlists.FilterList<T> filterList, ca.odell.glazedlists.matchers.CompositeMatcherEditor<T> matcherEditor, IColumnAccessor<T> columnAccessor, IConfigRegistry configRegistry)
      Create a new DefaultGlazedListsStaticFilterStrategy on top of the given FilterList using the given CompositeMatcherEditor. This is necessary to support connection of multiple filter rows.

      Note: Using this constructor you need to create the CompositeMatcherEditor yourself. It will be added automatically to the given FilterList, so you can skip that step.

      Parameters:
      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

      public void applyFilter(Map<Integer,Object> filterIndexToObjectMap)
      Create GlazedLists matcher editors and apply them to facilitate filtering. Always adds the static matchers.
      Specified by:
      applyFilter in interface IFilterStrategy<T>
      Overrides:
      applyFilter in class DefaultGlazedListsFilterStrategy<T>
      Parameters:
      filterIndexToObjectMap - A Map of column indexes to filter text Strings.
    • addStaticFilter

      public void addStaticFilter(ca.odell.glazedlists.matchers.Matcher<T> matcher)
      Add a static filter to this filter strategy which will always be applied additionally to any other filter.
      Parameters:
      matcher - the static filter to add
    • addStaticFilter

      public void addStaticFilter(ca.odell.glazedlists.matchers.MatcherEditor<T> matcherEditor)
      Add a static filter to this filter strategy which will always be applied additionally to any other filter.
      Parameters:
      matcherEditor - the static filter to add
    • removeStaticFilter

      public void removeStaticFilter(ca.odell.glazedlists.matchers.Matcher<T> matcher)
      Remove the static filter from this filter strategy.
      Parameters:
      matcher - the filter to remove
    • removeStaticFilter

      public void removeStaticFilter(ca.odell.glazedlists.matchers.MatcherEditor<T> matcherEditor)
      Remove the static filter from this filter strategy.
      Parameters:
      matcherEditor - the filter to remove
    • clearStaticFilter

      public void clearStaticFilter()
      Removes all applied static filters from this filter strategy.
      Since:
      1.5
    • activateFilterStrategy

      public void activateFilterStrategy()
      Description copied from interface: IActivatableFilterStrategy
      Activate additional filter logic so it gets applied on the next filter operation, e.g. static or exclude filters. By default does nothing.
      Specified by:
      activateFilterStrategy in interface IActivatableFilterStrategy<T>
    • deactivateFilterStrategy

      public void deactivateFilterStrategy()
      Description copied from interface: IActivatableFilterStrategy
      Deactivate additional filter logic so it does not get applied on the next filter operation, e.g. static or exclude filters. By default does nothing.
      Specified by:
      deactivateFilterStrategy in interface IActivatableFilterStrategy<T>
    • isActive

      public boolean isActive()
      Specified by:
      isActive in interface IActivatableFilterStrategy<T>
      Returns:
      true if the additional filter logic provided by this IFilterStrategy is active, false if not.