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

COVERAGE SUMMARY FOR SOURCE FILE [SensorsTabLabelProvider.java]

nameclass, %method, %block, %line, %
SensorsTabLabelProvider.java0%   (0/1)0%   (0/9)0%   (0/88)0%   (0/27)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class SensorsTabLabelProvider0%   (0/1)0%   (0/9)0%   (0/88)0%   (0/27)
SensorsTabLabelProvider (): void 0%   (0/1)0%   (0/3)0%   (0/1)
addListener (ILabelProviderListener): void 0%   (0/1)0%   (0/1)0%   (0/1)
deleteComma (String): String 0%   (0/1)0%   (0/14)0%   (0/3)
dispose (): void 0%   (0/1)0%   (0/1)0%   (0/1)
getColumnImage (Object, int): Image 0%   (0/1)0%   (0/8)0%   (0/3)
getColumnText (Object, int): String 0%   (0/1)0%   (0/26)0%   (0/11)
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)
setSenssorsArrayToString (ConfigEntry): String 0%   (0/1)0%   (0/32)0%   (0/5)

1/**
2 * 
3 */
4package de.uka.ipd.sdq.sensorframework.visualisation.tabs.sensors;
5 
6import java.util.Collection;
7 
8import org.eclipse.jface.viewers.ILabelProviderListener;
9import org.eclipse.jface.viewers.ITableLabelProvider;
10import org.eclipse.swt.graphics.Image;
11 
12import de.uka.ipd.sdq.sensorframework.entities.Sensor;
13import de.uka.ipd.sdq.sensorframework.visualisation.VisualisationImages;
14import de.uka.ipd.sdq.sensorframework.visualisation.editor.ConfigEntry;
15 
16/**
17 * @author admin
18 *
19 */
20public class SensorsTabLabelProvider implements ITableLabelProvider {
21        
22        /* (non-Javadoc)
23         * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
24         */
25        public Image getColumnImage(Object element, int columnIndex) {
26                if (columnIndex == SensorsPropertySection.ICON_COLUMN_INDEX)
27                        return VisualisationImages.imageRegistry.get(VisualisationImages.RUN);
28                return null;
29        }
30 
31        /* (non-Javadoc)
32         * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
33         */
34        public String getColumnText(Object element, int columnIndex) {
35                        String result = "";
36                
37                        ConfigEntry entry = (ConfigEntry) element;
38 
39                        switch (columnIndex) {
40                        case SensorsPropertySection.ICON_COLUMN_INDEX:
41                                break;
42                        case SensorsPropertySection.CONTEXT_COLUMN_INDEX:
43                                result = entry.getExperimentRun().getClass().getSimpleName();
44                                break;
45                        case SensorsPropertySection.RUN_COLUMN_INDEX:
46                                result = entry.getExperimentRun().getExperimentDateTime();
47                                break;
48                        case SensorsPropertySection.SENSORS_COLUMN_INDEX:
49                                result = setSenssorsArrayToString(entry);
50                                break;
51                        default:
52                                break;
53                        }
54                        return result;
55        }
56 
57        
58        private String setSenssorsArrayToString(ConfigEntry entry){
59                String result = "";
60                Collection<Sensor> sensors=  entry.getSensors();
61                
62                for(Sensor s: sensors){
63                        result = result + s.getSensorName() + ", ";
64                }
65                return deleteComma(result);
66        }
67        
68        /**
69         * Comma of the sentence deletes ends
70         */
71        public String deleteComma(String result) {
72                if (!result.equals("")) {
73                        result = result.substring(0, result.length() - 2);
74                }
75                return result;
76        }
77        
78        /* (non-Javadoc)
79         * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)
80         */
81        public void addListener(ILabelProviderListener listener) {
82                // TODO Auto-generated method stub
83 
84        }
85 
86        /* (non-Javadoc)
87         * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
88         */
89        public void dispose() {
90                // TODO Auto-generated method stub
91 
92        }
93 
94        /* (non-Javadoc)
95         * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String)
96         */
97        public boolean isLabelProperty(Object element, String property) {
98                // TODO Auto-generated method stub
99                return false;
100        }
101 
102        /* (non-Javadoc)
103         * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener)
104         */
105        public void removeListener(ILabelProviderListener listener) {
106                // TODO Auto-generated method stub
107 
108        }
109 
110}

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