|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectca.odell.glazedlists.matchers.AbstractMatcherEditor<E>
ca.odell.glazedlists.matchers.TextMatcherEditor<E>
public class TextMatcherEditor<E>
A matcher editor that matches Objects that contain a filter text string.
This TextMatcherEditor is not coupled with any UI component that
allows the user to edit the filter text. That job is left to subclasses.
This matcher editor is fully concrete, and may be used directly by headless
applications.
The TextMatcherEditor requires that either a
TextFilterator be specified in its constructor, or that every Object
to be matched implements the TextFilterable interface. These are
used to extract the searchable Strings for each Object.
TextMatcherEditor is able to operate in one of two modes.
CONTAINS will produce Matcher objects that test if
at least one searchable string for an Object contains one of the
filter strings anywhere within itself.
STARTS_WITH will produce Matcher objects that test
if at least one searchable string for an Object
begins with at least one of the filter strings.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface ca.odell.glazedlists.matchers.MatcherEditor |
|---|
MatcherEditor.Event<E>, MatcherEditor.Listener<E> |
| Field Summary | |
|---|---|
static int |
CONTAINS
Matching mode where items are considered a match if at least one of the filter strings extracted from an object contains one of the given search strings. |
static int |
STARTS_WITH
Matching mode where items are considered a match if at least one of the filter strings extracted from an object starts with one of the given search strings. |
| Fields inherited from class ca.odell.glazedlists.matchers.AbstractMatcherEditor |
|---|
currentMatcher |
| Constructor Summary | |
|---|---|
TextMatcherEditor()
Creates a TextMatcherEditor whose Matchers can test only elements which
implement the TextFilterable interface. |
|
TextMatcherEditor(TextFilterator<E> filterator)
Creates a TextMatcherEditor that matches Objects using the
specified TextFilterator to get the Strings to search. |
|
| Method Summary | |
|---|---|
TextFilterator<E> |
getFilterator()
Get the filterator used to extract Strings from the matched elements. |
int |
getMode()
Returns the behaviour mode for this TextMatcherEditor. |
void |
setFilterText(String[] newFilters)
Adjusts the filters of this TextMatcherEditor and fires a change
to the Matcher. |
void |
setMode(int mode)
Modify the behaviour of this TextMatcherEditor to one of the
predefined modes. |
| Methods inherited from class ca.odell.glazedlists.matchers.AbstractMatcherEditor |
|---|
addMatcherEditorListener, fireChanged, fireChangedMatcher, fireConstrained, fireMatchAll, fireMatchNone, fireRelaxed, getMatcher, removeMatcherEditorListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int CONTAINS
public static final int STARTS_WITH
| Constructor Detail |
|---|
public TextMatcherEditor()
TextMatcherEditor whose Matchers can test only elements which
implement the TextFilterable interface.
The Matchers from this MatcherEditor will fire a
ClassCastException when called with an Object that does not implement
TextFilterable.
public TextMatcherEditor(TextFilterator<E> filterator)
TextMatcherEditor that matches Objects using the
specified TextFilterator to get the Strings to search.
filterator - the object that will extract filter Strings from each
object in the source; null indicates the
list elements implement TextFilterable| Method Detail |
|---|
public TextFilterator<E> getFilterator()
public void setMode(int mode)
TextMatcherEditor to one of the
predefined modes.
mode - either CONTAINS or STARTS_WITH.public int getMode()
TextMatcherEditor.
CONTAINS (default) or STARTS_WITHpublic void setFilterText(String[] newFilters)
TextMatcherEditor and fires a change
to the Matcher.
newFilters - the Strings representing all of the filter values
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||