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

COVERAGE SUMMARY FOR SOURCE FILE [PalladioComponentModelCreationWizard.java]

nameclass, %method, %block, %line, %
PalladioComponentModelCreationWizard.java0%   (0/2)0%   (0/11)0%   (0/175)0%   (0/56)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class PalladioComponentModelCreationWizard0%   (0/1)0%   (0/9)0%   (0/129)0%   (0/44)
PalladioComponentModelCreationWizard (): void 0%   (0/1)0%   (0/6)0%   (0/2)
addPages (): void 0%   (0/1)0%   (0/43)0%   (0/13)
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/16)
setOpenNewlyCreatedDiagramEditor (boolean): void 0%   (0/1)0%   (0/4)0%   (0/2)
     
class PalladioComponentModelCreationWizard$10%   (0/1)0%   (0/2)0%   (0/46)0%   (0/13)
PalladioComponentModelCreationWizard$1 (PalladioComponentModelCreationWizard,... 0%   (0/1)0%   (0/7)0%   (0/2)
execute (IProgressMonitor): void 0%   (0/1)0%   (0/39)0%   (0/11)

1/*
2 *Copyright 2007, SDQ, IPD, Uni Karlsruhe (TH)
3 */
4package de.uka.ipd.sdq.pcm.gmf.composite.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        /**
27         * @generated
28         */
29        private IWorkbench workbench;
30 
31        /**
32         * @generated
33         */
34        protected IStructuredSelection selection;
35 
36        /**
37         * @generated
38         */
39        protected PalladioComponentModelCreationWizardPage diagramModelFilePage;
40 
41        /**
42         * @generated
43         */
44        protected PalladioComponentModelCreationWizardPage domainModelFilePage;
45 
46        /**
47         * @generated
48         */
49        protected Resource diagram;
50 
51        /**
52         * @generated
53         */
54        private boolean openNewlyCreatedDiagramEditor = true;
55 
56        /**
57         * @generated
58         */
59        public IWorkbench getWorkbench() {
60                return workbench;
61        }
62 
63        /**
64         * @generated
65         */
66        public IStructuredSelection getSelection() {
67                return selection;
68        }
69 
70        /**
71         * @generated
72         */
73        public final Resource getDiagram() {
74                return diagram;
75        }
76 
77        /**
78         * @generated
79         */
80        public final boolean isOpenNewlyCreatedDiagramEditor() {
81                return openNewlyCreatedDiagramEditor;
82        }
83 
84        /**
85         * @generated
86         */
87        public void setOpenNewlyCreatedDiagramEditor(
88                        boolean openNewlyCreatedDiagramEditor) {
89                this.openNewlyCreatedDiagramEditor = openNewlyCreatedDiagramEditor;
90        }
91 
92        /**
93         * @generated
94         */
95        public void init(IWorkbench workbench, IStructuredSelection selection) {
96                this.workbench = workbench;
97                this.selection = selection;
98                setWindowTitle(Messages.PalladioComponentModelCreationWizardTitle);
99                setDefaultPageImageDescriptor(PalladioComponentModelComposedStructureDiagramEditorPlugin
100                                .getBundledImageDescriptor("icons/wizban/NewEntityWizard.gif")); //$NON-NLS-1$
101                setNeedsProgressMonitor(true);
102        }
103 
104        /**
105         * @generated not
106         */
107        public void addPages() {
108                diagramModelFilePage = new PalladioComponentModelCreationWizardPage(
109                                "DiagramModelFile", getSelection(), "system_diagram"); //$NON-NLS-1$ //$NON-NLS-2$
110                diagramModelFilePage.setTitle("Create CompositeModel Diagram");
111                diagramModelFilePage
112                                .setDescription("Select file that will contain diagram model.");
113                addPage(diagramModelFilePage);
114 
115                domainModelFilePage = new PalladioComponentModelCreationWizardPage(
116                                "DomainModelFile", getSelection(), "system"); //$NON-NLS-1$ //$NON-NLS-2$
117                domainModelFilePage.setTitle("Create CompositeModel Diagram");
118                domainModelFilePage
119                                .setDescription("Select file that will contain domain model.");
120                addPage(domainModelFilePage);
121        }
122 
123        /**
124         * @generated
125         */
126        public boolean performFinish() {
127                IRunnableWithProgress op = new WorkspaceModifyOperation(null) {
128 
129                        protected void execute(IProgressMonitor monitor)
130                                        throws CoreException, InterruptedException {
131                                diagram = PalladioComponentModelDiagramEditorUtil
132                                                .createDiagram(diagramModelFilePage.getURI(),
133                                                                domainModelFilePage.getURI(), monitor);
134                                if (isOpenNewlyCreatedDiagramEditor() && diagram != null) {
135                                        try {
136                                                PalladioComponentModelDiagramEditorUtil
137                                                                .openDiagram(diagram);
138                                        } catch (PartInitException e) {
139                                                ErrorDialog
140                                                                .openError(
141                                                                                getContainer().getShell(),
142                                                                                Messages.PalladioComponentModelCreationWizardOpenEditorError,
143                                                                                null, e.getStatus());
144                                        }
145                                }
146                        }
147                };
148                try {
149                        getContainer().run(false, true, op);
150                } catch (InterruptedException e) {
151                        return false;
152                } catch (InvocationTargetException e) {
153                        if (e.getTargetException() instanceof CoreException) {
154                                ErrorDialog
155                                                .openError(
156                                                                getContainer().getShell(),
157                                                                Messages.PalladioComponentModelCreationWizardCreationError,
158                                                                null, ((CoreException) e.getTargetException())
159                                                                                .getStatus());
160                        } else {
161                                PalladioComponentModelComposedStructureDiagramEditorPlugin
162                                                .getInstance()
163                                                .logError(
164                                                                "Error creating diagram", e.getTargetException()); //$NON-NLS-1$
165                        }
166                        return false;
167                }
168                return diagram != null;
169        }
170}

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