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

COVERAGE SUMMARY FOR SOURCE FILE [PalladioComponentModelCreationWizard.java]

nameclass, %method, %block, %line, %
PalladioComponentModelCreationWizard.java0%   (0/2)0%   (0/13)0%   (0/209)0%   (0/65)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class PalladioComponentModelCreationWizard0%   (0/1)0%   (0/11)0%   (0/155)0%   (0/50)
PalladioComponentModelCreationWizard (): void 0%   (0/1)0%   (0/18)0%   (0/6)
access$0 (PalladioComponentModelCreationWizard): SystemSelectorPage 0%   (0/1)0%   (0/3)0%   (0/1)
access$1 (PalladioComponentModelCreationWizard): ResourceEnvironmentSelectorPage 0%   (0/1)0%   (0/3)0%   (0/1)
addPages (): void 0%   (0/1)0%   (0/51)0%   (0/15)
getDiagram (): Resource 0%   (0/1)0%   (0/3)0%   (0/1)
getSelection (): IStructuredSelection 0%   (0/1)0%   (0/3)0%   (0/1)
getWorkbench (): IWorkbench 0%   (0/1)0%   (0/3)0%   (0/1)
init (IWorkbench, IStructuredSelection): void 0%   (0/1)0%   (0/17)0%   (0/7)
isOpenNewlyCreatedDiagramEditor (): boolean 0%   (0/1)0%   (0/3)0%   (0/1)
performFinish (): boolean 0%   (0/1)0%   (0/47)0%   (0/14)
setOpenNewlyCreatedDiagramEditor (boolean): void 0%   (0/1)0%   (0/4)0%   (0/2)
     
