Class StringConverterWithFormat<T>

java.lang.Object
javafx.util.StringConverter<T>
org.controlsfx.control.spreadsheet.StringConverterWithFormat<T>
Type Parameters:
T -

public abstract class StringConverterWithFormat<T> extends javafx.util.StringConverter<T>
This class is used by some of the SpreadsheetCellType in order to use a specific format.
Since the format is specified in the SpreadsheetCell, we need a converter which provide a runtime method toStringFormat(Object, String).
This class provide two constructors:
  • A default one where you implement the three abstract methods.
  • Another one which takes another StringConverter. This is useful when you just want to implement the toStringFormat(Object, String) and let the other converter handle the other methods.
See Also:
  • Field Details

    • myConverter

      protected javafx.util.StringConverter<T> myConverter
  • Constructor Details

    • StringConverterWithFormat

      public StringConverterWithFormat()
      Default constructor.
    • StringConverterWithFormat

      public StringConverterWithFormat(javafx.util.StringConverter<T> specificStringConverter)
      This constructor allow to use another StringConverter.
      Parameters:
      specificStringConverter -
  • Method Details

    • toStringFormat

      public String toStringFormat(T value, String format)
      Converts the object provided into its string form with the specified format.
      Parameters:
      value -
      format -
      Returns:
      a string containing the converted value with the specified format.