01: /**
02: *
03: */package gui.section;
04:
05: import org.eclipse.jface.viewers.ITableLabelProvider;
06: import org.eclipse.jface.viewers.LabelProvider;
07: import org.eclipse.swt.graphics.Image;
08:
09: import diagram.section.EnvEntry;
10:
11: /**
12: * @author sh
13: *
14: */
15: public class EnvEntriesLabelProvider extends LabelProvider implements
16: ITableLabelProvider {
17:
18: public Image getColumnImage(Object element, int columnIndex) {
19: return null;
20: }
21:
22: /* (non-Javadoc)
23: * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
24: */
25: public String getColumnText(Object element, int columnIndex) {
26: String result = "";
27: EnvEntry envEntry = (EnvEntry) element;
28: switch (columnIndex) {
29: case 0:
30: result = envEntry.getName(); // ENV_ENTRY_NAME_COLUMN
31: break;
32: case 1:
33: result = envEntry.getType(); // "ENV_ENTRY_TYPE_COLUMN"
34: break;
35: case 2:
36: result = envEntry.getValue(); // "ENV_ENTRY_VALUE_COLUMN"
37: break;
38: default:
39: break;
40: }
41: return result;
42: }
43: }
|