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

nameclass, %method, %block, %line, %
NewCompletionWizard.java0%   (0/1)0%   (0/5)0%   (0/224)0%   (0/55)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class NewCompletionWizard0%   (0/1)0%   (0/5)0%   (0/224)0%   (0/55)
NewCompletionWizard (): void 0%   (0/1)0%   (0/11)0%   (0/4)
addPages (): void 0%   (0/1)0%   (0/40)0%   (0/10)
canFinish (): boolean 0%   (0/1)0%   (0/14)0%   (0/5)
getTransformation (): Transformation 0%   (0/1)0%   (0/3)0%   (0/1)
performFinish (): boolean 0%   (0/1)0%   (0/156)0%   (0/35)

1package de.uka.ipd.sdq.cip.runtime.wizards;
2 
3import org.eclipse.jface.wizard.Wizard;
4 
5import de.uka.ipd.sdq.cip.completions.RegisteredCompletion;
6import de.uka.ipd.sdq.cip.configuration.Transformation;
7import de.uka.ipd.sdq.cip.configuration.TransformationType;
8import de.uka.ipd.sdq.cip.configuration.Transformation.TransformationQVTType;
9import de.uka.ipd.sdq.cip.ConstantsContainer;
10import de.uka.ipd.sdq.cip.runtime.RunConfigImages;
11import de.uka.ipd.sdq.cip.runtime.wizards.CompletionConfigNode.FeatureConfig;
12import de.uka.ipd.sdq.cip.runtime.wizards.CompletionConfigNode.UserDefined;
13import de.uka.ipd.sdq.cip.runtime.wizards.CompletionConfigNode.UserDefinedID;
14 
15public class NewCompletionWizard extends Wizard {
16        
17        private CompletionSelectionPage completionSelectionPage;
18        private CompletionConfigurationPage completionConfigurationPage;
19        private Transformation transformation = null;
20        
21        public NewCompletionWizard() {
22                transformation = new Transformation();
23        }
24        
25        @Override
26        public boolean performFinish() {
27                
28                transformation.setEnabled(true);
29                
30                Object element = completionSelectionPage.getSelection();
31                if(element instanceof FeatureConfig) {
32                        FeatureConfig featureConfig = (FeatureConfig) element;
33                        transformation.setType(TransformationType.FEATURE);
34                        transformation.setQVTType(TransformationQVTType.QVTR);
35                        transformation.setFeatureFileURI(featureConfig.getFileURI());
36                }
37                else if(element instanceof RegisteredCompletion) {
38                        RegisteredCompletion completion = (RegisteredCompletion) element;
39                        transformation.setType(TransformationType.REGISTERED);
40                        transformation.setCompletion(completion.getId());
41                        if(completion.containsCategory(ConstantsContainer.MARK_COMPLETION))
42                                transformation.setConfigFileURI(completionConfigurationPage.getFile1Text());
43                }
44                else if(element instanceof UserDefined) {
45                        UserDefined userDefined = (UserDefined) element; 
46                        if(userDefined.getID() == UserDefinedID.ANNOTATED) {
47                                transformation.setType(TransformationType.ANNOTATED);
48                                transformation.setQVTType(TransformationQVTType.QVTR);
49                                transformation.setQVTFileURI(completionConfigurationPage.getFile1Text());
50                                transformation.setConfigFileURI(completionConfigurationPage.getFile2Text());
51                                transformation.setMetamodelFileURI(completionConfigurationPage.getFile3Text());
52                        }
53                        else if(userDefined.getID() == UserDefinedID.PLAIN) {
54                                transformation.setType(TransformationType.PLAIN);
55                                transformation.setQVTType(TransformationQVTType.QVTR);
56                                transformation.setQVTFileURI(completionConfigurationPage.getFile1Text());
57                        }
58                        else if(userDefined.getID() == UserDefinedID.PLAINQVTO) {
59                                transformation.setType(TransformationType.PLAIN);
60                                transformation.setQVTType(TransformationQVTType.QVTO);
61                                transformation.setQVTFileURI(completionConfigurationPage.getFile1Text());
62                                transformation.setOptionalModelFileURI(completionConfigurationPage.getFile2Text());
63                        }
64                        else if(userDefined.getID() == UserDefinedID.FEATURECONFIG) {
65                                transformation.setType(TransformationType.FEATURE);
66                                transformation.setQVTType(TransformationQVTType.QVTR);
67                                transformation.setFeatureFileURI(completionConfigurationPage.getFile1Text());
68                        }
69                }
70                return true;
71        }
72        
73        @Override
74        public void addPages() {
75                setDefaultPageImageDescriptor(RunConfigImages.getChiliIconDescriptor());
76                completionSelectionPage = new CompletionSelectionPage("CompletionType");
77                completionSelectionPage.setTitle("Select Completion Type");
78                completionSelectionPage.setDescription("Select a Completion type and configure it.");
79                addPage(completionSelectionPage);
80                completionConfigurationPage = new CompletionConfigurationPage("CompletionConfiguration");
81                completionConfigurationPage.setTitle("Set Completion Configuration");
82                completionConfigurationPage.setDescription("Add configuration files to the completion.");
83                addPage(completionConfigurationPage);
84        }
85 
86        @Override
87        public boolean canFinish() {
88                if(completionSelectionPage.canFinish())
89                        return true;
90                if(completionConfigurationPage.canFinish())
91                        return true;
92                return false;
93        }
94 
95        public Transformation getTransformation() {
96                return transformation;
97        }
98 
99}

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