Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » ImageComboBox
ImageComboBox [message #1232241] Thu, 16 January 2014 13:54 Go to next message
Leo Pap is currently offline Leo PapFriend
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 14:28 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
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 14:49 Go to previous messageGo to next message
Leo Pap is currently offline Leo PapFriend
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 11:42 Go to previous messageGo to next message
Leo Pap is currently offline Leo PapFriend
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 12:16 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
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 12:32 Go to previous messageGo to next message
Leo Pap is currently offline Leo PapFriend
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 12:36 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
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 12:42 Go to previous message
Leo Pap is currently offline Leo PapFriend
Messages: 25
Registered: October 2013
Junior Member
Oh my god... I haven't thought about CellPainter... Embarrassed
Previous Topic:ComboBoxCellEditor -> NatCombo
Next Topic:ComboBoxCellEditor List (Selection)
Goto Forum:
  


Current Time: Fri Mar 29 06:51:24 GMT 2024

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

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

Back to the top