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

COVERAGE SUMMARY FOR SOURCE FILE [CompletionConfigurationPage.java]

nameclass, %method, %block, %line, %
CompletionConfigurationPage.java0%   (0/1)0%   (0/7)0%   (0/152)0%   (0/46)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class CompletionConfigurationPage0%   (0/1)0%   (0/7)0%   (0/152)0%   (0/46)
CompletionConfigurationPage (String): void 0%   (0/1)0%   (0/12)0%   (0/4)
canFinish (): boolean 0%   (0/1)0%   (0/45)0%   (0/13)
createControl (Composite): void 0%   (0/1)0%   (0/14)0%   (0/4)
getFile1Text (): String 0%   (0/1)0%   (0/4)0%   (0/1)
getFile2Text (): String 0%   (0/1)0%   (0/4)0%   (0/1)
getFile3Text (): String 0%   (0/1)0%   (0/4)0%   (0/1)
setVisible (boolean): void 0%   (0/1)0%   (0/69)0%   (0/22)

1package de.uka.ipd.sdq.cip.runtime.wizards;
2 
3 
4import org.eclipse.jface.wizard.WizardPage;
5import org.eclipse.swt.SWT;
6import org.eclipse.swt.widgets.Composite;
7 
8import de.uka.ipd.sdq.cip.completions.RegisteredCompletion;
9import de.uka.ipd.sdq.cip.configuration.TransformationType;
10import de.uka.ipd.sdq.cip.configuration.Transformation.TransformationQVTType;
11import de.uka.ipd.sdq.cip.runtime.dialogs.CompletionConfigurationWidget;
12import de.uka.ipd.sdq.cip.runtime.wizards.CompletionConfigNode.FeatureConfig;
13import de.uka.ipd.sdq.cip.runtime.wizards.CompletionConfigNode.UserDefined;
14import de.uka.ipd.sdq.cip.runtime.wizards.CompletionConfigNode.UserDefinedID;
15 
16public class CompletionConfigurationPage extends WizardPage {
17 
18        private CompletionConfigurationWidget completionConfigurationWidget = null;
19 
20        protected CompletionConfigurationPage(String pageName) {
21                super(pageName);
22                completionConfigurationWidget = new CompletionConfigurationWidget();
23        }
24 
25        @Override
26        public void createControl(Composite parent) {
27                Composite mainComponent = new Composite(parent, SWT.NONE);
28                
29                completionConfigurationWidget.createControl(mainComponent);
30                
31                setControl(mainComponent);
32 
33        }
34        
35        public boolean canFinish() {
36                CompletionSelectionPage prevpage = (CompletionSelectionPage) getWizard().getPreviousPage(this);
37                Object element = prevpage.getSelection();
38                if(element instanceof RegisteredCompletion) {
39                        if(getFile1Text() != null)
40                                return true;
41                }
42                if(element instanceof UserDefined) {
43                        UserDefined userDefined = (UserDefined) element; 
44                        if(userDefined.getID() == UserDefinedID.ANNOTATED) {
45                                if(getFile1Text() != null && getFile2Text() != null && getFile3Text() != null)
46                                        return true;
47                        }
48                        else {
49                                if(getFile1Text() != null)
50                                        return true;
51                        }
52                }
53                return false;
54        }
55        
56        @Override
57        public void setVisible(boolean visible) {
58                CompletionSelectionPage prevpage = (CompletionSelectionPage) getWizard().getPreviousPage(this);
59                Object element = prevpage.getSelection();
60                
61                TransformationType type = TransformationType.NONE;
62                TransformationQVTType qvtType = TransformationQVTType.QVTR;
63                
64                if(element instanceof RegisteredCompletion) {
65                        type = TransformationType.REGISTERED;
66                }
67                else if(element instanceof FeatureConfig)
68                {
69                        type = TransformationType.FEATURE;
70                }
71                else if(element instanceof UserDefined) {
72                        UserDefined userDefined = (UserDefined) element; 
73                        if(userDefined.getID() == UserDefinedID.ANNOTATED) {
74                                type = TransformationType.ANNOTATED;
75                        }
76                        else if(userDefined.getID() == UserDefinedID.PLAIN) {
77                                type = TransformationType.PLAIN;
78                        }
79                        // QVTO completion
80                        else if(userDefined.getID() == UserDefinedID.PLAINQVTO) {
81                                type = TransformationType.PLAIN;
82                                qvtType = TransformationQVTType.QVTO;
83                                
84                        }
85                        else if(userDefined.getID() == UserDefinedID.FEATURECONFIG) {
86                                type = TransformationType.FEATURE;
87                        }
88                }
89                
90                completionConfigurationWidget.setVisible(type,qvtType);
91                
92                super.setVisible(visible);
93        }
94        
95        public String getFile1Text() {
96                return completionConfigurationWidget.getFile1Text();
97        }
98        
99        public String getFile2Text() {
100                return completionConfigurationWidget.getFile2Text();
101        }
102 
103        public String getFile3Text() {
104                return completionConfigurationWidget.getFile3Text();
105        }
106        
107        
108        
109 
110}

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