Class FormulaResultDisplayConverter

  • All Implemented Interfaces:
    IDisplayConverter

    public class FormulaResultDisplayConverter
    extends DisplayConverter
    IDisplayConverter that needs to be registered for DisplayMode.NORMAL in order to support localized rendering of decimal result values of formulas.
     configRegistry.registerConfigAttribute(
             CellConfigAttributes.DISPLAY_CONVERTER,
             new FormulaResultDisplayConverter(formulaDataProvider),
             DisplayMode.NORMAL);
     
    Since:
    1.4
    • Field Detail

      • formatNumberValues

        protected boolean formatNumberValues
    • Constructor Detail

      • FormulaResultDisplayConverter

        public FormulaResultDisplayConverter​(FormulaDataProvider dataProvider)
        Parameters:
        dataProvider - The FormulaDataProvider for retrieving the native formula value.
    • Method Detail

      • displayToCanonicalValue

        public Object displayToCanonicalValue​(Object displayValue)
        Description copied from interface: IDisplayConverter
        Convert from display value to value in the backing data structure.

        NOTE:
        The type the display value is converted to must match the type in the setter of the backing bean/row object

        Specified by:
        displayToCanonicalValue in interface IDisplayConverter
        Specified by:
        displayToCanonicalValue in class DisplayConverter
        Parameters:
        displayValue - The display value that should be converted to the data value that matches the backing data.
        Returns:
        The converted value to put to the backing data.
      • setFormatNumberValues

        public void setFormatNumberValues​(boolean format)
        Configure whether all number values should be formatted using the DecimalFormat of the FormulaParser.
        Parameters:
        format - true to perform formatting, false if not. Default is false.