Reputation: 1427
I have the following code to create a dialog in a RCP Eclipse application using the ElementListSelectionDialog
class:
ElementListSelectionDialog dialog = new ElementListSelectionDialog(shell, new LabelProvider());
dialog.setTitle("test");
dialog.setMessage("test");
dialog.setMultipleSelection(false);
dialog.setElements(new String[]{"test1", "test2", "test3"});
dialog.open();
The previous code generates this dialog:
This is fine but I also want to add icons to the elements in the list, similar to how it looks the web.xml
editor:
Upvotes: 0
Views: 105
Reputation: 111142
You need to extend the LabelProvider
you are passing to the ElementListSelectionDialog
constructor and override the
public Image getImage(Object element)
method. This will be called for each of the objects you add to the dialog with the setElements
method.
Upvotes: 1