javax.swing.text
Class DefaultFormatter.DefaultDocumentFilter
java.lang.Object
javax.swing.text.DocumentFilter
javax.swing.text.DefaultFormatter.DefaultDocumentFilter
- All Implemented Interfaces:
- Serializable
- Enclosing class:
- DefaultFormatter
- private class DefaultFormatter.DefaultDocumentFilter
- extends DocumentFilter
- implements Serializable
DocumentFilter implementation that calls back to the replace
method of DefaultFormatter.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultFormatter.DefaultDocumentFilter
private DefaultFormatter.DefaultDocumentFilter()
remove
public void remove(DocumentFilter.FilterBypass fb,
int offset,
int length)
throws BadLocationException
- Description copied from class:
DocumentFilter
- 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.
- Overrides:
remove
in class DocumentFilter
- Parameters:
fb
- FilterBypass that can be used to mutate Documentoffset
- the offset from the beginning >= 0length
- the number of characters to remove >= 0
- Throws:
BadLocationException
- some portion of the removal range
was not a valid part of the document. The location in the exception
is the first bad position encountered.
insertString
public void insertString(DocumentFilter.FilterBypass fb,
int offset,
String string,
AttributeSet attr)
throws BadLocationException
- Description copied from class:
DocumentFilter
- 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.
- Overrides:
insertString
in class DocumentFilter
- Parameters:
fb
- FilterBypass that can be used to mutate Documentoffset
- 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 insertattr
- the attributes to associate with the inserted
content. This may be null if there are no attributes.
- Throws:
BadLocationException
- the given insert position is not a
valid position within the document
replace
public void replace(DocumentFilter.FilterBypass fb,
int offset,
int length,
String text,
AttributeSet attr)
throws BadLocationException
- Description copied from class:
DocumentFilter
- 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.
- Overrides:
replace
in class DocumentFilter
- Parameters:
fb
- FilterBypass that can be used to mutate Documentoffset
- Location in Documentlength
- Length of text to deletetext
- Text to insert, null indicates no text to insertattr
- AttributeSet indicating attributes of inserted text,
null is legal.
- Throws:
BadLocationException
- the given insert position is not a
valid position within the document