ca.odell.glazedlists.swing
Class TextComponentMatcherEditor<E>
- MatcherEditor<E>
public class TextComponentMatcherEditor<E>
A MatcherEditor that matches Objects that contain the filter text located
within a
Document
. This
TextMatcherEditor
is directly
coupled with a Document and fires MatcherEditor changes in response to
Document changes. This matcher is fully concrete and is expected to be used
by Swing applications.
The
TextComponentMatcherEditor
constructors require that either a
Document
or a
JTextComponent
(from which a
Document
is extracted) be specified.
The MatcherEditor registers itself as a
DocumentListener
on the
given Document, or
ActionListener
for non-live filtering. If this
MatcherEditor must be garbage collected before the underlying Document,
or JTextComponent, the listener can be unregistered by calling
dispose()
.
TextComponentMatcherEditor(Document document, TextFilterator textFilterator) - Creates a TextMatcherEditor bound to the given
document
with the given textFilterator .
|
TextComponentMatcherEditor(JTextComponent textComponent, TextFilterator textFilterator) - Creates a TextMatcherEditor bound to the
Document backing the
given textComponent with the given
textFilterator .
|
TextComponentMatcherEditor(JTextComponent textComponent, TextFilterator textFilterator, boolean live) - Creates a TextMatcherEditor bound to the
Document backing the
given textComponent with the given
textFilterator .
|
void | dispose() - A cleanup method which stops this MatcherEditor from listening to
changes on the underlying
Document , thus freeing the
MatcherEditor or Document to be garbage collected.
|
boolean | isLive() - Whether filtering occurs by the keystroke or not.
|
void | setLive(boolean live) - Toggle between filtering by the keystroke and not.
|
TextComponentMatcherEditor
public TextComponentMatcherEditor(Document document,
TextFilterator textFilterator)
Creates a TextMatcherEditor bound to the given document
with the given textFilterator
.
document
- the Document
that is the source of text filter
valuestextFilterator
- an object capable of producing Strings from the
objects being filtered. If textFilterator
is
null
then all filtered objects are expected to
implement TextFilterable
.
TextComponentMatcherEditor
public TextComponentMatcherEditor(JTextComponent textComponent,
TextFilterator textFilterator)
Creates a TextMatcherEditor bound to the Document
backing the
given textComponent
with the given
textFilterator
.
textComponent
- the text component backed by the Document
that is the source of text filter valuestextFilterator
- an object capable of producing Strings from the
objects being filtered. If textFilterator
is
null
then all filtered objects are expected to
implement TextFilterable
.
TextComponentMatcherEditor
public TextComponentMatcherEditor(JTextComponent textComponent,
TextFilterator textFilterator,
boolean live)
Creates a TextMatcherEditor bound to the Document
backing the
given textComponent
with the given
textFilterator
.
textComponent
- the text component backed by the Document
that is the source of text filter valuestextFilterator
- an object capable of producing Strings from the
objects being filtered. If textFilterator
is
null
then all filtered objects are expected to
implement TextFilterable
.live
- true
to filter by the keystroke or false
to filter only when Enter
is pressed
within the JTextComponent
. Note that non-live filtering is only
supported if textComponent
is a JTextField
.
dispose
public void dispose()
A cleanup method which stops this MatcherEditor from listening to
changes on the underlying Document
, thus freeing the
MatcherEditor or Document to be garbage collected.
isLive
public boolean isLive()
Whether filtering occurs by the keystroke or not.
setLive
public void setLive(boolean live)
Toggle between filtering by the keystroke and not.
live
- true
to filter by the keystroke or false
to filter only when Enter
is pressed
within the JTextComponent
. Note that non-live filtering is only
supported if textComponent
is a JTextField
.
Glazed Lists, Copyright © 2003-2006 publicobject.com, O'Dell Engineering.
Documentation build by buildd at 2008-01-04 14:38