Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7756385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T12:48:32+00:00 2026-06-01T12:48:32+00:00

I want to add images to the items in a list in Eclipse RCP.

  • 0

I want to add images to the items in a list in Eclipse RCP. I provide a custom LabelProvider which looks like:

package com.puresol;

import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;

public class MyListLabelProvider extends LabelProvider {

    private final Image folderImage = PlatformUI.getWorkbench()
        .getSharedImages().getImage(ISharedImages.IMG_OBJ_FOLDER);

    @Override
    public void dispose() {
        folderImage.dispose();
    }

    @Override
    public String getText(Object element) {
        return element.toString();
    }

    @Override
        public Image getImage(Object element) {
        return folderImage;
    }
}

I add this label provider by:

listViewer.setLabelProvider(new MyListLabelProvider());

I do get the correct text, but no image. I am sure my label provider is used due to debugging the code and I can change the provided label text, too. I only do not see an image. The image is loaded and non-null.

What do I need to switch on to get the label shown? What do I miss here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T12:48:34+00:00Added an answer on June 1, 2026 at 12:48 pm

    I am not sure the ListViewer is capable of displaying images. Try to switch to a single-column TableViewer and see if that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a list containing list items which appear like a row in a
i want to add images or labels with image in it to a panel
I am using iCarousel as shownh here .But I want to add images dynamically
I want to know how to add images while exporting the image from highcharts.
I have 3 images that I want to add one after other on a
After ul tag i want to call function in javascript to add list item
We have an asp.NET page which is programmaticaly adding data as new list items
I have an empty unordered list in my design. Now I want to add
I want to add images to my item using POCO approach. In order for
I want to build a List of images from a website link and then

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.