Documentation of 'org.jdesktop.swingx.text.StrictNumberFormatter' Java class
StrictNumberFormatter
org.jdesktop.swingx.text

Class StrictNumberFormatter

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable


    public class StrictNumberFormatter
    extends javax.swing.text.NumberFormatter
    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.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      StrictNumberFormatter(java.text.NumberFormat format) 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void setMaximum(java.lang.Comparable max) 
      void setMinimum(java.lang.Comparable minimum) 
      void setValueClass(java.lang.Class<?> valueClass)
      java.lang.Object stringToValue(java.lang.String text)
      Returns the Object representation of the String text, may be null.
      • Methods inherited from class javax.swing.text.NumberFormatter

        setFormat
      • Methods inherited from class javax.swing.text.InternationalFormatter

        clone, getFields, getFormat, getMaximum, getMinimum, install, valueToString
      • Methods inherited from class javax.swing.text.DefaultFormatter

        getAllowsInvalid, getCommitsOnValidEdit, getOverwriteMode, getValueClass, setAllowsInvalid, setCommitsOnValidEdit, setOverwriteMode
      • Methods inherited from class javax.swing.JFormattedTextField.AbstractFormatter

        uninstall
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StrictNumberFormatter

        public StrictNumberFormatter(java.text.NumberFormat format)
        Parameters:
        format -
    • Method Detail

      • setValueClass

        public void setValueClass(java.lang.Class<?> valueClass)

        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 class javax.swing.text.DefaultFormatter
      • setMaximum

        public void setMaximum(java.lang.Comparable max)
        Overrides:
        setMaximum in class javax.swing.text.InternationalFormatter
      • setMinimum

        public void setMinimum(java.lang.Comparable minimum)
        Overrides:
        setMinimum in class javax.swing.text.InternationalFormatter
      • stringToValue

        public java.lang.Object stringToValue(java.lang.String text)
                                       throws java.text.ParseException
        Returns the Object representation of the String text, may be null.
        Overrides:
        stringToValue in class javax.swing.text.InternationalFormatter
        Parameters:
        text - String to convert
        Returns:
        Object representation of text
        Throws:
        java.text.ParseException - if there is an error in the conversion

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.