ca.odell.glazedlists.swt
Class SearchEngineTextWidgetMatcherEditor<E>

java.lang.Object
  extended by ca.odell.glazedlists.matchers.AbstractMatcherEditorListenerSupport<E>
      extended by ca.odell.glazedlists.matchers.AbstractMatcherEditor<E>
          extended by ca.odell.glazedlists.matchers.TextMatcherEditor<E>
              extended by ca.odell.glazedlists.matchers.SearchEngineTextMatcherEditor<E>
                  extended by ca.odell.glazedlists.swt.SearchEngineTextWidgetMatcherEditor<E>
All Implemented Interfaces:
MatcherEditor<E>

public class SearchEngineTextWidgetMatcherEditor<E>
extends SearchEngineTextMatcherEditor<E>

A MatcherEditor that matches elements that contain the filter text located within a Text field. This TextWidgetMatcherEditor is directly coupled with a Text that is meant to emulate a search engine's text box. This matcher is fully concrete for use in SWT applications that want to present a text filtering interface similiar to that of Google and other search engines.

If this MatcherEditor must be garbage collected before the underlying Text, the listener can be unregistered by calling dispose().

Author:
Holger Brands

Nested Class Summary
 
Nested classes/interfaces inherited from class ca.odell.glazedlists.matchers.SearchEngineTextMatcherEditor
SearchEngineTextMatcherEditor.Field<E>
 
Nested classes/interfaces inherited from interface ca.odell.glazedlists.matchers.MatcherEditor
MatcherEditor.Event<E>, MatcherEditor.Listener<E>
 
Field Summary
 
Fields inherited from class ca.odell.glazedlists.matchers.TextMatcherEditor
CONTAINS, EXACT, IDENTICAL_STRATEGY, NORMALIZED_STRATEGY, REGULAR_EXPRESSION, STARTS_WITH
 
Constructor Summary
SearchEngineTextWidgetMatcherEditor(org.eclipse.swt.widgets.Text text, TextFilterator<? super E> textFilterator)
          Creates a TextWidgetMatcherEditor bound to the provided Text with the given textFilterator.
 
Method Summary
 void dispose()
          A cleanup method which stops this MatcherEditor from listening to changes on the Text component, thus freeing the MatcherEditor to be garbage collected.
 org.eclipse.swt.events.SelectionListener getFilterSelectionListener()
          Gets a SelectionListener that refilters the list when it is fired.
 
Methods inherited from class ca.odell.glazedlists.matchers.SearchEngineTextMatcherEditor
getFields, refilter, setFields
 
Methods inherited from class ca.odell.glazedlists.matchers.TextMatcherEditor
getCurrentTextMatcher, getFilterator, getMode, getStrategy, setFilterator, setFilterText, setMode, setStrategy, setTextMatcher
 
Methods inherited from class ca.odell.glazedlists.matchers.AbstractMatcherEditor
fireChanged, fireConstrained, fireMatchAll, fireMatchNone, fireRelaxed, getMatcher, isCurrentlyMatchingAll, isCurrentlyMatchingNone
 
Methods inherited from class ca.odell.glazedlists.matchers.AbstractMatcherEditorListenerSupport
addMatcherEditorListener, createChangedEvent, createConstrainedEvent, createMatchAllEvent, createMatchNoneEvent, createRelaxedEvent, fireChangedMatcher, removeMatcherEditorListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchEngineTextWidgetMatcherEditor

public SearchEngineTextWidgetMatcherEditor(org.eclipse.swt.widgets.Text text,
                                           TextFilterator<? super E> textFilterator)
Creates a TextWidgetMatcherEditor bound to the provided Text with the given textFilterator.

Parameters:
text - the Text widget that drives the text-filtering
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.
See Also:
GlazedLists.textFilterator(String[])
Method Detail

getFilterSelectionListener

public org.eclipse.swt.events.SelectionListener getFilterSelectionListener()
Gets a SelectionListener that refilters the list when it is fired. This listener can be used to filter when the user presses a 'Search' button.


dispose

public void dispose()
A cleanup method which stops this MatcherEditor from listening to changes on the Text component, thus freeing the MatcherEditor to be garbage collected. Garbage collection could be blocked if you have registered the SelectionListener provided by getFilterSelectionListener() and not removed that listener (of disposed of the widget it was registered to).



Glazed Lists, Copyright © 2003 publicobject.com, O'Dell Engineering.
Documentation build by hbrands at 2015-02-16 14:02