class PalladioComponentModelCreationWizard$10%   (0/1)0%   (0/2)0%   (0/54)0%   (0/16)
PalladioComponentModelCreationWizard$1 (PalladioComponentModelCreationWizard,... 0%   (0/1)0%   (0/7)0%   (0/2)
execute (IProgressMonitor): void 0%   (0/1)0%   (0/47)0%   (0/14)

1/*
2 *Copyright 2007, SDQ, IPD, U KA
3 */
4package de.uka.ipd.sdq.pcm.gmf.allocation.part;
5 
6import java.lang.reflect.InvocationTargetException;
7 
8import org.eclipse.core.runtime.CoreException;
9import org.eclipse.core.runtime.IProgressMonitor;
10import org.eclipse.emf.ecore.resource.Resource;
11import org.eclipse.jface.dialogs.ErrorDialog;
12import org.eclipse.jface.operation.IRunnableWithProgress;
13import org.eclipse.jface.viewers.IStructuredSelection;
14import org.eclipse.jface.wizard.Wizard;
15import org.eclipse.ui.INewWizard;
16import org.eclipse.ui.IWorkbench;
17import org.eclipse.ui.PartInitException;
18import org.eclipse.ui.actions.WorkspaceModifyOperation;
19 
20/**
21 * @generated
22 */
23public class PalladioComponentModelCreationWizard extends Wizard implements
24                INewWizard {
25 
26        private ResourceEnvironmentSelectorPage myResourceEnvironmentSelectorPage;
27        private SystemSelectorPage mySystemSelectorPage;
28 
29        public PalladioComponentModelCreationWizard() {
30                myResourceEnvironmentSelectorPage = new ResourceEnvironmentSelectorPage(
31                                null);
32                mySystemSelectorPage = new SystemSelectorPage(null);
33        }
34 
35        /**
36         * @generated
37         */
38        private IWorkbench workbench;
39 
40        /**
41         * @generated
42         */
43        protected IStructuredSelection selection;
44 
45        /**
46         * @generated
47         */
48        protected PalladioComponentModelCreationWizardPage diagramModelFilePage;
49 
50        /**
51         * @generated
52         */
53        protected PalladioComponentModelCreationWizardPage domainModelFilePage;
54 
55        /**
56         * @generated
57         */
58        protected Resource diagram;
59 
60        /**
61         * @generated
62         */
63        private boolean openNewlyCreatedDiagramEditor = true;
64 
65        /**
66         * @generated
67         */
68        public IWorkbench getWorkbench() {
69                return workbench;
70        }
71 
72        /**
73         * @generated
74         */
75        public IStructuredSelection getSelection() {
76                return selection;
77        }
78 
79        /**
80         * @generated
81         */
82        public final Resource getDiagram() {
83                return diagram;
84        }
85 
86        /**
87         * @generated
88         */
89        public final boolean isOpenNewlyCreatedDiagramEditor() {
90                return openNewlyCreatedDiagramEditor;
91        }
92 
93        /**
94         * @generated
95         */
96        public void setOpenNewlyCreatedDiagramEditor(
97                        boolean openNewlyCreatedDiagramEditor) {
98                this.openNewlyCreatedDiagramEditor = openNewlyCreatedDiagramEditor;
99        }
100 
101        /**
102         * @generated
103         */
104        public void init(IWorkbench workbench, IStructuredSelection selection) {
105                this.workbench = workbench;
106                this.selection = selection;
107                setWindowTitle(Messages.PalladioComponentModelCreationWizardTitle);
108                setDefaultPageImageDescriptor(PalladioComponentModelAllocationDiagramEditorPlugin
109                                .getBundledImageDescriptor("icons/wizban/NewAllocationWizard.gif")); //$NON-NLS-1$
110                setNeedsProgressMonitor(true);
111        }
112 
113        /**
114         * @generated not
115         */
116        public void addPages() {
117                diagramModelFilePage = new PalladioComponentModelCreationWizardPage(
118                                "DiagramModelFile", getSelection(), "allocation_diagram"); //$NON-NLS-1$ //$NON-NLS-2$
119                diagramModelFilePage.setTitle("Create allocation Diagram");
120                diagramModelFilePage
121                                .setDescription("Select file that will contain diagram model.");
122                addPage(diagramModelFilePage);
123 
124                domainModelFilePage = new PalladioComponentModelCreationWizardPage(
125                                "DomainModelFile", getSelection(), "allocation"); //$NON-NLS-1$ //$NON-NLS-2$
126                domainModelFilePage.setTitle("Create allocation Diagram");
127                domainModelFilePage
128                                .setDescription("Select file that will contain domain model.");
129                addPage(domainModelFilePage);
130 
131                addPage(myResourceEnvironmentSelectorPage);
132                addPage(mySystemSelectorPage);
133        }
134 
135        /**
136         * @generated not
137         */
138        public boolean performFinish() {
139                IRunnableWithProgress op = new WorkspaceModifyOperation(null) {
140 
141                        protected void execute(IProgressMonitor monitor)
142                                        throws CoreException, InterruptedException {
143                                diagram = PalladioComponentModelDiagramEditorUtil
144                                                .createDiagram(diagramModelFilePage.getURI(),
145                                                                domainModelFilePage.getURI(),
146                                                                mySystemSelectorPage.getSelectedSystem(),
147                                                                myResourceEnvironmentSelectorPage
148                                                                                .getSelectedResourceEnvironment(),
149                                                                monitor);
150                                if (isOpenNewlyCreatedDiagramEditor() && diagram != null) {
151                                        try {
152                                                PalladioComponentModelDiagramEditorUtil
153                                                                .openDiagram(diagram);
154                                        } catch (PartInitException e) {
155                                                ErrorDialog.openError(getContainer().getShell(),
156                                                                "Error opening diagram editor", null, e
157                                                                                .getStatus());
158                                        }
159                                }
160                        }
161                };
162                try {
163                        getContainer().run(false, true, op);
164                } catch (InterruptedException e) {
165                        return false;
166                } catch (InvocationTargetException e) {
167                        if (e.getTargetException() instanceof CoreException) {
168                                ErrorDialog.openError(getContainer().getShell(),
169                                                "Creation Problems", null, ((CoreException) e
170                                                                .getTargetException()).getStatus());
171                        } else {
172                                PalladioComponentModelAllocationDiagramEditorPlugin
173                                                .getInstance()
174                                                .logError(
175                                                                "Error creating diagram", e.getTargetException()); //$NON-NLS-1$
176                        }
177                        return false;
178                }
179                return diagram != null;
180        }
181}

[all classes][de.uka.ipd.sdq.pcm.gmf.allocation.part]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov