Package Class Use Tree Index Help 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 protected boolean caseSensitive
protected java.lang.String filteredProperty
protected java.util.List filterListeners
protected java.lang.String lcValue
protected java.lang.String value
protected javax.swing.text.JTextComponent visualTextComponent
Fields inherited from class javax.swing.text.PlainDocument lineLimitAttribute, tabSizeAttribute
Fields inherited from class javax.swing.text.AbstractDocument BAD_LOCATION, BidiElementName, ContentElementName, ElementNameAttribute, listenerList, 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.protected void contentChanged()
Respond to a change of the text field's contents.protected void fireFilterChanged(java.lang.Object src, java.lang.Object oldO, java.lang.Object newO)
Notify all the registered FilterChangeListeners that the value of the filter has changed.java.lang.String getFilteredProperty()
Get the property on the canidate objects that will be filtered based on the user text input.protected java.lang.String getValue()
Get the current text value that will be the used to filter the object.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 createDefaultRoot, getDefaultRootElement, getParagraphElement, insertString, insertUpdate, removeUpdate
Methods inherited from class javax.swing.text.AbstractDocument addUndoableEditListener, createBranchElement, createLeafElement, createPosition, dump, fireChangedUpdate, fireInsertUpdate, fireRemoveUpdate, fireUndoableEditUpdate, getAsynchronousLoadPriority, getAttributeContext, getBidiRootElement, getContent, getCurrentWriter, getDocumentFilter, getDocumentListeners, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getRootElements, getStartPosition, getText, getText, getUndoableEditListeners, postRemoveUpdate, putProperty, readLock, readUnlock, remove, removeDocumentListener, removeUndoableEditListener, render, replace, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties, writeLock, writeUnlock
Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Field Detail
protected java.lang.String filteredProperty
protected javax.swing.text.JTextComponent visualTextComponent
protected java.lang.String value
protected java.lang.String lcValue
protected boolean caseSensitive
protected java.util.List filterListeners
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.
public void addFilterChangeListener(IFilterBinder.FilterChangeListener l)
public void removeFilterChangeListener(IFilterBinder.FilterChangeListener l)
public java.lang.String getFilteredProperty()
public void setFilteredProperty(java.lang.String filteredProperty)
protected java.lang.String getValue()
protected void fireFilterChanged(java.lang.Object src, java.lang.Object oldO, java.lang.Object newO)
protected void contentChanged()
public java.lang.String toString()
public void addDocumentListener(javax.swing.event.DocumentListener listener)
public boolean isCaseSensitive()
public void setCaseSensitive(boolean cs)
public javax.swing.text.JTextComponent getVisualTextComponent()
public void setVisualTextComponent(javax.swing.text.JTextComponent srcTextComponent)
Package Class Use Tree Index Help PREV CLASS NEXT CLASS FRAMES NO FRAMES SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD