Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Display values in GroupBy tree nodes
Display values in GroupBy tree nodes [message #1065460] Tue, 25 June 2013 15:03 Go to next message
Patrick Rusk is currently offline Patrick Rusk
Messages: 35
Registered: June 2012
Member
I have some columns in my grids where we display a nice description, rather than the "canonical" code or number in the column. However, when I group by (in the meaning of the "Group by" example) those columns, the tree nodes that result show the canonical number/code. It seems to me that they should show the displayed values, instead.

The canonical value is shown because GroupByTreeFormat is instantiated by only passing in the IColumnAccessor for the grid. Something rather more GUI-ish would have to be passed in to get the displayed values. Technically, the display converters are gotten from the config registry based upon display modes and labels, so it gets quite involved.

In our setup, we have a slightly abominable way that we can hack this in to get what we want. Smile But, I wanted to open a discussion to see whether others think this should be done in a more official way.
Re: Display values in GroupBy tree nodes [message #1065477 is a reply to message #1065460] Tue, 25 June 2013 17:10 Go to previous message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1067
Registered: July 2012
Senior Member
Well the issue is the generic approach for group by. Technically the values that are displayed then are not of your object type, but of type GroupByObject. I started looking into this when I created the _5832_GroupByCustomTypesExample which is currently only available in the repository and not yet released with the examples.

I wasn't able to solve that issue in general easily. It is not that simple to get the display converter, as the GroupByObject is not aware of the cells that are used to group by. I guess a bigger refactoring of the whole group by solution would be necessary as it is not a trivial task.

In the example I helped myself by adding a toString() method that technically does the same as the IDisplayConverter.canonicalToDisplayValue()
Previous Topic:Eclipse 3.7 with NatTable 0.9 to Eclipse 4.2 with Nattable 1.0.0
Next Topic:Disabling sorting on selected columns
Goto Forum:
  


Current Time: Fri Apr 25 02:50:41 EDT 2014

Powered by FUDForum. Page generated in 0.01698 seconds