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 [OperationsTabItemProvider.java]

nameclass, %method, %block, %line, %
OperationsTabItemProvider.java0%   (0/1)0%   (0/3)0%   (0/50)0%   (0/22)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class OperationsTabItemProvider0%   (0/1)0%   (0/3)0%   (0/50)0%   (0/22)
OperationsTabItemProvider (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/38)0%   (0/17)

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.OperationSignature;
9 
10/**
11 * @author Snowball
12 * 
13 * This class is a decorator for the generated EMF.Edit item providers. It
14 * provides item providers which are used in the operations tab of the tabbed
15 * properties sheet when editing interfaces. It implements
16 * ITableItemLabelProvider to display the given EObject in a tabular form.
17 * Additionally it provided the labels by partcial delegation to the original
18 * IItemLabelProvider.
19 */
20public class OperationsTabItemProvider extends ItemProviderDecorator implements
21                ITableItemLabelProvider, IItemLabelProvider {
22 
23        /**
24         * Inherited default constructor
25         * 
26         * @param factory
27         *            The factory which created this object
28         */
29        public OperationsTabItemProvider(AdapterFactory factory) {
30                super(factory);
31        }
32 
33        /* (non-Javadoc)
34         * @see org.eclipse.emf.edit.provider.ItemProviderDecorator#getColumnImage(java.lang.Object,
35         *      int)
36         */
37        @Override
38        public Object getColumnImage(Object object, int columnIndex) {
39                if (columnIndex == OperationsEditorSection.ICON_COLUMN_INDEX)
40                        return this.getImage(object);
41                return null;
42        }
43 
44        /**
45         * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object,
46         *      int) Format the columns with the given index constant as string text
47         *      for displaying
48         */
49        @Override
50        public String getColumnText(Object element, int columnIndex) {
51                String result = "";
52                OperationSignature signature = (OperationSignature) element;
53                ParameterRepresentation parser = new ParameterRepresentation();
54 
55                switch (columnIndex) {
56                case OperationsEditorSection.ICON_COLUMN_INDEX:
57                        break;
58                case OperationsEditorSection.RETURNTYPE_COLUMN_INDEX:
59                        result = parser.setDataTypeToString(signature
60                                        .getReturnType__OperationSignature());
61                        break;
62                case OperationsEditorSection.SIGNATURENAME_COLUMN_INDEX:
63                        result = signature.getEntityName();
64                        break;
65                case OperationsEditorSection.PARAMETER_COLUMN_INDEX:
66                        result = parser.setParametersToString(signature
67                                        .getParameters__OperationSignature());
68                        break;
69                case OperationsEditorSection.EXCEPTIONS_COLUMN_INDEX:
70                        result = parser.setExceptionsToString(signature
71                                        .getExceptions__Signature());
72                        break;
73                default:
74                        break;
75                }
76                return parser.isNotNull(result);
77        }
78}

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