Class SearchEngineTextMatcherEditor<E>

  • All Implemented Interfaces:
    MatcherEditor<E>
    Direct Known Subclasses:
    SearchEngineTextFieldMatcherEditor

    public class SearchEngineTextMatcherEditor<E>
    extends TextMatcherEditor<E>
    A MatcherEditor that matches Objects against search text in a format similiar to search engines. It supports fielded data and search terms (city:Toronto), phrases (city:"New York"), the "+" or required operator as well as the "-" or prohibit operator.

    This MatcherEditor is fully concrete, but GUI toolkit agnostic, as the search text is passed into the refilter method.

    Subclasses for Swing and SWT applications are provided that present a text filtering interface similar to that of Google and other search engines.

    Author:
    James Lemieux, Holger Brands
    See Also:
    refilter(String)
    • Constructor Detail

      • SearchEngineTextMatcherEditor

        public SearchEngineTextMatcherEditor()
        Creates a SearchEngineTextMatcherEditor whose Matchers can test only elements which implement the TextFilterable interface.
      • SearchEngineTextMatcherEditor

        public SearchEngineTextMatcherEditor​(TextFilterator<? super E> textFilterator)
        Creates a SearchEngineTextMatcherEditor with the given textFilterator.
        Parameters:
        textFilterator - an object capable of producing Strings from the objects being filtered. If textFilterator is null then all filtered objects are expected to implement TextFilterable.
    • Method Detail

      • setFields

        public void setFields​(java.util.Set<SearchEngineTextMatcherEditor.Field<E>> fields)
        Replaces the current set of search fields. This method does not trigger a refilter.
        Parameters:
        fields - the new search fields to use
        See Also:
        refilter(String)
      • refilter

        public void refilter​(java.lang.String inputText)
        Creates and applies a new TextMatcher based on the given input text.
        Parameters:
        inputText - input text (not null) that is parsed into search terms for the new text matcher