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

nameclass, %method, %block, %line, %
PalladioComponentModelCreationWizardPage.java0%   (0/1)0%   (0/6)0%   (0/86)0%   (0/28)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class PalladioComponentModelCreationWizardPage0%   (0/1)0%   (0/6)0%   (0/86)0%   (0/28)
PalladioComponentModelCreationWizardPage (String, IStructuredSelection, Strin... 0%   (0/1)0%   (0/8)0%   (0/3)
createControl (Composite): void 0%   (0/1)0%   (0/17)0%   (0/5)
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)
validatePage (): boolean 0%   (0/1)0%   (0/31)0%   (0/11)

1/*
2 *Copyright 2007, SDQ, IPD, U KA
3 */
4package de.uka.ipd.sdq.pcm.gmf.allocation.part;
5 
6import org.eclipse.core.runtime.IPath;
7import org.eclipse.core.runtime.Path;
8import org.eclipse.emf.common.util.URI;
9import org.eclipse.jface.viewers.IStructuredSelection;
10import org.eclipse.osgi.util.NLS;
11import org.eclipse.swt.widgets.Composite;
12import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
13 
14/**
15 * @generated
16 */
17public class PalladioComponentModelCreationWizardPage extends
18                WizardNewFileCreationPage {
19 
20        /**
21         * @generated
22         */
23        private final String fileExtension;
24 
25        /**
26         * @generated
27         */
28        public PalladioComponentModelCreationWizardPage(String pageName,
29                        IStructuredSelection selection, String fileExtension) {
30                super(pageName, selection);
31                this.fileExtension = fileExtension;
32        }
33 
34        /**
35         * Override to create files with this extension.
36         * 
37         * @generated
38         */
39        protected String getExtension() {
40                return fileExtension;
41        }
42 
43        /**
44         * @generated
45         */
46        public URI getURI() {
47                return URI.createPlatformResourceURI(getFilePath().toString(), false);
48        }
49 
50        /**
51         * @generated
52         */
53        protected IPath getFilePath() {
54                IPath path = getContainerFullPath();
55                if (path == null) {
56                        path = new Path(""); //$NON-NLS-1$
57                }
58                String fileName = getFileName();
59                if (fileName != null) {
60                        path = path.append(fileName);
61                }
62                return path;
63        }
64 
65        /**
66         * @generated
67         */
68        public void createControl(Composite parent) {
69                super.createControl(parent);
70                setFileName(PalladioComponentModelDiagramEditorUtil.getUniqueFileName(
71                                getContainerFullPath(), getFileName(), getExtension()));
72                setPageComplete(validatePage());
73        }
74 
75        /**
76         * @generated
77         */
78        protected boolean validatePage() {
79                if (!super.validatePage()) {
80                        return false;
81                }
82                String extension = getExtension();
83                if (extension != null
84                                && !getFilePath().toString().endsWith("." + extension)) {
85                        setErrorMessage(NLS
86                                        .bind(
87                                                        Messages.PalladioComponentModelCreationWizardPageExtensionError,
88                                                        extension));
89                        return false;
90                }
91                return true;
92        }
93}

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