Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » FilterRowDataProvider - define custom display converter(FilterRowDataProvider - define custom display converter)
FilterRowDataProvider - define custom display converter [message #1722953] Wed, 10 February 2016 13:28 Go to next message
Juraj Lodnan is currently offline Juraj LodnanFriend
Messages: 3
Registered: February 2016
Junior Member
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 #1722956 is a reply to message #1722953] Wed, 10 February 2016 14:19 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
I'm not sure if I understand your requirement. Have you looked at _6032_GlazedListsFilterCustomTypesExample?
Re: FilterRowDataProvider - define custom display converter [message #1722965 is a reply to message #1722956] Wed, 10 February 2016 15:22 Go to previous messageGo to next message
Juraj Lodnan is currently offline Juraj LodnanFriend
Messages: 3
Registered: February 2016
Junior Member
Yes, I have seen that example. Not helpful Sad

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
Re: FilterRowDataProvider - define custom display converter [message #1722975 is a reply to message #1722965] Wed, 10 February 2016 15:48 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
I would need to investigate on this further. But this may take some time to do it right. There might be a lot of implications that need to be considered.

But currently I don't have much time.
Previous Topic:Extra horizontal lines appear when we resize column header by drag
Next Topic:How to create auto suggestive Combobox
Goto Forum:
  


Current Time: Thu Apr 25 06:49:50 GMT 2024

Powered by FUDForum. Page generated in 0.03253 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top