|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjavax.swing.text.DocumentFilter
com.wordpress.tipsforjava.swing.text.ChainedDocumentFilter
abstract class ChainedDocumentFilter extends DocumentFilter
A single DocumentFilter can be set on an AbstractDocument. There may be times when you wish to perform multiple filtering of the data as it is added to a Document. By extending the ChainedDocumentFilter instead of the DocumentFilter you will receive added flexibility in that the filter can be used stand alone or with other ChainedDocumentFilters. Whenever one filter step fails, the chaining of the filters is also terminated. In this case is it recommended you invoke the provideErrorFeedback() method to provide user feedback.
| Field Summary | |
|---|---|
private DocumentFilter |
filter
|
| Constructor Summary | |
ChainedDocumentFilter()
Standard constructor for standalone usage |
|
ChainedDocumentFilter(DocumentFilter filter)
Constructor used when further filtering is required after this filter has been applied. |
|
| Method Summary | |
|---|---|
DocumentFilter
|
getFilter()
Get the next filter in the chain. |
void
|
insertString(FilterBypass fb, int offs, String str, AttributeSet a)
|
void
|
installFilter(JTextComponent... components)
Install this filter on the AbstractDocument |
void
|
provideErrorFeedback()
Provide appropriate LAF feedback when a filter error occurs. |
void
|
remove(DocumentFilter.FilterBypass fb, int offset, int length)
|
void
|
replace(FilterBypass fb, int offs, int length, String str, AttributeSet a)
|
void
|
setFilter(DocumentFilter filter)
Set the next filter in the chain |
void
|
uninstallFilter(JTextComponent... components)
Remove this filter from the AbstractDocument |
| Methods inherited from class DocumentFilter | |
|---|---|
| replace, remove, insertString, wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
| Methods inherited from class Object | |
|---|---|
| wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
| Field Detail |
|---|
private DocumentFilter filter
| Constructor Detail |
|---|
public ChainedDocumentFilter()
public ChainedDocumentFilter(DocumentFilter filter)
| Method Detail |
|---|
public DocumentFilter getFilter()
de public public void insertString(FilterBypass fb, int offs, String str, AttributeSet a)
public void installFilter(JTextComponent... components)
components - the text components that will use this filter
public void provideErrorFeedback()
de public public void remove(DocumentFilter.FilterBypass fb, int offset, int length)
de public public void replace(FilterBypass fb, int offs, int length, String str, AttributeSet a)
public void setFilter(DocumentFilter filter)
public void uninstallFilter(JTextComponent... components)
compoents - remove the filter from the specified text components
Groovy Documentation