Package org.jdesktop.swingx.text
Class StrictNumberFormatter
java.lang.Object
javax.swing.JFormattedTextField.AbstractFormatter
javax.swing.text.DefaultFormatter
javax.swing.text.InternationalFormatter
javax.swing.text.NumberFormatter
org.jdesktop.swingx.text.StrictNumberFormatter
- All Implemented Interfaces:
Serializable
,Cloneable
Experiment to work around Issue #1183-swingx: NumberEditorExt throws exception
on getCellValue. Remaining issue: no visual error feedback if the expected
number type exceeds its range.
- Author:
- Jeanette Winzenburg
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
setMaximum
(Comparable max) void
setMinimum
(Comparable minimum) void
setValueClass
(Class<?> valueClass) stringToValue
(String text) Returns theObject
representation of theString
text
, may be null.Methods inherited from class javax.swing.text.NumberFormatter
setFormat
Methods inherited from class javax.swing.text.InternationalFormatter
clone, getActions, getFields, getFormat, getMaximum, getMinimum, install, valueToString
Methods inherited from class javax.swing.text.DefaultFormatter
getAllowsInvalid, getCommitsOnValidEdit, getDocumentFilter, getNavigationFilter, getOverwriteMode, getValueClass, setAllowsInvalid, setCommitsOnValidEdit, setOverwriteMode
Methods inherited from class javax.swing.JFormattedTextField.AbstractFormatter
getFormattedTextField, invalidEdit, setEditValid, uninstall
-
Constructor Details
-
StrictNumberFormatter
- Parameters:
format
-
-
-
Method Details
-
setValueClass
Overridden to automatically set the minimum/maximum to the boundaries of the Number type if it corresponds to a raw type, or null if not.
- Overrides:
setValueClass
in classDefaultFormatter
-
setMaximum
- Overrides:
setMaximum
in classInternationalFormatter
-
setMinimum
- Overrides:
setMinimum
in classInternationalFormatter
-
stringToValue
Returns theObject
representation of theString
text
, may be null.- Overrides:
stringToValue
in classInternationalFormatter
- Parameters:
text
-String
to convert- Returns:
Object
representation of text- Throws:
ParseException
- if there is an error in the conversion
-