org.eclipse.nebula.widgets.nattable.data.convert
Class NumericDisplayConverter

java.lang.Object
  extended by org.eclipse.nebula.widgets.nattable.data.convert.DisplayConverter
      extended by org.eclipse.nebula.widgets.nattable.data.convert.NumericDisplayConverter
All Implemented Interfaces:
IDisplayConverter
Direct Known Subclasses:
DecimalNumericDisplayConverter, DefaultByteDisplayConverter, DefaultIntegerDisplayConverter, DefaultLongDisplayConverter, DefaultShortDisplayConverter

public abstract class NumericDisplayConverter
extends DisplayConverter

Converts the display value to a double and vice versa.


Field Summary
protected  NumberFormat nf
           
 
Constructor Summary
NumericDisplayConverter()
           
 
Method Summary
 Object canonicalToDisplayValue(Object canonicalValue)
          Convert backing data value to value to be displayed Typically converted to a String for display.
protected abstract  Object convertToNumericValue(String value)
           
 Object displayToCanonicalValue(Object displayValue)
          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
 NumberFormat getNumberFormat()
           
 void setNumberFormat(NumberFormat nf)
           
 
Methods inherited from class org.eclipse.nebula.widgets.nattable.data.convert.DisplayConverter
canonicalToDisplayValue, displayToCanonicalValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nf

protected NumberFormat nf
Constructor Detail

NumericDisplayConverter

public NumericDisplayConverter()
Method Detail

canonicalToDisplayValue

public Object canonicalToDisplayValue(Object canonicalValue)
Description copied from interface: IDisplayConverter
Convert backing data value to value to be displayed Typically converted to a String for display.

Specified by:
canonicalToDisplayValue in interface IDisplayConverter
Specified by:
canonicalToDisplayValue in class DisplayConverter

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

convertToNumericValue

protected abstract Object convertToNumericValue(String value)

getNumberFormat

public NumberFormat getNumberFormat()
Returns:
The NumberFormat that is used to format numeric values.

setNumberFormat

public void setNumberFormat(NumberFormat nf)
Parameters:
nf - The NumberFormat that should be used to format numeric values.


Copyright © 2015. All rights reserved.