Class FormulaEditDisplayConverter
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.data.convert.ContextualDisplayConverter
-
- org.eclipse.nebula.widgets.nattable.formula.FormulaEditDisplayConverter
-
- All Implemented Interfaces:
IDisplayConverter
public class FormulaEditDisplayConverter extends ContextualDisplayConverter
IDisplayConverter
that needs to be registered forDisplayMode.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 aFormulaDataProvider
viaFormulaDataProvider.getNativeDataValue(int, int)
.configRegistry.registerConfigAttribute( CellConfigAttributes.DISPLAY_CONVERTER, new FormulaEditDisplayConverter(formulaDataProvider), DisplayMode.EDIT);
- Since:
- 1.4
-
-
Field Summary
Fields Modifier and Type Field Description protected FormulaDataProvider
dataProvider
-
Constructor Summary
Constructors Constructor Description FormulaEditDisplayConverter(FormulaDataProvider dataProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.-
Methods inherited from class org.eclipse.nebula.widgets.nattable.data.convert.ContextualDisplayConverter
canonicalToDisplayValue, displayToCanonicalValue
-
-
-
-
Field Detail
-
dataProvider
protected FormulaDataProvider dataProvider
-
-
Constructor Detail
-
FormulaEditDisplayConverter
public FormulaEditDisplayConverter(FormulaDataProvider dataProvider)
- Parameters:
dataProvider
- TheFormulaDataProvider
for retrieving the native formula value.
-
-
Method Detail
-
canonicalToDisplayValue
public Object canonicalToDisplayValue(ILayerCell cell, IConfigRegistry configRegistry, Object canonicalValue)
Description copied from interface:IDisplayConverter
Convert backing data value to value to be displayed. Typically converts to a String for display. Use this method for contextual conversion.Note that on returning a different type than String,
toString()
will be called on the returned object to render the value for displaying.- Specified by:
canonicalToDisplayValue
in interfaceIDisplayConverter
- Specified by:
canonicalToDisplayValue
in classContextualDisplayConverter
- Parameters:
cell
- TheILayerCell
whose canonical value should be converted.configRegistry
- TheIConfigRegistry
of the NatTable to which theILayerCell
belongs.canonicalValue
- The data value from the backing data.- Returns:
- The converted value to display.
-
displayToCanonicalValue
public Object displayToCanonicalValue(ILayerCell cell, IConfigRegistry configRegistry, 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 Use this method for contextual conversion.- Specified by:
displayToCanonicalValue
in interfaceIDisplayConverter
- Specified by:
displayToCanonicalValue
in classContextualDisplayConverter
- Parameters:
cell
- TheILayerCell
whose canonical value should be converted.configRegistry
- TheIConfigRegistry
of the NatTable to which theILayerCell
belongs.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.
-
-