01: package fr.aliacom.common.ui.table;
02:
03: import fr.aliacom.common.ui.IconFactory;
04:
05: /**
06: * @author tom
07: *
08: * (C) 2001, 2003 Thomas Cataldo
09: */
10: public final class LabelRenderer implements ICellRenderer {
11:
12: private ILabelProvider provider;
13:
14: public LabelRenderer(ILabelProvider provider) {
15: this .provider = provider;
16: }
17:
18: /**
19: * @see fr.aliacom.common.ui.table.ICellRenderer#render(Object, Object, ICell)
20: */
21: public void render(Object value, Object javaBean, ICell cell) {
22: String icon = provider.getIconName(value, javaBean);
23: if (icon != null) {
24: cell.setIcon(IconFactory.get(icon));
25: }
26: cell.setText(provider.getText(value, javaBean));
27: }
28:
29: }
|