gameTableViewer.setLabelProvider(new ITableLabelProvider() {
public Image getColumnImage(Object element, int columnIndex) {
if (element instanceof IGameDescriptor) {
IGameDescriptor game = (IGameDescriptor) element;
switch(columnIndex) {
case 0:
ImageDescriptor gd = game.getIconDescriptor();
if (gd != null) {
return gd.createImage();
}
return null;
}
}
return null;
}
public String getColumnText(Object element, int columnIndex) {
if (element instanceof IGameDescriptor) {
IGameDescriptor game = (IGameDescriptor) element;
switch(columnIndex) {
case 0:
return game.getName();
}
}
return null;
}