Class FormulaResultDisplayConverter
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.data.convert.DisplayConverter
-
- org.eclipse.nebula.widgets.nattable.formula.FormulaResultDisplayConverter
-
- All Implemented Interfaces:
IDisplayConverter
public class FormulaResultDisplayConverter extends DisplayConverter
IDisplayConverter
that needs to be registered forDisplayMode.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 Summary
Fields Modifier and Type Field Description protected FormulaDataProvider
dataProvider
protected boolean
formatNumberValues
-
Constructor Summary
Constructors Constructor Description FormulaResultDisplayConverter(FormulaDataProvider dataProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
canonicalToDisplayValue(Object canonicalValue)
Convert backing data value to value to be displayed.Object
displayToCanonicalValue(Object displayValue)
Convert from display value to value in the backing data structure.void
setFormatNumberValues(boolean format)
Configure whether all number values should be formatted using theDecimalFormat
of theFormulaParser
.-
Methods inherited from class org.eclipse.nebula.widgets.nattable.data.convert.DisplayConverter
canonicalToDisplayValue, displayToCanonicalValue
-
-
-
-
Field Detail
-
dataProvider
protected FormulaDataProvider dataProvider
-
formatNumberValues
protected boolean formatNumberValues
-
-
Constructor Detail
-
FormulaResultDisplayConverter
public FormulaResultDisplayConverter(FormulaDataProvider dataProvider)
- Parameters:
dataProvider
- TheFormulaDataProvider
for retrieving the native formula value.
-
-
Method Detail
-
canonicalToDisplayValue
public Object canonicalToDisplayValue(Object canonicalValue)
Description copied from interface:IDisplayConverter
Convert backing data value to value to be displayed. Typically converts to a String for display.- Specified by:
canonicalToDisplayValue
in interfaceIDisplayConverter
- Specified by:
canonicalToDisplayValue
in classDisplayConverter
- Parameters:
canonicalValue
- The data value from the backing data.- Returns:
- The converted value to display.
-
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 interfaceIDisplayConverter
- Specified by:
displayToCanonicalValue
in classDisplayConverter
- 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 theDecimalFormat
of theFormulaParser
.- Parameters:
format
-true
to perform formatting,false
if not. Default isfalse
.
-
-