1 | /** |
2 | * |
3 | */ |
4 | package de.uka.ipd.sdq.sensorframework.visualisation.tabs.sensors; |
5 | |
6 | import java.util.Arrays; |
7 | import java.util.List; |
8 | |
9 | import org.eclipse.jface.viewers.ICellModifier; |
10 | |
11 | /** |
12 | * @author admin |
13 | * |
14 | */ |
15 | public class SensorsTabCellModifier implements ICellModifier { |
16 | |
17 | private List<String> columnNames; |
18 | |
19 | public SensorsTabCellModifier() { |
20 | this.columnNames = Arrays.asList(SensorsPropertySection |
21 | .columnNames); |
22 | } |
23 | |
24 | /* (non-Javadoc) |
25 | * @see org.eclipse.jface.viewers.ICellModifier#canModify(java.lang.Object, java.lang.String) |
26 | */ |
27 | public boolean canModify(Object element, String property) { |
28 | return true; |
29 | } |
30 | |
31 | /* (non-Javadoc) |
32 | * @see org.eclipse.jface.viewers.ICellModifier#getValue(java.lang.Object, java.lang.String) |
33 | */ |
34 | public Object getValue(Object element, String property) { |
35 | return (new SensorsTabLabelProvider()).getColumnText(element, |
36 | columnNames.indexOf(property)); |
37 | } |
38 | |
39 | /* (non-Javadoc) |
40 | * @see org.eclipse.jface.viewers.ICellModifier#modify(java.lang.Object, java.lang.String, java.lang.Object) |
41 | */ |
42 | public void modify(Object element, String property, Object value) { |
43 | // The implementation is not necessary. |
44 | } |
45 | |
46 | } |