EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][de.uka.ipd.sdq.pcm.gmf.seff.helper]

COVERAGE SUMMARY FOR SOURCE FILE [CollectionIteratorContentProvider.java]

nameclass, %method, %block, %line, %
CollectionIteratorContentProvider.java0%   (0/1)0%   (0/7)0%   (0/78)0%   (0/25)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class CollectionIteratorContentProvider0%   (0/1)0%   (0/7)0%   (0/78)0%   (0/25)
CollectionIteratorContentProvider (): void 0%   (0/1)0%   (0/3)0%   (0/1)
dispose (): void 0%   (0/1)0%   (0/1)0%   (0/1)
getChildren (Object): Object [] 0%   (0/1)0%   (0/50)0%   (0/13)
getElements (Object): Object [] 0%   (0/1)0%   (0/9)0%   (0/3)
getParent (Object): Object 0%   (0/1)0%   (0/2)0%   (0/1)
hasChildren (Object): boolean 0%   (0/1)0%   (0/12)0%   (0/5)
inputChanged (Viewer, Object, Object): void 0%   (0/1)0%   (0/1)0%   (0/1)

1package de.uka.ipd.sdq.pcm.gmf.seff.helper;
2 
3import java.util.ArrayList;
4 
5import org.eclipse.emf.common.util.EList;
6import org.eclipse.jface.viewers.ITreeContentProvider;
7import org.eclipse.jface.viewers.Viewer;
8 
9import de.uka.ipd.sdq.pcm.repository.CollectionDataType;
10import de.uka.ipd.sdq.pcm.repository.DataType;
11import de.uka.ipd.sdq.pcm.repository.Interface;
12import de.uka.ipd.sdq.pcm.repository.OperationInterface;
13import de.uka.ipd.sdq.pcm.repository.OperationSignature;
14import de.uka.ipd.sdq.pcm.repository.Parameter;
15import de.uka.ipd.sdq.pcm.repository.Signature;
16 
17/**
18 * @author roman
19 * 
20 * The ContentProvider for SelectObjectDialog. The Dialog will coll from
21 * ParameterCollectionIteratorActionEditHelperAdvice. Are only indicated
22 * parameter, which have an inside type CollectionDataType.
23 */
24public class CollectionIteratorContentProvider implements ITreeContentProvider {
25 
26        /* (non-Javadoc)
27         * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
28         */
29        public Object[] getChildren(Object parent) {
30 
31                if (parent instanceof OperationInterface) {
32                        OperationInterface interf = (OperationInterface) parent;
33                        return interf.getSignatures__OperationInterface().toArray();
34                }
35 
36                if (parent instanceof OperationSignature) {
37                        OperationSignature signature = (OperationSignature) parent;
38                        ArrayList<Parameter> collParameters = new ArrayList<Parameter>(); 
39                        EList<Parameter> parameters = signature.getParameters__OperationSignature();
40                        for (Parameter p : parameters) {
41                                DataType dataType = p.getDataType__Parameter();
42                                if (dataType instanceof CollectionDataType)
43                                        collParameters.add(p);
44                        }
45                        return collParameters.toArray();
46                }
47                return new Object[0];
48        }
49 
50        /* (non-Javadoc)
51         * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
52         */
53        public Object getParent(Object element) {
54                // TODO Auto-generated method stub
55                return null;
56        }
57 
58        /* (non-Javadoc)
59         * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
60         */
61        public boolean hasChildren(Object element) {
62                if (element instanceof Interface)
63                        return true;
64                if (element instanceof Signature)
65                        return true;
66                return false;
67        }
68 
69        /* (non-Javadoc)
70         * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
71         */
72        public Object[] getElements(Object inputElement) {
73                if (inputElement instanceof Interface)
74                        return getChildren(inputElement);
75                return null;
76        }
77 
78        /* (non-Javadoc)
79         * @see org.eclipse.jface.viewers.IContentProvider#dispose()
80         */
81        public void dispose() {
82                // TODO Auto-generated method stub
83 
84        }
85 
86        /* (non-Javadoc)
87         * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
88         */
89        public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
90                // TODO Auto-generated method stub
91 
92        }
93 
94}

[all classes][de.uka.ipd.sdq.pcm.gmf.seff.helper]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov