|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.text.DocumentFilter
gr.zeus.ui.typesafe.TypeSafeTextDocumentFilter
public final class TypeSafeTextDocumentFilter
This class creates a custom filter for JTextComponents by extending the DocumentFilter. With this filter we achieve the following data validation within a field:
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.text.DocumentFilter |
---|
javax.swing.text.DocumentFilter.FilterBypass |
Field Summary | |
---|---|
static int |
DEFAULT_MAXCHARS
|
Constructor Summary | |
---|---|
TypeSafeTextDocumentFilter()
Constructor. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_MAXCHARS
Constructor Detail |
---|
public TypeSafeTextDocumentFilter()
Method Detail |
---|
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |