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 21:38 Go to next message
Evan O\'Connell is currently offline Evan O\'ConnellFriend
Messages: 10
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 13:00 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 1407
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 20:55 Go to previous messageGo to next message
Alexandre Pauzies is currently offline Alexandre PauziesFriend
Messages: 3
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 21:09 Go to previous messageGo to next message
Alexandre Pauzies is currently offline Alexandre PauziesFriend
Messages: 3
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
Re: Tree level summary rows [message #1148008 is a reply to message #1096773] Mon, 21 October 2013 07:38 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 1407
Registered: July 2012
Senior Member
I just commented on your pull request.

In short, nice addition but needs some modifications ito fit into the NatTable concepts. Smile
Re: Tree level summary rows [message #1170802 is a reply to message #1148008] Mon, 04 November 2013 22:14 Go to previous message
Alexandre Pauzies is currently offline Alexandre PauziesFriend
Messages: 3
Registered: July 2009
Junior Member
Thanks, I'll make the changes when I get a chance.

Alex
Previous Topic:disable editing and context menu in nattable
Next Topic:Styling based on combination of labels
Goto Forum:
  


Current Time: Wed Nov 26 08:18:17 GMT 2014

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

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