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

COVERAGE SUMMARY FOR SOURCE FILE [FeatureConfigCreationWizard.java]

nameclass, %method, %block, %line, %
FeatureConfigCreationWizard.java0%   (0/2)0%   (0/11)0%   (0/129)0%   (0/39)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class FeatureConfigCreationWizard0%   (0/1)0%   (0/5)0%   (0/53)0%   (0/17)
FeatureConfigCreationWizard (String, String): void 0%   (0/1)0%   (0/9)0%   (0/4)
addPages (): void 0%   (0/1)0%   (0/20)0%   (0/4)
getNewResource (): URI 0%   (0/1)0%   (0/3)0%   (0/1)
init (IWorkbench, IStructuredSelection): void 0%   (0/1)0%   (0/10)0%   (0/4)
performFinish (): boolean 0%   (0/1)0%   (0/11)0%   (0/4)
     
class FeatureConfigCreationWizardPage0%   (0/1)0%   (0/6)0%   (0/76)0%   (0/22)
FeatureConfigCreationWizardPage (String, IStructuredSelection, String, String... 0%   (0/1)0%   (0/14)0%   (0/5)
createAdvancedControls (Composite): void 0%   (0/1)0%   (0/14)0%   (0/4)
createControl (Composite): void 0%   (0/1)0%   (0/18)0%   (0/4)
getExtension (): String 0%   (0/1)0%   (0/3)0%   (0/1)
getFilePath (): IPath 0%   (0/1)0%   (0/21)0%   (0/7)
getURI (): URI 0%   (0/1)0%   (0/6)0%   (0/1)

1package de.uka.ipd.sdq.featureinstance;
2 
3import org.eclipse.core.runtime.IPath;
4import org.eclipse.core.runtime.Path;
5import org.eclipse.emf.common.util.URI;
6import org.eclipse.jface.viewers.IStructuredSelection;
7import org.eclipse.jface.wizard.Wizard;
8import org.eclipse.swt.SWT;
9import org.eclipse.swt.widgets.Composite;
10import org.eclipse.swt.widgets.Label;
11import org.eclipse.ui.INewWizard;
12import org.eclipse.ui.IWorkbench;
13import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
14 
15class FeatureConfigCreationWizardPage extends WizardNewFileCreationPage {
16 
17        @Override
18        protected void createAdvancedControls(Composite parent) {
19                Label label = new Label(parent, SWT.BORDER);
20                label.setText(message);
21                super.createAdvancedControls(parent);
22        }
23 
24        /**
25         * Override to create files with this extension.
26         * 
27         * @generated
28         */
29        protected String getExtension() {
30                return fileExtension;
31        }
32 
33        /**
34         * @generated
35         */
36        public URI getURI() {
37                return URI.createPlatformResourceURI(getFilePath().toString(), false);
38        }
39 
40        /**
41         * @generated
42         */
43        private final String fileExtension;
44        protected String fileName;
45        protected String message;
46 
47        /**
48         * @generated
49         */
50        public FeatureConfigCreationWizardPage(String pageName, IStructuredSelection selection, String fileExtension, String fileName, String message) {
51                super(pageName, selection);
52                this.fileExtension = fileExtension;
53                this.fileName = fileName;
54                this.message = message;
55        }
56 
57        /**
58         * @generated
59         */
60        protected IPath getFilePath() {
61                IPath path = getContainerFullPath();
62                if (path == null) {
63                        path = new Path(""); //$NON-NLS-1$
64                }
65                String fileName = getFileName();
66                if (fileName != null) {
67                        path = path.append(fileName);
68                }
69                return path;
70        }
71 
72        /**
73         * @generated
74         */
75        @Override
76        public void createControl(Composite parent) {
77                super.createControl(parent);
78                setFileName(fileName + ".featureconfig");
79                setPageComplete(true);
80        }
81}
82 
83public class FeatureConfigCreationWizard extends Wizard implements INewWizard {
84        
85        protected URI resourceURI;
86        protected IWorkbench workbench;
87        protected IStructuredSelection selection;
88        protected FeatureConfigCreationWizardPage page;
89        protected String fileName;
90        protected String message;
91 
92        @Override
93        public void addPages() {
94                page = new FeatureConfigCreationWizardPage("Resource selection page", selection, "", fileName, message);
95                addPage(page);
96                super.addPages();
97        }
98        
99        public URI getNewResource () {
100                return resourceURI;
101        }
102        
103        public boolean performFinish() {
104                try {
105                        resourceURI = page.getURI();
106                }
107                catch (Exception e) {
108                        return false;
109                }
110                return true;
111        }
112 
113        public FeatureConfigCreationWizard (String fileName, String message) {
114                this.fileName = fileName;
115                this.message = message;
116        }
117 
118        public void init(IWorkbench workbench, IStructuredSelection selection) {
119                this.workbench = workbench;
120                this.selection = selection;
121                setWindowTitle("FeatureConfig creation wizard");                
122        }
123        
124}

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