EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.sensorframework.visualisation.dialogs]

COVERAGE SUMMARY FOR SOURCE FILE [SensorsDialogLabelProvider.java]

nameclass, %method, %block, %line, %
SensorsDialogLabelProvider.java0%   (0/1)0%   (0/8)0%   (0/56)0%   (0/21)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class SensorsDialogLabelProvider0%   (0/1)0%   (0/8)0%   (0/56)0%   (0/21)
SensorsDialogLabelProvider (ConfigEntry): void 0%   (0/1)0%   (0/6)0%   (0/3)
addListener (ILabelProviderListener): void 0%   (0/1)0%   (0/1)0%   (0/1)
dispose (): void 0%   (0/1)0%   (0/1)0%   (0/1)
getColumnImage (Object, int): Image 0%   (0/1)0%   (0/12)0%   (0/3)
getColumnText (Object, int): String 0%   (0/1)0%   (0/23)0%   (0/9)
getImage (boolean): Image 0%   (0/1)0%   (0/10)0%   (0/2)
isLabelProperty (Object, String): boolean 0%   (0/1)0%   (0/2)0%   (0/1)
removeListener (ILabelProviderListener): void 0%   (0/1)0%   (0/1)0%   (0/1)

1/**
2 * 
3 */
4package de.uka.ipd.sdq.sensorframework.visualisation.dialogs;
5 
6import org.eclipse.jface.viewers.ILabelProviderListener;
7import org.eclipse.jface.viewers.ITableLabelProvider;
8import org.eclipse.swt.graphics.Image;
9 
10import de.uka.ipd.sdq.sensorframework.entities.Sensor;
11import de.uka.ipd.sdq.sensorframework.visualisation.VisualisationImages;
12import de.uka.ipd.sdq.sensorframework.visualisation.editor.ConfigEntry;
13 
14/**
15 * @author admin
16 *
17 */
18public class SensorsDialogLabelProvider implements ITableLabelProvider {
19        
20        
21        private ConfigEntry entry ;
22 
23        /**
24         * @param entry
25         */
26        public SensorsDialogLabelProvider(ConfigEntry entry) {
27                this.entry = entry;
28        }
29 
30        /* (non-Javadoc)
31         * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
32         */
33        public Image getColumnImage(Object element, int columnIndex) {
34                return (columnIndex == 0) ?   // COMPLETED_COLUMN?
35                                getImage(entry.isSensorChecked((Sensor) element)) :
36                                null;
37        }
38 
39        /* (non-Javadoc)
40         * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
41         */
42        public String getColumnText(Object element, int columnIndex) {
43                String result = "";
44                
45                Sensor sensor = (Sensor) element;
46 
47                switch (columnIndex) {
48                case SensorsDialog.CHECK_COLUMN_INDEX:
49                        break;
50                case SensorsDialog.SENSOR_ID_INDEX:
51                        // TODO
52                        result = "" + sensor.getSensorID();
53                        break;
54                case SensorsDialog.SENSOR_NAME_COLUMN_INDEX:
55                        result = sensor.getSensorName();
56                        break;
57                default:
58                        break;
59                }
60                return result;
61        }
62 
63        
64        /**
65         * Returns the image with the given key, or <code>null</code> if not found.
66         */
67        private Image getImage(boolean isSelected) {
68                String key = isSelected ? VisualisationImages.CHECKED_IMAGE : VisualisationImages.UNCHECKED_IMAGE;
69                return  VisualisationImages.imageRegistry.get(key);
70        }
71        
72        /* (non-Javadoc)
73         * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)
74         */
75        public void addListener(ILabelProviderListener listener) {
76                // TODO Auto-generated method stub
77 
78        }
79 
80        /* (non-Javadoc)
81         * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
82         */
83        public void dispose() {
84                // TODO Auto-generated method stub
85 
86        }
87 
88        /* (non-Javadoc)
89         * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String)
90         */
91        public boolean isLabelProperty(Object element, String property) {
92                // TODO Auto-generated method stub
93                return false;
94        }
95 
96        /* (non-Javadoc)
97         * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener)
98         */
99        public void removeListener(ILabelProviderListener listener) {
100                // TODO Auto-generated method stub
101 
102        }
103 
104}

[all classes][de.uka.ipd.sdq.sensorframework.visualisation.dialogs]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov