Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » how to sort ComboBoxCellEditor in a table(how to sort ComboBoxCellEditor in a table)
how to sort ComboBoxCellEditor in a table [message #651673] Tue, 01 February 2011 03:32 Go to next message
raj is currently offline raj
Messages: 19
Registered: January 2010
Location: hyderabad
Junior Member

Hi ..

How to Sort ComboBoxCellEditor Colum in a table


Regards,
Raj
Re: how to sort ComboBoxCellEditor in a table [message #651937 is a reply to message #651673] Wed, 02 February 2011 01:51 Go to previous message
Daniel Krügler is currently offline Daniel Krügler
Messages: 853
Registered: July 2009
Senior Member
On 2011-02-01 09:32, raj wrote:
> How to Sort ComboBoxCellEditor Colum in a table

You need to sort it's items that you get via getItems().

It might be worth to add one undocumented characteristics:

ComboBoxCellEditor does not clone the items when accepting them nor does
it do so when returning them, this means you can invoke
Arrays.sort with or without your defined Comparator directly on the
return value of getItems() and invoke setItems() again which will
repopulate the CelllEditor with the sorted items.

HTH & Greetings from Bremen,

Daniel Krügler
Previous Topic:[Preferences] FieldEditor.dispose() not called by FieldEditorPreferencePage
Next Topic:TextViewer use case
Goto Forum:
  


Current Time: Tue Sep 02 05:24:53 EDT 2014

Powered by FUDForum. Page generated in 0.01586 seconds