com.levigo.util.base.glazedlists.matchers
Class SearchEngineTextMatcherEditor<E>
java.lang.Object
com.levigo.util.base.glazedlists.matchers.AbstractMatcherEditor<E>
com.levigo.util.base.glazedlists.matchers.TextMatcherEditor<E>
com.levigo.util.base.glazedlists.matchers.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)
Methods inherited from class com.levigo.util.base.glazedlists.matchers.AbstractMatcherEditor |
addMatcherEditorListener, fireChanged, fireChangedMatcher, fireConstrained, fireMatchAll, fireMatchNone, fireRelaxed, getMatcher, isCurrentlyMatchingAll, isCurrentlyMatchingNone, removeMatcherEditorListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
.
setFields
public void setFields(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)
getFields
public Set<SearchEngineTextMatcherEditor.Field<E>> getFields()
- Returns:
- a copy of the defined search fields
refilter
public void refilter(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
Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.