FilterRowDataProvider - define custom display converter [message #1722953] |
Wed, 10 February 2016 08:28  |
Eclipse User |
|
|
|
Hi,
is there any way how to define custom display converter inside FilterRowDataProvider class that is used in saveState() and loadState()?
Problem:
I have display converter defined to config label FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + columnIndex. This converter is used to convert values in combobox filter column.
Same converter is used to save/load filter settings to a file. Problem is that there is displayValue persisted in a file and I need to store canonicalValue(because of translation problem).
Only way how to achieve the target is to define custom classes of FilterRowDataLayer, FilterRowDataProvider, FilterRowHeaderComposite classes and then override saveState() and loadState() logic.
I must override 3 classes, because of they are created in the constructors and there is no setter to set custom data layer to composite and custom data provider to data layer.
|
|
|
|
Re: FilterRowDataProvider - define custom display converter [message #1722965 is a reply to message #1722956] |
Wed, 10 February 2016 10:22   |
Eclipse User |
|
|
|
Yes, I have seen that example. Not helpful 
In combo I have display values - Strings: Family, Sport, Luxury ... for EN language, for DE language are different labels etc.
Canonical values to display values: CFAM, CSPO, CLUX ... values of Enum called CarTypes
Stored value in a file via FilterRowDataProvider.saveState() is display value.
Loaded value is display value and has to be converted do canonical value - this is the problem - how to map "Family" translated string to corresponding "CFAM" enum value? Or "Familie" to "CFAM" for DE language.
+ I do not know that string value "Family" is related to Enum CarTypes
Solution would be not to store display value, but canonical value. To do this, custom display converter would be needed to be set in FilterRowDataProvider.
For persisting state I need different display converter than display converter registered to show values in ComboBox filter column.
In other words, problem is: Store canonical value instead of display value in a file. Reason: too complicated/impossible to do displayToCanonicalValue conversion.
Ideal state:
- define custom display converter in FilterRowDataProvider to save/load state, not default FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + columnIndex one
|
|
|
|
Powered by
FUDForum. Page generated in 0.05843 seconds