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

COVERAGE SUMMARY FOR SOURCE FILE [TerminationCriteriaViewContentProvider.java]

nameclass, %method, %block, %line, %
TerminationCriteriaViewContentProvider.java0%   (0/1)0%   (0/8)0%   (0/75)0%   (0/23)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class TerminationCriteriaViewContentProvider0%   (0/1)0%   (0/8)0%   (0/75)0%   (0/23)
TerminationCriteriaViewContentProvider (TerminationCriteriaView): void 0%   (0/1)0%   (0/13)0%   (0/4)
dispose (): void 0%   (0/1)0%   (0/1)0%   (0/1)
getChildren (Object): Object [] 0%   (0/1)0%   (0/11)0%   (0/3)
getElements (Object): Object [] 0%   (0/1)0%   (0/17)0%   (0/4)
getParent (Object): Object 0%   (0/1)0%   (0/9)0%   (0/3)
hasChildren (Object): boolean 0%   (0/1)0%   (0/9)0%   (0/3)
inputChanged (Viewer, Object, Object): void 0%   (0/1)0%   (0/1)0%   (0/1)
updateContent (): void 0%   (0/1)0%   (0/14)0%   (0/4)

1package de.uka.ipd.sdq.tcfmoop.views;
2 
3import org.eclipse.jface.viewers.ITreeContentProvider;
4import org.eclipse.jface.viewers.Viewer;
5 
6import de.uka.ipd.sdq.tcfmoop.outputtree.Node;
7import de.uka.ipd.sdq.tcfmoop.outputtree.Tree;
8import de.uka.ipd.sdq.tcfmoop.outputtree.Node.NodeType;
9 
10public class TerminationCriteriaViewContentProvider implements ITreeContentProvider {
11 
12        private Tree invisibleRoot = new Tree("Termination Criteria Manager Output", NodeType.NON_SPECIFIC);
13 
14        TerminationCriteriaView viewer;
15 
16        public TerminationCriteriaViewContentProvider(TerminationCriteriaView viewer) {
17                this.viewer = viewer;
18        }
19        
20        @Override
21        public void inputChanged(Viewer v, Object oldInput, Object newInput) {
22        }
23        
24        @Override
25        public void dispose() {
26        }
27 
28        @Override
29        public Object[] getElements(Object parent) {
30                if (parent.equals(viewer.getViewSite())) {
31                        
32                        updateContent();
33                        
34                        return getChildren(invisibleRoot);
35                }
36                return getChildren(parent);
37        }
38 
39        @Override
40        public Object getParent(Object child) {
41                if (child instanceof Node) {
42                        return ((Node) child).getParent();
43                }
44                return null;
45        }
46 
47        @Override
48        public Object[] getChildren(Object parent) {
49                if (parent instanceof Node) {
50                        return ((Node) parent).getChildren().toArray();
51                }
52                return new Object[0];
53        }
54 
55        @Override
56        public boolean hasChildren(Object parent) {
57                if (parent instanceof Node) {
58                        return ((Node) parent).hasChildren();
59                }
60                return false;
61        }
62 
63        private void updateContent() {
64                invisibleRoot.clearChildren();
65                
66                if (viewer.terminationCriteriaManagerOutput != null) {
67 
68                        this.invisibleRoot.attachSubtree(viewer.terminationCriteriaManagerOutput);
69 
70                }
71 
72        }
73}

[all classes][de.uka.ipd.sdq.tcfmoop.views]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov