use of org.bndtools.utils.jface.StrikeoutStyler in project bndtools by bndtools.
the class PluginDeclarationLabelProvider method update.
@Override
public void update(ViewerCell cell) {
IConfigurationElement element = (IConfigurationElement) cell.getElement();
boolean deprecated = element.getAttribute("deprecated") != null;
Styler mainStyler = deprecated ? new StrikeoutStyler(null) : null;
StyledString label = new StyledString(element.getAttribute("name"), mainStyler);
Styler classStyle = deprecated ? new StrikeoutStyler(StyledString.QUALIFIER_STYLER) : StyledString.QUALIFIER_STYLER;
label.append(" [" + element.getAttribute("class") + "]", classStyle);
cell.setText(label.toString());
cell.setStyleRanges(label.getStyleRanges());
String iconPath = element.getAttribute("icon");
if (iconPath != null) {
ImageDescriptor descriptor = AbstractUIPlugin.imageDescriptorFromPlugin(element.getContributor().getName(), iconPath);
if (descriptor != null) {
Image image = descriptor.createImage();
images.add(image);
cell.setImage(image);
}
}
}
Aggregations