|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.richclient.form.binding.swing.text.RegExDocumentFactory
public class RegExDocumentFactory
This DocumentFactory will create a Document which holds a Pattern
. This Pattern is then used
to verify each character that is inserted. This makes it possible to eg. allow only alfanumeric. Note
that if you need a specific sequence of characters, you probably need a formatted textField with formatter
instead.
Constructor Summary | |
---|---|
RegExDocumentFactory()
Default constructor sets the pattern to use '.'. |
|
RegExDocumentFactory(String characterPattern)
Construct a RegExDocumentFactory with the given pattern. |
|
RegExDocumentFactory(String characterPattern,
boolean convertToUppercase)
Construct a RegExDocumentFactory with the given pattern and convert to uppercase if requested. |
Method Summary | |
---|---|
Document |
createDocument()
Create a new Document to be used in a JTextComponent . |
String |
getCharacterPattern()
Returns the pattern that is used by this RegExDocumentFactory. |
boolean |
isConvertToUppercase()
Returns true if the Document should convert all lowercase letters to uppercase. |
void |
setCharacterPattern(String characterPattern)
Set the pattern to be used by this RegExDocumentFactory. |
void |
setConvertToUppercase(boolean convertToUppercase)
Set to true if all lowercase letters should be converted to uppercase. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RegExDocumentFactory()
public RegExDocumentFactory(String characterPattern)
characterPattern
- the pattern to use.public RegExDocumentFactory(String characterPattern, boolean convertToUppercase)
characterPattern
- the pattern to use.convertToUppercase
- if true
convert all letters to uppercase.Method Detail |
---|
public String getCharacterPattern()
public void setCharacterPattern(String characterPattern)
characterPattern
- the pattern.public boolean isConvertToUppercase()
true
if the Document should convert all lowercase letters to uppercase.
true
if lowercase is converted to uppercase.public void setConvertToUppercase(boolean convertToUppercase)
true
if all lowercase letters should be converted to uppercase.
convertToUppercase
- set to true
if conversion should happen.public Document createDocument()
Document
to be used in a JTextComponent
.
createDocument
in interface DocumentFactory
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |