|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--gov.sns.tools.swing.patternfilter.PatternListFilter
PatternListFilter uses a pattern poster to filter a list of named items. As the user enters text into a text component, the list is filtered in real time. Items in the base list that match the pattern are placed into the filtered list.
| Nested Class Summary | |
protected class |
PatternListFilter.PatternChangeHandler
PatternChangeHandler is an internal class whose instance is used to listen for pattern change events. |
| Field Summary | |
protected java.util.List |
_baseList
|
protected java.util.List |
_filteredList
|
protected MessageCenter |
_messageCenter
|
protected PatternListFilter.PatternChangeHandler |
_patternHandler
|
protected PatternEventPoster |
_patternPoster
|
protected ListFilterListener |
_proxy
|
| Constructor Summary | |
PatternListFilter(java.util.List list,
javax.swing.text.Document document)
Constructor which uses the default pattern generator to construct a "contains" pattern. |
|
PatternListFilter(java.util.List list,
javax.swing.text.Document document,
boolean caseSensitive)
Constructor which uses the default pattern generator to construct a "contains" pattern. |
|
PatternListFilter(java.util.List list,
javax.swing.text.Document document,
PatternGenerator patternGenerator,
boolean caseSensitive)
Constructor which uses the default pattern generator to construct a "contains" pattern. |
|
PatternListFilter(java.util.List list,
javax.swing.text.Document document,
PatternGenerator patternGenerator,
int patternFlags)
Constructor which uses the default pattern generator to construct a "contains" pattern. |
|
PatternListFilter(java.util.List list,
PatternEventPoster patternPoster)
Primary constructor |
|
| Method Summary | |
void |
addListFilterListener(ListFilterListener listener)
Add a listener of list filter events indicating that the list has been filtered and thus may have changed. |
protected void |
filterList(java.util.regex.Pattern pattern,
boolean narrowing)
Filter the base list based on the pattern and whether the pattern change is narrowing. |
protected void |
filterList(java.util.regex.Pattern pattern,
java.util.List baseList)
Filter the base list using the pattern. |
java.util.List |
getFilteredList()
Get the filtered list |
void |
removeListFilterListener(ListFilterListener listener)
Remove the listener from receiving list filter events. |
protected void |
setFilteredList(java.util.List list)
Set the filtered list to the one specified and broadcast the filter list change event. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected MessageCenter _messageCenter
protected ListFilterListener _proxy
protected PatternListFilter.PatternChangeHandler _patternHandler
protected java.util.List _baseList
protected java.util.List _filteredList
protected PatternEventPoster _patternPoster
| Constructor Detail |
public PatternListFilter(java.util.List list,
PatternEventPoster patternPoster)
list - the list to filter with the pattern. This list is not modified by the filter.patternPoster - the poster used to post pattern change events
public PatternListFilter(java.util.List list,
javax.swing.text.Document document,
boolean caseSensitive)
list - the list to filter with the pattern. This list is not modified by the filter.document - the document used to generate the patterns used to filter the listcaseSensitive - true indicates the filter should be case sensitive and false indicates it should be case insensitive
public PatternListFilter(java.util.List list,
javax.swing.text.Document document)
list - the list to filter with the pattern. This list is not modified by the filter.document - the document used to generate the patterns used to filter the list
public PatternListFilter(java.util.List list,
javax.swing.text.Document document,
PatternGenerator patternGenerator,
boolean caseSensitive)
list - the list to filter with the pattern. This list is not modified by the filter.document - the document used to generate the patterns used to filter the listpatternGenerator - the pattern generator to usecaseSensitive - true indicates the filter should be case sensitive and false indicates it should be case insensitive
public PatternListFilter(java.util.List list,
javax.swing.text.Document document,
PatternGenerator patternGenerator,
int patternFlags)
list - the list to filter with the pattern. This list is not modified by the filter.document - the document used to generate the patterns used to filter the listpatternGenerator - the pattern generator to usepatternFlags - the Pattern flags| Method Detail |
public void addListFilterListener(ListFilterListener listener)
listener - The listener to receive the list filter events.public void removeListFilterListener(ListFilterListener listener)
listener - The listener to receive the list filter events.public java.util.List getFilteredList()
protected void setFilteredList(java.util.List list)
list - the new filtered list.
protected void filterList(java.util.regex.Pattern pattern,
boolean narrowing)
pattern - the pattern to use for filtering the listnarrowing - true indicates that the latest pattern filter is narrower than the pervious
protected void filterList(java.util.regex.Pattern pattern,
java.util.List baseList)
pattern - the pattern used to filter items in the base listbaseList - the list of items we wish to filter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||