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

COVERAGE SUMMARY FOR SOURCE FILE [CipModelTab.java]

nameclass, %method, %block, %line, %
CipModelTab.java0%   (0/4)0%   (0/14)0%   (0/192)0%   (0/48)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class CipModelTab0%   (0/1)0%   (0/7)0%   (0/124)0%   (0/29)
CipModelTab (): void 0%   (0/1)0%   (0/3)0%   (0/1)
createControl (Composite): void 0%   (0/1)0%   (0/70)0%   (0/16)
createTree (Composite): TreeViewer 0%   (0/1)0%   (0/46)0%   (0/8)
getName (): String 0%   (0/1)0%   (0/2)0%   (0/1)
initializeFrom (ILaunchConfiguration): void 0%   (0/1)0%   (0/1)0%   (0/1)
performApply (ILaunchConfigurationWorkingCopy): void 0%   (0/1)0%   (0/1)0%   (0/1)
setDefaults (ILaunchConfigurationWorkingCopy): void 0%   (0/1)0%   (0/1)0%   (0/1)
     
class CipModelTab$ModelInputOutputContentProvider0%   (0/1)0%   (0/4)0%   (0/36)0%   (0/10)
CipModelTab$ModelInputOutputContentProvider (CipModelTab): void 0%   (0/1)0%   (0/6)0%   (0/1)
getChildren (Object): Object [] 0%   (0/1)0%   (0/12)0%   (0/4)
getParent (Object): Object 0%   (0/1)0%   (0/2)0%   (0/1)
hasChildren (Object): boolean 0%   (0/1)0%   (0/16)0%   (0/4)
     
class CipModelTab$ModelInputOutputLabelProvider0%   (0/1)0%   (0/2)0%   (0/18)0%   (0/5)
CipModelTab$ModelInputOutputLabelProvider (CipModelTab): void 0%   (0/1)0%   (0/6)0%   (0/1)
getText (Object): String 0%   (0/1)0%   (0/12)0%   (0/4)
     
class CipModelTab$ModelList0%   (0/1)0%   (0/1)0%   (0/14)0%   (0/4)
CipModelTab$ModelList (CipModelTab, String): void 0%   (0/1)0%   (0/14)0%   (0/4)

1package de.uka.ipd.sdq.cip.runtime.runconfig.tabs;
2 
3import java.util.ArrayList;
4 
5import org.eclipse.debug.core.ILaunchConfiguration;
6import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
7import org.eclipse.jface.viewers.ArrayContentProvider;
8import org.eclipse.jface.viewers.ITreeContentProvider;
9import org.eclipse.jface.viewers.LabelProvider;
10import org.eclipse.jface.viewers.TreeViewer;
11import org.eclipse.swt.SWT;
12import org.eclipse.swt.layout.GridData;
13import org.eclipse.swt.layout.GridLayout;
14import org.eclipse.swt.widgets.Composite;
15import org.eclipse.swt.widgets.Label;
16 
17 
18public class CipModelTab extends AbstractCipLaunchConfigurationTab {
19 
20        private class ModelList {
21                public String name;
22                public ArrayList<String> models; 
23                
24                public ModelList(String name) {
25                        models = new ArrayList<String>();
26                        this.name = name;
27                }
28        }
29        
30        private TreeViewer modelfilesViewer;
31        private ModelList[] modelList; 
32        
33        @Override
34        public void createControl(Composite parent) {
35                Composite mainComponent = new Composite(parent,SWT.NONE);
36                setControl(mainComponent);
37                
38                mainComponent.setFont(parent.getFont());
39                
40                GridLayout layout = new GridLayout(3, false);
41                layout.marginWidth = 5;
42                layout.marginHeight = 5;
43                mainComponent.setLayout(layout);
44                
45                Label label = new Label(mainComponent,SWT.LEFT);
46                label.setText("Transformations:");
47                GridData gd = new GridData(SWT.FILL,SWT.TOP,true,false);
48                gd.horizontalSpan = 3;
49                label.setLayoutData(gd);
50                modelfilesViewer = createTree(mainComponent);
51                gd = new GridData(SWT.FILL,SWT.FILL,true,false);
52                //gd.horizontalSpan = ;
53                modelfilesViewer.getTree().setLayoutData(gd);
54                
55        }
56 
57        private TreeViewer createTree(Composite mainComponent) {
58                
59                final TreeViewer treeviewer;
60                
61                treeviewer = new TreeViewer(mainComponent,SWT.SINGLE | SWT.BORDER | SWT.FULL_SELECTION);
62                treeviewer.setLabelProvider(new ModelInputOutputLabelProvider());
63                treeviewer.setContentProvider(new ModelInputOutputContentProvider());
64                modelList = new ModelList[2];
65                modelList[0] = new ModelList("Input Models");
66                modelList[1] = new ModelList("Output Models");
67                treeviewer.setInput(modelList);
68                return treeviewer;
69        }
70 
71        @Override
72        public String getName() {
73                return "CIP Input/Output Models";
74        }
75 
76        @Override
77        public void initializeFrom(ILaunchConfiguration configuration) {
78                // TODO Auto-generated method stub
79 
80        }
81 
82        @Override
83        public void performApply(ILaunchConfigurationWorkingCopy configuration) {
84                // TODO Auto-generated method stub
85 
86        }
87 
88        @Override
89        public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
90                // TODO Auto-generated method stub
91 
92        }
93        
94        public class ModelInputOutputContentProvider extends ArrayContentProvider implements ITreeContentProvider {
95 
96                @Override
97                public Object[] getChildren(Object parentElement) {
98                        if(parentElement instanceof ModelList)
99                        {
100                                ModelList modelList = (ModelList) parentElement;
101                                return modelList.models.toArray();
102                        }
103                        return null;
104                }
105 
106                @Override
107                public Object getParent(Object element) {
108                        // TODO Auto-generated method stub
109                        return null;
110                }
111 
112                @Override
113                public boolean hasChildren(Object element) {
114                        if(element instanceof ModelList)
115                        {
116                                ModelList modelList = (ModelList) element;
117                                return modelList.models.size() > 0;
118                        }
119                        return false;
120                }
121                
122        }
123        
124        public class ModelInputOutputLabelProvider extends LabelProvider {
125 
126                @Override
127                public String getText(Object element) {
128                        if(element instanceof ModelList)
129                        {
130                                ModelList modelList = (ModelList) element;
131                                return modelList.name;
132                        }
133                        return (String)element;
134                }
135                
136        }
137 
138}

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