Module is.codion.swing.common.ui
Class ParsingDocumentFilter<T>
java.lang.Object
javax.swing.text.DocumentFilter
is.codion.swing.common.ui.component.text.ValidationDocumentFilter<T>
is.codion.swing.common.ui.component.text.ParsingDocumentFilter<T>
- Type Parameters:
T
- the value type
- Direct Known Subclasses:
CaseDocumentFilter
A DocumentFilter which parses a value from the document text and allows for validation of the parsed value.
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.text.DocumentFilter
DocumentFilter.FilterBypass
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
insertString
(DocumentFilter.FilterBypass filterBypass, int offset, String string, AttributeSet attributeSet) final void
remove
(DocumentFilter.FilterBypass filterBypass, int offset, int length) final void
replace
(DocumentFilter.FilterBypass filterBypass, int offset, int length, String string, AttributeSet attributeSet) protected String
Perform any required transformation of the string, the resulting string must be of the same length as the original string.Methods inherited from class is.codion.swing.common.ui.component.text.ValidationDocumentFilter
addValidator, validate, validators
-
Constructor Details
-
ParsingDocumentFilter
-
-
Method Details
-
insertString
public final void insertString(DocumentFilter.FilterBypass filterBypass, int offset, String string, AttributeSet attributeSet) throws BadLocationException - Overrides:
insertString
in classDocumentFilter
- Throws:
BadLocationException
-
remove
public final void remove(DocumentFilter.FilterBypass filterBypass, int offset, int length) throws BadLocationException - Overrides:
remove
in classDocumentFilter
- Throws:
BadLocationException
-
replace
public final void replace(DocumentFilter.FilterBypass filterBypass, int offset, int length, String string, AttributeSet attributeSet) throws BadLocationException - Overrides:
replace
in classDocumentFilter
- Throws:
BadLocationException
-
transform
Perform any required transformation of the string, the resulting string must be of the same length as the original string. Returns the string unchanged by default.- Parameters:
string
- the string to transform- Returns:
- the transformed string
-