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

COVERAGE SUMMARY FOR SOURCE FILE [EventTypesTabItemProvider.java]

nameclass, %method, %block, %line, %
EventTypesTabItemProvider.java0%   (0/1)0%   (0/3)0%   (0/68)0%   (0/27)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class EventTypesTabItemProvider0%   (0/1)0%   (0/3)0%   (0/68)0%   (0/27)
EventTypesTabItemProvider (AdapterFactory): void 0%   (0/1)0%   (0/4)0%   (0/2)
getColumnImage (Object, int): Object 0%   (0/1)0%   (0/8)0%   (0/3)
getColumnText (Object, int): String 0%   (0/1)0%   (0/56)0%   (0/22)

1package de.uka.ipd.sdq.pcmbench.tabs.operations;
2 
3import org.eclipse.emf.common.notify.AdapterFactory;
4import org.eclipse.emf.edit.provider.IItemLabelProvider;
5import org.eclipse.emf.edit.provider.ITableItemLabelProvider;
6import org.eclipse.emf.edit.provider.ItemProviderDecorator;
7 
8import de.uka.ipd.sdq.pcm.repository.EventType;
9 
10/**
11 * This class is a decorator for the generated EMF.Edit item providers. It
12 * provides item providers which are used in the event types tab of the tabbed
13 * properties sheet when editing event groups. It implements
14 * ITableItemLabelProvider to display the given EObject in a tabular form.
15 * Additionally it provided the labels by practical delegation to the original
16 * IItemLabelProvider.
17 * 
18 * The OperationsTabItemProvider was used as template for this class.
19 * 
20 * @author Benjamin Klatt
21 */
22public class EventTypesTabItemProvider extends ItemProviderDecorator implements
23                ITableItemLabelProvider, IItemLabelProvider {
24 
25        /**
26         * Inherited default constructor
27         * 
28         * @param factory
29         *            The factory which created this object
30         */
31        public EventTypesTabItemProvider(AdapterFactory factory) {
32                super(factory);
33        }
34 
35        /* (non-Javadoc)
36         * @see org.eclipse.emf.edit.provider.ItemProviderDecorator#getColumnImage(java.lang.Object,
37         *      int)
38         */
39        @Override
40        public Object getColumnImage(Object object, int columnIndex) {
41                if (columnIndex == EventTypesEditorSection.ICON_COLUMN_INDEX)
42                        return this.getImage(object);
43                return null;
44        }
45 
46        /**
47         * Format the columns with the given index constant as string text for displaying.
48         *      
49         * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object,
50         *      int) 
51         */
52        @Override
53        public String getColumnText(Object element, int columnIndex) {
54                String result = "";
55                EventType eventType = (EventType) element;
56                ParameterRepresentation parser = new ParameterRepresentation();
57 
58                switch (columnIndex) {
59                case EventTypesEditorSection.ICON_COLUMN_INDEX:
60                        break;
61                case EventTypesEditorSection.EVENTTYPENAME_COLUMN_INDEX:
62                        result = eventType.getEntityName();
63                        break;
64                case EventTypesEditorSection.PARAMETER_NAME_COLUMN_INDEX:
65                        if(eventType != null &&
66                                        eventType.getParameter__EventType() != null &&
67                                        eventType.getParameter__EventType().getParameterName() != null){
68                                result = eventType.getParameter__EventType().getParameterName();
69                        } else {
70                                result = "";
71                        }
72                        break;
73                case EventTypesEditorSection.PARAMETER_TYPE_COLUMN_INDEX:
74                        if(eventType != null &&
75                                        eventType.getParameter__EventType() != null &&
76                                        eventType.getParameter__EventType().getDataType__Parameter() != null){
77                                result = parser.setDataTypeToString(eventType
78                                                                                                .getParameter__EventType()
79                                                                                                .getDataType__Parameter());
80                        } else {
81                                result = "";
82                        }
83                        break;
84                default:
85                        break;
86                }
87                return parser.isNotNull(result);
88        }
89}

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