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

COVERAGE SUMMARY FOR SOURCE FILE [PalladioComponentModelCreationWizard.java]

nameclass, %method, %block, %line, %
PalladioComponentModelCreationWizard.java0%   (0/3)0%   (0/13)0%   (0/212)0%   (0/67)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class PalladioComponentModelCreationWizard0%   (0/1)0%   (0/9)0%   (0/130)0%   (0/46)
PalladioComponentModelCreationWizard (): void 0%   (0/1)0%   (0/6)0%   (0/2)
addPages (): void 0%   (0/1)0%   (0/44)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/16)
setOpenNewlyCreatedDiagramEditor (boolean): void 0%   (0/1)0%   (0/4)0%   (0/2)
     
class PalladioComponentModelCreationWizard$10%   (0/1)0%   (0/2)0%   (0/36)0%   (0/11)
PalladioComponentModelCreationWizard$1 (PalladioComponentModelCreationWizard,... 0%   (0/1)0%   (0/9)0%   (0/2)
setVisible (boolean): void 0%   (0/1)0%   (0/27)0%   (0/9)
     
class PalladioComponentModelCreationWizard$20%   (0/1)0%   (0/2)0%   (0/46)0%   (0/13)
PalladioComponentModelCreationWizard$2 (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 2006 SDQ Research Group, University of Karlsruhe (TH)
3 */
4package de.uka.ipd.sdq.pcm.gmf.seff.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(PalladioComponentModelSeffDiagramEditorPlugin
100                                .getBundledImageDescriptor("icons/wizban/NewSeffWizard.gif")); //$NON-NLS-1$
101                setNeedsProgressMonitor(true);
102        }
103 
104        /**
105         * @generated
106         */
107        public void addPages() {
108                diagramModelFilePage = new PalladioComponentModelCreationWizardPage(
109                                "DiagramModelFile", getSelection(), "seff_diagram"); //$NON-NLS-1$ //$NON-NLS-2$
110                diagramModelFilePage
111                                .setTitle(Messages.PalladioComponentModelCreationWizard_DiagramModelFilePageTitle);
112                diagramModelFilePage
113                                .setDescription(Messages.PalladioComponentModelCreationWizard_DiagramModelFilePageDescription);
114                addPage(diagramModelFilePage);
115 
116                domainModelFilePage = new PalladioComponentModelCreationWizardPage(
117                                "DomainModelFile", getSelection(), "repository") { //$NON-NLS-1$ //$NON-NLS-2$
118 
119                        public void setVisible(boolean visible) {
120                                if (visible) {
121                                        String fileName = diagramModelFilePage.getFileName();
122                                        fileName = fileName.substring(0, fileName.length()
123                                                        - ".seff_diagram".length()); //$NON-NLS-1$
124                                        setFileName(PalladioComponentModelDiagramEditorUtil
125                                                        .getUniqueFileName(getContainerFullPath(),
126                                                                        fileName, "repository")); //$NON-NLS-1$
127                                }
128                                super.setVisible(visible);
129                        }
130                };
131                domainModelFilePage
132                                .setTitle(Messages.PalladioComponentModelCreationWizard_DomainModelFilePageTitle);
133                domainModelFilePage
134                                .setDescription(Messages.PalladioComponentModelCreationWizard_DomainModelFilePageDescription);
135                addPage(domainModelFilePage);
136        }
137 
138        /**
139         * @generated
140         */
141        public boolean performFinish() {
142                IRunnableWithProgress op = new WorkspaceModifyOperation(null) {
143 
144                        protected void execute(IProgressMonitor monitor)
145                                        throws CoreException, InterruptedException {
146                                diagram = PalladioComponentModelDiagramEditorUtil
147                                                .createDiagram(diagramModelFilePage.getURI(),
148                                                                domainModelFilePage.getURI(), monitor);
149                                if (isOpenNewlyCreatedDiagramEditor() && diagram != null) {
150                                        try {
151                                                PalladioComponentModelDiagramEditorUtil
152                                                                .openDiagram(diagram);
153                                        } catch (PartInitException e) {
154                                                ErrorDialog
155                                                                .openError(
156                                                                                getContainer().getShell(),
157                                                                                Messages.PalladioComponentModelCreationWizardOpenEditorError,
158                                                                                null, e.getStatus());
159                                        }
160                                }
161                        }
162                };
163                try {
164                        getContainer().run(false, true, op);
165                } catch (InterruptedException e) {
166                        return false;
167                } catch (InvocationTargetException e) {
168                        if (e.getTargetException() instanceof CoreException) {
169                                ErrorDialog
170                                                .openError(
171                                                                getContainer().getShell(),
172                                                                Messages.PalladioComponentModelCreationWizardCreationError,
173                                                                null, ((CoreException) e.getTargetException())
174                                                                                .getStatus());
175                        } else {
176                                PalladioComponentModelSeffDiagramEditorPlugin
177                                                .getInstance()
178                                                .logError(
179                                                                "Error creating diagram", e.getTargetException()); //$NON-NLS-1$
180                        }
181                        return false;
182                }
183                return diagram != null;
184        }
185}

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