use of org.erlide.cover.views.model.ObjectType in project erlide_eclipse by erlang.
the class StatsViewLabelProvider method getColumnImage.
@Override
public Image getColumnImage(final Object element, final int columnIndex) {
Image img = null;
final ICoverageObject statsEl = (ICoverageObject) element;
switch(columnIndex) {
case 0:
final ObjectType type = statsEl.getType();
switch(type) {
case FUNCTION:
img = Activator.getImageDescriptor(Images.FUNCTION).createImage();
break;
case MODULE:
IErlModule m;
try {
m = ErlangEngine.getInstance().getModel().findModule(statsEl.getLabel());
} catch (final ErlModelException e) {
ErlLogger.error(e);
return null;
}
img = ErlangElementImageProvider.getErlImageDescriptor(m, ErlangElementImageProvider.SMALL_ICONS).createImage();
break;
case FOLDER:
img = PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_OBJ_FOLDER).createImage();
break;
case PROJECT:
img = PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(IDE.SharedImages.IMG_OBJ_PROJECT).createImage();
break;
default:
break;
}
break;
case 3:
img = drawPercentage(statsEl.getPercentage());
break;
default:
}
return img;
}
Aggregations