Class FormulaResultDisplayConverter
java.lang.Object
org.eclipse.nebula.widgets.nattable.data.convert.DisplayConverter
org.eclipse.nebula.widgets.nattable.formula.FormulaResultDisplayConverter
- All Implemented Interfaces:
IDisplayConverter
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncanonicalToDisplayValue(Object canonicalValue) Convert backing data value to value to be displayed.displayToCanonicalValue(Object displayValue) Convert from display value to value in the backing data structure.voidsetFormatNumberValues(boolean format) Configure whether all number values should be formatted using theDecimalFormatof theFormulaParser.Methods inherited from class org.eclipse.nebula.widgets.nattable.data.convert.DisplayConverter
canonicalToDisplayValue, displayToCanonicalValue
-
Field Details
-
dataProvider
-
formatNumberValues
protected boolean formatNumberValues
-
-
Constructor Details
-
FormulaResultDisplayConverter
- Parameters:
dataProvider- TheFormulaDataProviderfor retrieving the native formula value.
-
-
Method Details
-
canonicalToDisplayValue
Description copied from interface:IDisplayConverterConvert backing data value to value to be displayed. Typically converts to a String for display.- Specified by:
canonicalToDisplayValuein interfaceIDisplayConverter- Specified by:
canonicalToDisplayValuein classDisplayConverter- Parameters:
canonicalValue- The data value from the backing data.- Returns:
- The converted value to display.
-
displayToCanonicalValue
Description copied from interface:IDisplayConverterConvert 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:
displayToCanonicalValuein interfaceIDisplayConverter- Specified by:
displayToCanonicalValuein 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 theDecimalFormatof theFormulaParser.- Parameters:
format-trueto perform formatting,falseif not. Default isfalse.
-