public class FormulaEditDisplayConverter extends ContextualDisplayConverter
IDisplayConverter that needs to be registered for
DisplayMode.EDIT in order to support editing of formulas without
formula execution.
Technically it does not perform a conversion, but returns the value of the
IDataProvider that is wrapped by a FormulaDataProvider via
FormulaDataProvider.getNativeDataValue(int, int).
configRegistry.registerConfigAttribute(
CellConfigAttributes.DISPLAY_CONVERTER,
new FormulaEditDisplayConverter(formulaDataProvider),
DisplayMode.EDIT);
| Modifier and Type | Field and Description |
|---|---|
protected FormulaDataProvider |
dataProvider |
| Constructor and Description |
|---|
FormulaEditDisplayConverter(FormulaDataProvider dataProvider) |
| Modifier and Type | Method and Description |
|---|---|
Object |
canonicalToDisplayValue(ILayerCell cell,
IConfigRegistry configRegistry,
Object canonicalValue)
Convert backing data value to value to be displayed.
|
Object |
displayToCanonicalValue(ILayerCell cell,
IConfigRegistry configRegistry,
Object displayValue)
Convert from display value to value in the backing data structure.
|
canonicalToDisplayValue, displayToCanonicalValueprotected FormulaDataProvider dataProvider
public FormulaEditDisplayConverter(FormulaDataProvider dataProvider)
dataProvider - The FormulaDataProvider for retrieving the native
formula value.public Object canonicalToDisplayValue(ILayerCell cell, IConfigRegistry configRegistry, Object canonicalValue)
IDisplayConverter
Note that on returning a different type than String,
toString() will be called on the returned object to render
the value for displaying.
canonicalToDisplayValue in interface IDisplayConvertercanonicalToDisplayValue in class ContextualDisplayConvertercell - The ILayerCell whose canonical value should be
converted.configRegistry - The IConfigRegistry of the NatTable to which the
ILayerCell belongs.canonicalValue - The data value from the backing data.public Object displayToCanonicalValue(ILayerCell cell, IConfigRegistry configRegistry, Object displayValue)
IDisplayConverter
NOTE:
The type the display value is converted to must match the type in
the setter of the backing bean/row object Use this method for contextual
conversion.
displayToCanonicalValue in interface IDisplayConverterdisplayToCanonicalValue in class ContextualDisplayConvertercell - The ILayerCell whose canonical value should be
converted.configRegistry - The IConfigRegistry of the NatTable to which the
ILayerCell belongs.displayValue - The display value that should be converted to the data value
that matches the backing data.Copyright © 2019. All rights reserved.