Groovy Documentation

com.wordpress.tipsforjava.swing.text
[Java] Class ChainedDocumentFilter

java.lang.Object
  javax.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.

Authors:
Rob Camick
Darryl Burke


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

filter

private DocumentFilter filter


 
Constructor Detail

ChainedDocumentFilter

public ChainedDocumentFilter()
Standard constructor for standalone usage


ChainedDocumentFilter

public ChainedDocumentFilter(DocumentFilter filter)
Constructor used when further filtering is required after this filter has been applied.


 
Method Detail

getFilter

public DocumentFilter getFilter()
Get the next filter in the chain.
Returns:
the next filter in the chain


insertString

de
	public
public void insertString(FilterBypass fb, int offs, String str, AttributeSet a)


installFilter

public void installFilter(JTextComponent... components)
Install this filter on the AbstractDocument
Parameters:
components - the text components that will use this filter


provideErrorFeedback

public void provideErrorFeedback()
Provide appropriate LAF feedback when a filter error occurs.


remove

de
	public
public void remove(DocumentFilter.FilterBypass fb, int offset, int length)


replace

de
	public
public void replace(FilterBypass fb, int offs, int length, String str, AttributeSet a)


setFilter

public void setFilter(DocumentFilter filter)
Set the next filter in the chain
Parameters:
filter


uninstallFilter

public void uninstallFilter(JTextComponent... components)
Remove this filter from the AbstractDocument
Parameters:
compoents - remove the filter from the specified text components


 

Groovy Documentation