Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » ImageComboBox
ImageComboBox [message #1232241] Thu, 16 January 2014 08:54 Go to next message
Leo Pap is currently offline Leo Pap
Messages: 25
Registered: October 2013
Junior Member
Hi,

I have again one question... Is it possible to fill an CellComboBox with images/icons? If so, is there (or can someine give me) any example how to do this?

Thanks in advance.
Re: ImageComboBox [message #1232255 is a reply to message #1232241] Thu, 16 January 2014 09:28 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1208
Registered: July 2012
Senior Member
No, we do not support this out of the box.

Technically the ComboBoxCellEditor uses our custom NatCombo as combo box control. This is internally creating a Table in the dropdown.

So to achieve your requirement you could

1. Create a custom NatCombo that extends the NatTable one and override setItems(String[]) -> this is the place the table items are created
2. Create a custom ComboBoxCellEditor that extends the NatTable one and override createEditorControl(Composite) to return your custom NatCombo

This way you should be able to create a combo box editor that shows icons.
Re: ImageComboBox [message #1232264 is a reply to message #1232255] Thu, 16 January 2014 09:49 Go to previous messageGo to next message
Leo Pap is currently offline Leo Pap
Messages: 25
Registered: October 2013
Junior Member
Thank you! I will try it...
Re: ImageComboBox [message #1232636 is a reply to message #1232264] Fri, 17 January 2014 06:42 Go to previous messageGo to next message
Leo Pap is currently offline Leo Pap
Messages: 25
Registered: October 2013
Junior Member
Hi Dirk,

it works! The problem that I have is, that in the dropdownlist the icons are shown, but when i select one, then the text is shown and not the icon. Could you please say to me, which method is responsible for shown selected text?
Re: ImageComboBox [message #1232646 is a reply to message #1232636] Fri, 17 January 2014 07:16 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1208
Registered: July 2012
Senior Member
Where is the text shown? In the NatCombo or the NatTable cell?
Re: ImageComboBox [message #1232653 is a reply to message #1232646] Fri, 17 January 2014 07:32 Go to previous messageGo to next message
Leo Pap is currently offline Leo Pap
Messages: 25
Registered: October 2013
Junior Member
int the NatTable cell
Re: ImageComboBox [message #1232655 is a reply to message #1232653] Fri, 17 January 2014 07:36 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk Fauth
Messages: 1208
Registered: July 2012
Senior Member
Well, for rendering cells in NatTable you need to register another ICellPainter as explained here: http://eclipse.org/nattable/documentation.php?page=styling
Re: ImageComboBox [message #1232657 is a reply to message #1232655] Fri, 17 January 2014 07:42 Go to previous message
Leo Pap is currently offline Leo Pap
Messages: 25
Registered: October 2013
Junior Member
Oh my god... I haven't thought about CellPainter... Embarrassed
Previous Topic:ComboBoxCellEditor List (Selection)
Next Topic:grid scrollbar issue
Goto Forum:
  


Current Time: Thu Jul 24 00:22:27 EDT 2014

Powered by FUDForum. Page generated in 0.02205 seconds