public final class TypeSafeTextDocumentFilter
extends javax.swing.text.DocumentFilter
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MAXCHARS |
Constructor and Description |
---|
TypeSafeTextDocumentFilter()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getInvalidChars()
Gets invalid characters.
|
boolean |
getLowerCase()
Gets lowercase flag.
|
int |
getMaxChars()
Gets max characters allowed.
|
java.lang.String |
getReplacableChars()
Gets the replacable characters.
|
java.lang.String |
getReplacedChars()
Gets the replaced characters.
|
boolean |
getUpperCase()
Gets uppercase flag.
|
java.lang.String |
getValidChars()
Gets valid characters.
|
void |
insertString(javax.swing.text.DocumentFilter.FilterBypass fb,
int offset,
java.lang.String text,
javax.swing.text.AttributeSet attrs)
Invoked prior to insertion of text into the specified Document.
|
void |
remove(javax.swing.text.DocumentFilter.FilterBypass fb,
int offset,
int length)
Invoked prior to removal of the specified region
in the specified Document.
|
void |
replace(javax.swing.text.DocumentFilter.FilterBypass fb,
int offset,
int length,
java.lang.String text,
javax.swing.text.AttributeSet attrs)
Invoked prior to replacing a region of text in the specified Document.
|
void |
setInvalidChars(java.lang.String all)
Sets invalid characters.
|
void |
setLowerCase(boolean f)
Sets lowercase flag.
|
void |
setMaxChars(int num)
Sets max characters allowed.
|
void |
setReplacableChars(java.lang.String all)
Sets replacable characters.
|
void |
setReplacedChars(java.lang.String all)
Sets replaced characters.
|
void |
setUpperCase(boolean f)
Sets uppercase flag.
|
void |
setValidChars(java.lang.String all)
Sets valid characters.
|
public static final int DEFAULT_MAXCHARS
public void insertString(javax.swing.text.DocumentFilter.FilterBypass fb, int offset, java.lang.String text, javax.swing.text.AttributeSet attrs) throws javax.swing.text.BadLocationException
insertString
in class javax.swing.text.DocumentFilter
fb
- The FilterBypass.offset
- The offset.text
- The text to insert.attrs
- The AttributeSet.javax.swing.text.BadLocationException
public void remove(javax.swing.text.DocumentFilter.FilterBypass fb, int offset, int length) throws javax.swing.text.BadLocationException
remove
in class javax.swing.text.DocumentFilter
fb
- The FilterBypass.offset
- The offset.length
- The length to remove.javax.swing.text.BadLocationException
public void replace(javax.swing.text.DocumentFilter.FilterBypass fb, int offset, int length, java.lang.String text, javax.swing.text.AttributeSet attrs) throws javax.swing.text.BadLocationException
replace
in class javax.swing.text.DocumentFilter
fb
- The FilterBypass.offset
- The offset.length
- The length of the text.text
- The text to replace.attrs
- The AttributeSet.javax.swing.text.BadLocationException
public boolean getUpperCase()
public void setUpperCase(boolean f)
f
- true/false.public boolean getLowerCase()
public void setLowerCase(boolean f)
f
- true/false.public int getMaxChars()
public void setMaxChars(int num)
num
- maxChars.public java.lang.String getValidChars()
public void setValidChars(java.lang.String all)
all
- validChars.public java.lang.String getInvalidChars()
public void setInvalidChars(java.lang.String all)
all
- invalidChars.public java.lang.String getReplacableChars()
public void setReplacableChars(java.lang.String all)
all
- replacableChars.public java.lang.String getReplacedChars()
public void setReplacedChars(java.lang.String all)
all
- replacedChars.