Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » [ComboViewer]Cannot get the add image for one item when using ComboViewer(getImage() in LabelProvider cannot worked as expected.)
[ComboViewer]Cannot get the add image for one item when using ComboViewer [message #1758164] Fri, 24 March 2017 08:16 Go to next message
Devin Xin is currently offline Devin XinFriend
Messages: 15
Registered: March 2017
Junior Member

Hi All,

When I use ComboViewer composite in my project, I need to add one image for one certain item in the list, then I set related LabelProvider to the ComboViewer like below:
ComboViewer inforViewer = new ComboViewer(diagramCom0, SWT.DROP_DOWN | SWT.BORDER);
inforViewer.setLabelProvider(new MyLabelProvider());
inforViewer.setContentProvider(new ArrayContentProvider());
inforViewer.setInput(inforList);

The related code in class MyLabelProvider please see below:

public Image getImage(Object element) {
//return one image to use
}

But when I did one debug the code, I find the getImage() methond is never called by any client, why?
Am I wrong or this is one bug? or ComboViewer is not supported to do this thing?

Thanks for your time.
Best Regards,
Devin
Re: [ComboViewer]Cannot get the add image for one item when using ComboViewer [message #1758209 is a reply to message #1758164] Fri, 24 March 2017 16:48 Go to previous messageGo to next message
Eclipse UserFriend
Looks like only Tables and Trees support decorating with images.
Re: [ComboViewer]Cannot get the add image for one item when using ComboViewer [message #1758279 is a reply to message #1758209] Mon, 27 March 2017 03:16 Go to previous message
Devin Xin is currently offline Devin XinFriend
Messages: 15
Registered: March 2017
Junior Member

Hi Brian,
Thanks very much for your replay.

I also checked the sorce code of ComboViewer, you are right, for ComboViewer, there is no ability to decorate with images.

Best Regards,
Devin
Previous Topic:How do I update a column label provider when using ObservableValueEditingSupport? [SOLVED]
Next Topic:Need ComboBoxCellEditor drop down multi selection functionality in SWT
Goto Forum:
  


Current Time: Tue Apr 16 20:34:47 GMT 2024

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

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

Back to the top