Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » how to display text and image in JFace/SWT combo box.
how to display text and image in JFace/SWT combo box. [message #323801] Wed, 09 January 2008 00:44 Go to next message
Eclipse UserFriend
Originally posted by: neeru.singhal.headstrong.com

Hello,

I need to display text and image of the items shown in the JFace/SWT combo box.

I tried using ComboViewer org.eclipse.jface.viewers.ComboViewer) and provided a content and labelprovider for it. The issue is that the LabelProvider's getText() method gets invoked and is displaying the correct text but the method getImage() is not getting invoked at all.

And thus the UI is just displaying the text of the items and not the image.

Is this some bug in ComboViewer implementation?
Also is there any alternative to display image and text of items in combobox or listviewer?

Thanks
Re: how to display text and image in JFace/SWT combo box. [message #323804 is a reply to message #323801] Wed, 09 January 2008 02:48 Go to previous message
Eclipse UserFriend
neeru singhal schrieb:
> Hello,
>
> I need to display text and image of the items shown in the JFace/SWT combo box.
>
> I tried using ComboViewer org.eclipse.jface.viewers.ComboViewer) and provided a content and labelprovider for it. The issue is that the LabelProvider's getText() method gets invoked and is displaying the correct text but the method getImage() is not getting invoked at all.
>
> And thus the UI is just displaying the text of the items and not the image.
>
> Is this some bug in ComboViewer implementation?

No SWT-Combo don't support images.

> Also is there any alternative to display image and text of items in combobox or listviewer?
>

Yes. See
http://www.richclient2.eu/2006_03_03/enhancing-the-combo-wid get-with-images/
although you'll need to write your own viewer code.

Tom

--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Previous Topic:IWorkbenchPage.getAggregateWorkingSet() has no visibility into JDT's WorkingSetModel.getAllWorkingSe
Next Topic:Adding custom problem markers to custom View
Goto Forum:
  


Current Time: Sun Jul 13 13:51:44 EDT 2025

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

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

Back to the top