javax.swing.text
Class DocumentFilter

java.lang.Object
  |
  +--javax.swing.text.DocumentFilter
Direct Known Subclasses:
javax.swing.text.DefaultFormatter.DefaultDocumentFilter, javax.swing.JSpinner.ListEditor.ListFormatter.Filter

public class DocumentFilter
extends Object

Safe:


Constructor Summary
DocumentFilter()
          Enabled:
 
Method Summary
 void insertString(javax.swing.text.DocumentFilter.FilterBypass fb, int offset, String string, AttributeSet attr)
          Suppressed: Invoked prior to insertion of text into the specified Document.
 void remove(javax.swing.text.DocumentFilter.FilterBypass fb, int offset, int length)
          Suppressed: Invoked prior to removal of the specified region in the specified Document.
 void replace(javax.swing.text.DocumentFilter.FilterBypass fb, int offset, int length, String text, AttributeSet attrs)
          Suppressed: Invoked prior to replacing a region of text in the specified Document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentFilter

public DocumentFilter()
Enabled:

Method Detail

remove

public void remove(javax.swing.text.DocumentFilter.FilterBypass fb,
                   int offset,
                   int length)
            throws BadLocationException
Suppressed: Invoked prior to removal of the specified region in the specified Document. Subclasses that want to conditionally allow removal should override this and only call supers implementation as necessary, or call directly into the FilterBypass as necessary.

Parameters:
fb - FilterBypass that can be used to mutate Document
offset - the offset from the beginning >= 0
length - the number of characters to remove >= 0
BadLocationException

insertString

public void insertString(javax.swing.text.DocumentFilter.FilterBypass fb,
                         int offset,
                         String string,
                         AttributeSet attr)
                  throws BadLocationException
Suppressed: Invoked prior to insertion of text into the specified Document. Subclasses that want to conditionally allow insertion should override this and only call supers implementation as necessary, or call directly into the FilterBypass.

Parameters:
fb - FilterBypass that can be used to mutate Document
offset - the offset into the document to insert the content >= 0. All positions that track change at or after the given location will move.
string - the string to insert
attr - the attributes to associate with the inserted content. This may be null if there are no attributes.
BadLocationException

replace

public void replace(javax.swing.text.DocumentFilter.FilterBypass fb,
                    int offset,
                    int length,
                    String text,
                    AttributeSet attrs)
             throws BadLocationException
Suppressed: Invoked prior to replacing a region of text in the specified Document. Subclasses that want to conditionally allow replace should override this and only call supers implementation as necessary, or call directly into the FilterBypass.

Parameters:
fb - FilterBypass that can be used to mutate Document
offset - Location in Document
length - Length of text to delete
text - Text to insert, null indicates no text to insert
attrs - AttributeSet indicating attributes of inserted text, null is legal.
BadLocationException


comments?