eclipse-nattable / nattable

High performance SWT data grid
https://eclipse.dev/nattable/
Eclipse Public License 2.0
11 stars 6 forks source link

Extend PercentageBarDecorator to be able to override getting the data #59

Closed fipro78 closed 4 months ago

fipro78 commented 4 months ago

Currently the PercentageBarDecorator assumes that the cell data is of type Number. If that is not the case, a class cast exception is thrown.

There might be situations where the data type is a String and needs a special conversion. As this interferes with the default converter mechanism, the easiest way for customization is to add a convertDataType() method, similar to the CheckBoxPainter. As a difference, it is not possible to use the registered display converter, as the value that is shown on top of the percentage bar needs to be still a String.

fipro78 commented 4 months ago

Verified by user