Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Tree level summary rows
Tree level summary rows [message #1088281] Fri, 16 August 2013 17:38 Go to next message
Evan O\'Connell is currently offline Evan O\'Connell
Messages: 1
Registered: August 2013
Junior Member
Hi all,

I'm looking for a way to implement tree level summary rows in NatTable. The tree layer works great for grouping data but I think it would be beneficial if it was able to "roll up" columns in the group to the group heading row. This would allow users to, at a glance, view the contents of the group when it is collapsed and compare them to other groups.

Currently the tree layer looks like this in NatTable:

<i45.photobucket.com/albums/f82/lefteye89/tree-norm_zps24b06870.gif>

I mocked up how I imagine it working in photoshop:

<i45.photobucket.com/albums/f82/lefteye89/tree-summary_zps7f2f04d1.gif>

Questions:

Has something like this been done before?

Is it possible to do with the current version of NatTable?

Is it a feature that is planned for a future version of NatTable?

Thank you

PS: I don't have enough posts to include actual links but you should be able to open those urls in a browser.
Re: Tree level summary rows [message #1088675 is a reply to message #1088281] Sat, 17 August 2013 09:00 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk Fauth
Messages: 789
Registered: July 2012
Senior Member
Hi,

I haven't heard of such a feature before. So I guess nobody has something similar working with NatTable nor is it a planned feature.

I can't look at the code right now, but I guess technically it should be possible. NatTable shows the data values of the data model in the cells. For the rows that show the tree nodes, there should be some technical model that has no values for the other columns. You would need to tell that model element what it should contain. In your case the sum of the values in the child rows.

As I'm currently not able to have a look in the code to verify my statements, this is just an idea. But maybe it helps you to find a solution.

Greez,
Dirk
Re: Tree level summary rows [message #1090919 is a reply to message #1088675] Tue, 20 August 2013 16:55 Go to previous messageGo to next message
Alexandre Pauzies is currently offline Alexandre Pauzies
Messages: 2
Registered: July 2009
Junior Member
Hi,

I noticed that in the group heading row, your cell painters can look at the cell object for the label GROUP_BY_OBJECT, then with the help of the dataValue, you can do the sum yourself and return the proper value in TextToDisplay.

Alex
Re: Tree level summary rows [message #1096773 is a reply to message #1090919] Wed, 28 August 2013 17:09 Go to previous message
Alexandre Pauzies is currently offline Alexandre Pauzies
Messages: 2
Registered: July 2009
Junior Member
Actually, it was a bit more complicated than that Wink
I created a bug and pull request on github for this feature if you're interested:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=416095

Alex
Previous Topic:Ability to bookmark rows
Next Topic:need checkbox only when editable
Goto Forum:
  


Current Time: Mon Oct 07 21:10:58 EDT 2013

Powered by FUDForum. Page generated in 0.02299 seconds