|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.text.AbstractDocument
javax.swing.text.PlainDocument
jve.generated.SwingPropertyFilter
This filter acts as a Document for a JTextComponent. The value of the text field will be used to filter an object based on a given property. The filter is a simple string contains test.
For example entering "Jon" would accept both "Jonathan Brown" and "Don Jones."
Override the accept() method to change the filtering behavior. The case sensitivity of the filter can be changed via the caseSensitive property. The default behavior ignores case.
To setup this filter, set the input text field as the filter's visualTextComponent, set the filter as the document of the text field, and set the filteredProperty that will be filtered.
| Nested Class Summary |
| Nested classes inherited from class javax.swing.text.AbstractDocument |
javax.swing.text.AbstractDocument.AbstractElement, javax.swing.text.AbstractDocument.AttributeContext, javax.swing.text.AbstractDocument.BranchElement, javax.swing.text.AbstractDocument.Content, javax.swing.text.AbstractDocument.DefaultDocumentEvent, javax.swing.text.AbstractDocument.ElementEdit, javax.swing.text.AbstractDocument.LeafElement |
| Nested classes inherited from class jve.generated.IFilterBinder |
IFilterBinder.FilterChangeEvent, IFilterBinder.FilterChangeListener |
| Field Summary |
| Fields inherited from class javax.swing.text.PlainDocument |
lineLimitAttribute, tabSizeAttribute |
| Fields inherited from class javax.swing.text.AbstractDocument |
BidiElementName, ContentElementName, ElementNameAttribute, ParagraphElementName, SectionElementName |
| Fields inherited from interface javax.swing.text.Document |
StreamDescriptionProperty, TitleProperty |
| Constructor Summary | |
SwingPropertyFilter()
Construct a SwingPropertyFilter. |
|
| Method Summary | |
boolean |
accept(java.lang.Object o)
This is the default filter that is a simple Object's string contains the filtered string. |
void |
addDocumentListener(javax.swing.event.DocumentListener listener)
|
void |
addFilterChangeListener(IFilterBinder.FilterChangeListener l)
Add a new filter change listener to the listener list. |
java.lang.String |
getFilteredProperty()
Get the property on the canidate objects that will be filtered based on the user text input. |
javax.swing.text.JTextComponent |
getVisualTextComponent()
|
boolean |
isCaseSensitive()
Get whether the filter accept mechanism is sensitive to String case. |
void |
removeFilterChangeListener(IFilterBinder.FilterChangeListener l)
Remove an existing filter change listener from the listener list. |
void |
setCaseSensitive(boolean cs)
Sets whether the filter should be sensitive to case while filtering. |
void |
setFilteredProperty(java.lang.String filteredProperty)
Set the property that the canidate objects will be based on. |
void |
setVisualTextComponent(javax.swing.text.JTextComponent srcTextComponent)
Set the visual text component that will be used as input for the filter. |
java.lang.String |
toString()
|
| Methods inherited from class javax.swing.text.PlainDocument |
getDefaultRootElement, getParagraphElement, insertString |
| Methods inherited from class javax.swing.text.AbstractDocument |
addUndoableEditListener, createPosition, dump, getAsynchronousLoadPriority, getBidiRootElement, getDocumentFilter, getDocumentListeners, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getRootElements, getStartPosition, getText, getText, getUndoableEditListeners, putProperty, readLock, readUnlock, remove, removeDocumentListener, removeUndoableEditListener, render, replace, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public SwingPropertyFilter()
| Method Detail |
public boolean accept(java.lang.Object o)
If the filteredProperty does not exist on the given object, the object will be accepted by default.
accept in interface IFilterBindero - The object to filter upon
public void addFilterChangeListener(IFilterBinder.FilterChangeListener l)
IFilterBinder
addFilterChangeListener in interface IFilterBinderl - the new listener.public void removeFilterChangeListener(IFilterBinder.FilterChangeListener l)
IFilterBinder
removeFilterChangeListener in interface IFilterBinderl - the listener to be removed.public java.lang.String getFilteredProperty()
public void setFilteredProperty(java.lang.String filteredProperty)
filteredProperty - the property to setpublic java.lang.String toString()
public void addDocumentListener(javax.swing.event.DocumentListener listener)
addDocumentListener in interface javax.swing.text.Documentpublic boolean isCaseSensitive()
public void setCaseSensitive(boolean cs)
cs - true to enable caseSensitivity, false otherwise.public javax.swing.text.JTextComponent getVisualTextComponent()
public void setVisualTextComponent(javax.swing.text.JTextComponent srcTextComponent)
srcTextComponent - The srcTextComponent to set.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||