|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.JFormattedTextField.AbstractFormatter
javax.swing.text.DefaultFormatter
de.hillenbrand.swing.text.RegexFormatter
public class RegexFormatter
A regular expression based implementation of AbstractFormatter
.
Field Summary | |
---|---|
protected java.util.regex.Pattern |
pattern
|
Constructor Summary | |
---|---|
RegexFormatter(java.util.regex.Pattern pattern)
Creates a regular expression based AbstractFormatter . |
|
RegexFormatter(java.lang.String pattern)
Creates a regular expression based AbstractFormatter . |
Method Summary | |
---|---|
java.util.regex.Pattern |
getPattern()
Returns the Pattern used to determine if a value is
legal. |
void |
setPattern(java.util.regex.Pattern pattern)
Sets the pattern that will be used to determine if a value is legal. |
java.lang.Object |
stringToValue(java.lang.String text)
Parses text returning an arbitrary Object. |
Methods inherited from class javax.swing.text.DefaultFormatter |
---|
clone, getAllowsInvalid, getCommitsOnValidEdit, getDocumentFilter, getNavigationFilter, getOverwriteMode, getValueClass, install, setAllowsInvalid, setCommitsOnValidEdit, setOverwriteMode, setValueClass, valueToString |
Methods inherited from class javax.swing.JFormattedTextField.AbstractFormatter |
---|
getActions, getFormattedTextField, invalidEdit, setEditValid, uninstall |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.regex.Pattern pattern
Constructor Detail |
---|
public RegexFormatter(java.lang.String pattern) throws java.util.regex.PatternSyntaxException
AbstractFormatter
.
pattern
specifies the regular expression that will
be used to determine if a value is legal.
pattern
-
java.util.regex.PatternSyntaxException
public RegexFormatter(java.util.regex.Pattern pattern)
AbstractFormatter
.
pattern
specifies the regular expression that will
be used to determine if a value is legal.
pattern
- Method Detail |
---|
public void setPattern(java.util.regex.Pattern pattern)
pattern
- public java.util.regex.Pattern getPattern()
Pattern
used to determine if a value is
legal.
public java.lang.Object stringToValue(java.lang.String text) throws java.text.ParseException
text
returning an arbitrary Object. Some
formatters may return null.
stringToValue
in class javax.swing.text.DefaultFormatter
text
- String to convert
java.text.ParseException
- if there is an error in the conversion
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |