Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » TableViewer: Sorting on multiple columns
TableViewer: Sorting on multiple columns [message #534627] Wed, 19 May 2010 16:43 Go to next message
Raajesh  B.Kashyap is currently offline Raajesh B.KashyapFriend
Messages: 7
Registered: July 2009
Junior Member
Is there an example of how multiple column sorting can be done on the tableviewer? I have found examples of single column sorting, but nothing related to accomplishing a multiple sort. If anyone has successfully done this, could you please share how it was done?

We have a dialog where we select the columns by which to sort. Assuming that we somehow persist / remember this information, and have access to it in the comparator implementation, I am not sure how the multi-column sort would be accomplished inside the "compare()" method.... after all, the comparator compares two objects at a time... how is it possible to sort on multiple columns in such a case? This is where I am looking for some help or a sample.


Thanks.

Re: TableViewer: Sorting on multiple columns [message #535094 is a reply to message #534627] Fri, 21 May 2010 09:48 Go to previous message
Raajesh  B.Kashyap is currently offline Raajesh B.KashyapFriend
Messages: 7
Registered: July 2009
Junior Member
I was able to implement this similar to the concept of sorting multi-dimensional arrays. So, inside the compare() method, I would look at the multiple values (corresponding to multiple columns) on the first object, and then compare each value with the same values on the other object.
Previous Topic:What's the current status of data binding radio buttons to enum?
Next Topic:cell traverse
Goto Forum:
  


Current Time: Thu Apr 25 00:41:47 GMT 2024

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

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

Back to the top