}
@Override
public void update(ViewerCell cell) {
Image icon = defaultImg;
ImageDescriptor iconDescriptor;
Object data = cell.getElement();
if (data instanceof ConfigurationElementCategory) {
ConfigurationElementCategory category = (ConfigurationElementCategory) data;
cell.setText(category.toString());
iconDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(Plugin.PLUGIN_ID, "icons/fldr_obj.gif");
} else if (data instanceof IConfigurationElement) {
IConfigurationElement element = (IConfigurationElement) data;
cell.setText(element.getAttribute("name"));
String iconPath = element.getAttribute("icon");
if (iconPath != null)
iconDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(element.getContributor().getName(), iconPath);
else
iconDescriptor = null;
} else {
cell.setText("<<ERROR>>");
iconDescriptor = null;
}
if (iconDescriptor != null) {
icon = imgCache.get(iconDescriptor);
if (icon == null) {
icon = iconDescriptor.createImage(device);
imgCache.put(iconDescriptor, icon);
}
}
if (icon != null)