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

COVERAGE SUMMARY FOR SOURCE FILE [QualityPropertiesModelWizard.java]

nameclass, %method, %block, %line, %
QualityPropertiesModelWizard.java0%   (0/6)0%   (0/25)0%   (0/807)0%   (0/173)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class QualityPropertiesModelWizard0%   (0/1)0%   (0/8)0%   (0/336)0%   (0/70)
<static initializer> 0%   (0/1)0%   (0/16)0%   (0/5)
QualityPropertiesModelWizard (): void 0%   (0/1)0%   (0/11)0%   (0/3)
addPages (): void 0%   (0/1)0%   (0/149)0%   (0/24)
createInitialModel (): EObject 0%   (0/1)0%   (0/15)0%   (0/3)
getInitialObjectNames (): Collection 0%   (0/1)0%   (0/44)0%   (0/9)
getModelFile (): IFile 0%   (0/1)0%   (0/4)0%   (0/1)
init (IWorkbench, IStructuredSelection): void 0%   (0/1)0%   (0/19)0%   (0/5)
performFinish (): boolean 0%   (0/1)0%   (0/78)0%   (0/21)
     
class QualityPropertiesModelWizard$10%   (0/1)0%   (0/2)0%   (0/66)0%   (0/17)
QualityPropertiesModelWizard$1 (QualityPropertiesModelWizard, IFile): void 0%   (0/1)0%   (0/9)0%   (0/2)
execute (IProgressMonitor): void 0%   (0/1)0%   (0/57)0%   (0/15)
     
class QualityPropertiesModelWizard$20%   (0/1)0%   (0/2)0%   (0/19)0%   (0/4)
QualityPropertiesModelWizard$2 (QualityPropertiesModelWizard, IWorkbenchPart,... 0%   (0/1)0%   (0/12)0%   (0/2)
run (): void 0%   (0/1)0%   (0/7)0%   (0/2)
     
class QualityPropertiesModelWizard$QualityPropertiesModelWizardInitialObjectCreationPage0%   (0/1)0%   (0/8)0%   (0/315)0%   (0/71)
QualityPropertiesModelWizard$QualityPropertiesModelWizardInitialObjectCreatio... 0%   (0/1)0%   (0/13)0%   (0/5)
createControl (Composite): void 0%   (0/1)0%   (0/185)0%   (0/42)
getEncoding (): String 0%   (0/1)0%   (0/4)0%   (0/1)
getEncodings (): Collection 0%   (0/1)0%   (0/28)0%   (0/5)
getInitialObjectName (): String 0%   (0/1)0%   (0/27)0%   (0/5)
getLabel (String): String 0%   (0/1)0%   (0/18)0%   (0/4)
setVisible (boolean): void 0%   (0/1)0%   (0/26)0%   (0/8)
validatePage (): boolean 0%   (0/1)0%   (0/14)0%   (0/1)
     
class QualityPropertiesModelWizard$QualityPropertiesModelWizardInitialObjectCreationPage$10%   (0/1)0%   (0/2)0%   (0/13)0%   (0/4)
QualityPropertiesModelWizard$QualityPropertiesModelWizardInitialObjectCreatio... 0%   (0/1)0%   (0/6)0%   (0/2)
modifyText (ModifyEvent): void 0%   (0/1)0%   (0/7)0%   (0/2)
     
class QualityPropertiesModelWizard$QualityPropertiesModelWizardNewFileCreationPage0%   (0/1)0%   (0/3)0%   (0/58)0%   (0/12)
QualityPropertiesModelWizard$QualityPropertiesModelWizardNewFileCreationPage ... 0%   (0/1)0%   (0/8)0%   (0/3)
getModelFile (): IFile 0%   (0/1)0%   (0/9)0%   (0/1)
validatePage (): boolean 0%   (0/1)0%   (0/41)0%   (0/8)

1/**
2 * <copyright>
3 * </copyright>
4 *
5 * $Id$
6 */
7package de.uka.ipd.sdq.pcm.designdecision.QualityProperties.presentation;
8 
9 
10import java.util.ArrayList;
11import java.util.Arrays;
12import java.util.Collection;
13import java.util.Collections;
14import java.util.HashMap;
15import java.util.List;
16import java.util.Map;
17import java.util.MissingResourceException;
18import java.util.StringTokenizer;
19 
20import org.eclipse.emf.common.CommonPlugin;
21 
22import org.eclipse.emf.common.util.URI;
23 
24import org.eclipse.emf.ecore.EClass;
25import org.eclipse.emf.ecore.EClassifier;
26 
27import org.eclipse.emf.ecore.resource.Resource;
28import org.eclipse.emf.ecore.resource.ResourceSet;
29 
30import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
31 
32import org.eclipse.emf.ecore.EObject;
33 
34import org.eclipse.emf.ecore.xmi.XMLResource;
35 
36import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
37 
38import org.eclipse.core.resources.IContainer;
39import org.eclipse.core.resources.IFile;
40import org.eclipse.core.resources.IFolder;
41import org.eclipse.core.resources.IProject;
42import org.eclipse.core.resources.IResource;
43import org.eclipse.core.resources.ResourcesPlugin;
44 
45import org.eclipse.core.runtime.IProgressMonitor;
46 
47import org.eclipse.jface.dialogs.MessageDialog;
48 
49import org.eclipse.jface.viewers.IStructuredSelection;
50 
51import org.eclipse.jface.wizard.Wizard;
52import org.eclipse.jface.wizard.WizardPage;
53 
54import org.eclipse.swt.SWT;
55 
56import org.eclipse.swt.events.ModifyListener;
57import org.eclipse.swt.events.ModifyEvent;
58 
59import org.eclipse.swt.layout.GridData;
60import org.eclipse.swt.layout.GridLayout;
61 
62import org.eclipse.swt.widgets.Combo;
63import org.eclipse.swt.widgets.Composite;
64import org.eclipse.swt.widgets.Label;
65 
66import org.eclipse.ui.INewWizard;
67import org.eclipse.ui.IWorkbench;
68 
69import org.eclipse.ui.actions.WorkspaceModifyOperation;
70 
71import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
72 
73import org.eclipse.ui.part.FileEditorInput;
74import org.eclipse.ui.part.ISetSelectionTarget;
75 
76import de.uka.ipd.sdq.pcm.designdecision.QualityProperties.QualityPropertiesFactory;
77import de.uka.ipd.sdq.pcm.designdecision.QualityProperties.QualityPropertiesPackage;
78import de.uka.ipd.sdq.pcm.designdecision.provider.DesignDecisionEditPlugin;
79 
80 
81import de.uka.ipd.sdq.pcm.designdecision.presentation.DesignDecisionEditorPlugin;
82 
83import org.eclipse.core.runtime.Path;
84 
85import org.eclipse.jface.viewers.ISelection;
86import org.eclipse.jface.viewers.StructuredSelection;
87 
88import org.eclipse.ui.IWorkbenchPage;
89import org.eclipse.ui.IWorkbenchPart;
90import org.eclipse.ui.IWorkbenchWindow;
91import org.eclipse.ui.PartInitException;
92 
93 
94/**
95 * This is a simple wizard for creating a new model file.
96 * <!-- begin-user-doc -->
97 * <!-- end-user-doc -->
98 * @generated
99 */
100public class QualityPropertiesModelWizard extends Wizard implements INewWizard {
101        /**
102         * The supported extensions for created files.
103         * <!-- begin-user-doc -->
104         * <!-- end-user-doc -->
105         * @generated
106         */
107        public static final List<String> FILE_EXTENSIONS =
108                Collections.unmodifiableList(Arrays.asList(DesignDecisionEditorPlugin.INSTANCE.getString("_UI_QualityPropertiesEditorFilenameExtensions").split("\\s*,\\s*")));
109 
110        /**
111         * A formatted list of supported file extensions, suitable for display.
112         * <!-- begin-user-doc -->
113         * <!-- end-user-doc -->
114         * @generated
115         */
116        public static final String FORMATTED_FILE_EXTENSIONS =
117                DesignDecisionEditorPlugin.INSTANCE.getString("_UI_QualityPropertiesEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", ");
118 
119        /**
120         * This caches an instance of the model package.
121         * <!-- begin-user-doc -->
122         * <!-- end-user-doc -->
123         * @generated
124         */
125        protected QualityPropertiesPackage qualityPropertiesPackage = QualityPropertiesPackage.eINSTANCE;
126 
127        /**
128         * This caches an instance of the model factory.
129         * <!-- begin-user-doc -->
130         * <!-- end-user-doc -->
131         * @generated
132         */
133        protected QualityPropertiesFactory qualityPropertiesFactory = qualityPropertiesPackage.getQualityPropertiesFactory();
134 
135        /**
136         * This is the file creation page.
137         * <!-- begin-user-doc -->
138         * <!-- end-user-doc -->
139         * @generated
140         */
141        protected QualityPropertiesModelWizardNewFileCreationPage newFileCreationPage;
142 
143        /**
144         * This is the initial object creation page.
145         * <!-- begin-user-doc -->
146         * <!-- end-user-doc -->
147         * @generated
148         */
149        protected QualityPropertiesModelWizardInitialObjectCreationPage initialObjectCreationPage;
150 
151        /**
152         * Remember the selection during initialization for populating the default container.
153         * <!-- begin-user-doc -->
154         * <!-- end-user-doc -->
155         * @generated
156         */
157        protected IStructuredSelection selection;
158 
159        /**
160         * Remember the workbench during initialization.
161         * <!-- begin-user-doc -->
162         * <!-- end-user-doc -->
163         * @generated
164         */
165        protected IWorkbench workbench;
166 
167        /**
168         * Caches the names of the types that can be created as the root object.
169         * <!-- begin-user-doc -->
170         * <!-- end-user-doc -->
171         * @generated
172         */
173        protected List<String> initialObjectNames;
174 
175        /**
176         * This just records the information.
177         * <!-- begin-user-doc -->
178         * <!-- end-user-doc -->
179         * @generated
180         */
181        public void init(IWorkbench workbench, IStructuredSelection selection) {
182                this.workbench = workbench;
183                this.selection = selection;
184                setWindowTitle(DesignDecisionEditorPlugin.INSTANCE.getString("_UI_Wizard_label"));
185                setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(DesignDecisionEditorPlugin.INSTANCE.getImage("full/wizban/NewQualityProperties")));
186        }
187 
188        /**
189         * Returns the names of the types that can be created as the root object.
190         * <!-- begin-user-doc -->
191         * <!-- end-user-doc -->
192         * @generated
193         */
194        protected Collection<String> getInitialObjectNames() {
195                if (initialObjectNames == null) {
196                        initialObjectNames = new ArrayList<String>();
197                        for (EClassifier eClassifier : qualityPropertiesPackage.getEClassifiers()) {
198                                if (eClassifier instanceof EClass) {
199                                        EClass eClass = (EClass)eClassifier;
200                                        if (!eClass.isAbstract()) {
201                                                initialObjectNames.add(eClass.getName());
202                                        }
203                                }
204                        }
205                        Collections.sort(initialObjectNames, CommonPlugin.INSTANCE.getComparator());
206                }
207                return initialObjectNames;
208        }
209 
210        /**
211         * Create a new model.
212         * <!-- begin-user-doc -->
213         * <!-- end-user-doc -->
214         * @generated
215         */
216        protected EObject createInitialModel() {
217                EClass eClass = (EClass)qualityPropertiesPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName());
218                EObject rootObject = qualityPropertiesFactory.create(eClass);
219                return rootObject;
220        }
221 
222        /**
223         * Do the work after everything is specified.
224         * <!-- begin-user-doc -->
225         * <!-- end-user-doc -->
226         * @generated
227         */
228        @Override
229        public boolean performFinish() {
230                try {
231                        // Remember the file.
232                        //
233                        final IFile modelFile = getModelFile();
234 
235                        // Do the work within an operation.
236                        //
237                        WorkspaceModifyOperation operation =
238                                new WorkspaceModifyOperation() {
239                                        @Override
240                                        protected void execute(IProgressMonitor progressMonitor) {
241                                                try {
242                                                        // Create a resource set
243                                                        //
244                                                        ResourceSet resourceSet = new ResourceSetImpl();
245 
246                                                        // Get the URI of the model file.
247                                                        //
248                                                        URI fileURI = URI.createPlatformResourceURI(modelFile.getFullPath().toString(), true);
249 
250                                                        // Create a resource for this file.
251                                                        //
252                                                        Resource resource = resourceSet.createResource(fileURI);
253 
254                                                        // Add the initial model object to the contents.
255                                                        //
256                                                        EObject rootObject = createInitialModel();
257                                                        if (rootObject != null) {
258                                                                resource.getContents().add(rootObject);
259                                                        }
260 
261                                                        // Save the contents of the resource to the file system.
262                                                        //
263                                                        Map<Object, Object> options = new HashMap<Object, Object>();
264                                                        options.put(XMLResource.OPTION_ENCODING, initialObjectCreationPage.getEncoding());
265                                                        resource.save(options);
266                                                }
267                                                catch (Exception exception) {
268                                                        DesignDecisionEditorPlugin.INSTANCE.log(exception);
269                                                }
270                                                finally {
271                                                        progressMonitor.done();
272                                                }
273                                        }
274                                };
275 
276                        getContainer().run(false, false, operation);
277 
278                        // Select the new file resource in the current view.
279                        //
280                        IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
281                        IWorkbenchPage page = workbenchWindow.getActivePage();
282                        final IWorkbenchPart activePart = page.getActivePart();
283                        if (activePart instanceof ISetSelectionTarget) {
284                                final ISelection targetSelection = new StructuredSelection(modelFile);
285                                getShell().getDisplay().asyncExec
286                                        (new Runnable() {
287                                                 public void run() {
288                                                         ((ISetSelectionTarget)activePart).selectReveal(targetSelection);
289                                                 }
290                                         });
291                        }
292 
293                        // Open an editor on the new file.
294                        //
295                        try {
296                                page.openEditor
297                                        (new FileEditorInput(modelFile),
298                                         workbench.getEditorRegistry().getDefaultEditor(modelFile.getFullPath().toString()).getId());
299                        }
300                        catch (PartInitException exception) {
301                                MessageDialog.openError(workbenchWindow.getShell(), DesignDecisionEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage());
302                                return false;
303                        }
304 
305                        return true;
306                }
307                catch (Exception exception) {
308                        DesignDecisionEditorPlugin.INSTANCE.log(exception);
309                        return false;
310                }
311        }
312 
313        /**
314         * This is the one page of the wizard.
315         * <!-- begin-user-doc -->
316         * <!-- end-user-doc -->
317         * @generated
318         */
319        public class QualityPropertiesModelWizardNewFileCreationPage extends WizardNewFileCreationPage {
320                /**
321                 * Pass in the selection.
322                 * <!-- begin-user-doc -->
323                 * <!-- end-user-doc -->
324                 * @generated
325                 */
326                public QualityPropertiesModelWizardNewFileCreationPage(String pageId, IStructuredSelection selection) {
327                        super(pageId, selection);
328                }
329 
330                /**
331                 * The framework calls this to see if the file is correct.
332                 * <!-- begin-user-doc -->
333                 * <!-- end-user-doc -->
334                 * @generated
335                 */
336                @Override
337                protected boolean validatePage() {
338                        if (super.validatePage()) {
339                                String extension = new Path(getFileName()).getFileExtension();
340                                if (extension == null || !FILE_EXTENSIONS.contains(extension)) {
341                                        String key = FILE_EXTENSIONS.size() > 1 ? "_WARN_FilenameExtensions" : "_WARN_FilenameExtension";
342                                        setErrorMessage(DesignDecisionEditorPlugin.INSTANCE.getString(key, new Object [] { FORMATTED_FILE_EXTENSIONS }));
343                                        return false;
344                                }
345                                return true;
346                        }
347                        return false;
348                }
349 
350                /**
351                 * <!-- begin-user-doc -->
352                 * <!-- end-user-doc -->
353                 * @generated
354                 */
355                public IFile getModelFile() {
356                        return ResourcesPlugin.getWorkspace().getRoot().getFile(getContainerFullPath().append(getFileName()));
357                }
358        }
359 
360        /**
361         * This is the page where the type of object to create is selected.
362         * <!-- begin-user-doc -->
363         * <!-- end-user-doc -->
364         * @generated
365         */
366        public class QualityPropertiesModelWizardInitialObjectCreationPage extends WizardPage {
367                /**
368                 * <!-- begin-user-doc -->
369                 * <!-- end-user-doc -->
370                 * @generated
371                 */
372                protected Combo initialObjectField;
373 
374                /**
375                 * @generated
376                 * <!-- begin-user-doc -->
377                 * <!-- end-user-doc -->
378                 */
379                protected List<String> encodings;
380 
381                /**
382                 * <!-- begin-user-doc -->
383                 * <!-- end-user-doc -->
384                 * @generated
385                 */
386                protected Combo encodingField;
387 
388                /**
389                 * Pass in the selection.
390                 * <!-- begin-user-doc -->
391                 * <!-- end-user-doc -->
392                 * @generated
393                 */
394                public QualityPropertiesModelWizardInitialObjectCreationPage(String pageId) {
395                        super(pageId);
396                }
397 
398                /**
399                 * <!-- begin-user-doc -->
400                 * <!-- end-user-doc -->
401                 * @generated
402                 */
403                public void createControl(Composite parent) {
404                        Composite composite = new Composite(parent, SWT.NONE); {
405                                GridLayout layout = new GridLayout();
406                                layout.numColumns = 1;
407                                layout.verticalSpacing = 12;
408                                composite.setLayout(layout);
409 
410                                GridData data = new GridData();
411                                data.verticalAlignment = GridData.FILL;
412                                data.grabExcessVerticalSpace = true;
413                                data.horizontalAlignment = GridData.FILL;
414                                composite.setLayoutData(data);
415                        }
416 
417                        Label containerLabel = new Label(composite, SWT.LEFT);
418                        {
419                                containerLabel.setText(DesignDecisionEditorPlugin.INSTANCE.getString("_UI_ModelObject"));
420 
421                                GridData data = new GridData();
422                                data.horizontalAlignment = GridData.FILL;
423                                containerLabel.setLayoutData(data);
424                        }
425 
426                        initialObjectField = new Combo(composite, SWT.BORDER);
427                        {
428                                GridData data = new GridData();
429                                data.horizontalAlignment = GridData.FILL;
430                                data.grabExcessHorizontalSpace = true;
431                                initialObjectField.setLayoutData(data);
432                        }
433 
434                        for (String objectName : getInitialObjectNames()) {
435                                initialObjectField.add(getLabel(objectName));
436                        }
437 
438                        if (initialObjectField.getItemCount() == 1) {
439                                initialObjectField.select(0);
440                        }
441                        initialObjectField.addModifyListener(validator);
442 
443                        Label encodingLabel = new Label(composite, SWT.LEFT);
444                        {
445                                encodingLabel.setText(DesignDecisionEditorPlugin.INSTANCE.getString("_UI_XMLEncoding"));
446 
447                                GridData data = new GridData();
448                                data.horizontalAlignment = GridData.FILL;
449                                encodingLabel.setLayoutData(data);
450                        }
451                        encodingField = new Combo(composite, SWT.BORDER);
452                        {
453                                GridData data = new GridData();
454                                data.horizontalAlignment = GridData.FILL;
455                                data.grabExcessHorizontalSpace = true;
456                                encodingField.setLayoutData(data);
457                        }
458 
459                        for (String encoding : getEncodings()) {
460                                encodingField.add(encoding);
461                        }
462 
463                        encodingField.select(0);
464                        encodingField.addModifyListener(validator);
465 
466                        setPageComplete(validatePage());
467                        setControl(composite);
468                }
469 
470                /**
471                 * <!-- begin-user-doc -->
472                 * <!-- end-user-doc -->
473                 * @generated
474                 */
475                protected ModifyListener validator =
476                        new ModifyListener() {
477                                public void modifyText(ModifyEvent e) {
478                                        setPageComplete(validatePage());
479                                }
480                        };
481 
482                /**
483                 * <!-- begin-user-doc -->
484                 * <!-- end-user-doc -->
485                 * @generated
486                 */
487                protected boolean validatePage() {
488                        return getInitialObjectName() != null && getEncodings().contains(encodingField.getText());
489                }
490 
491                /**
492                 * <!-- begin-user-doc -->
493                 * <!-- end-user-doc -->
494                 * @generated
495                 */
496                @Override
497                public void setVisible(boolean visible) {
498                        super.setVisible(visible);
499                        if (visible) {
500                                if (initialObjectField.getItemCount() == 1) {
501                                        initialObjectField.clearSelection();
502                                        encodingField.setFocus();
503                                }
504                                else {
505                                        encodingField.clearSelection();
506                                        initialObjectField.setFocus();
507                                }
508                        }
509                }
510 
511                /**
512                 * <!-- begin-user-doc -->
513                 * <!-- end-user-doc -->
514                 * @generated
515                 */
516                public String getInitialObjectName() {
517                        String label = initialObjectField.getText();
518 
519                        for (String name : getInitialObjectNames()) {
520                                if (getLabel(name).equals(label)) {
521                                        return name;
522                                }
523                        }
524                        return null;
525                }
526 
527                /**
528                 * <!-- begin-user-doc -->
529                 * <!-- end-user-doc -->
530                 * @generated
531                 */
532                public String getEncoding() {
533                        return encodingField.getText();
534                }
535 
536                /**
537                 * Returns the label for the specified type name.
538                 * <!-- begin-user-doc -->
539                 * <!-- end-user-doc -->
540                 * @generated
541                 */
542                protected String getLabel(String typeName) {
543                        try {
544                                return DesignDecisionEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type");
545                        }
546                        catch(MissingResourceException mre) {
547                                DesignDecisionEditorPlugin.INSTANCE.log(mre);
548                        }
549                        return typeName;
550                }
551 
552                /**
553                 * <!-- begin-user-doc -->
554                 * <!-- end-user-doc -->
555                 * @generated
556                 */
557                protected Collection<String> getEncodings() {
558                        if (encodings == null) {
559                                encodings = new ArrayList<String>();
560                                for (StringTokenizer stringTokenizer = new StringTokenizer(DesignDecisionEditorPlugin.INSTANCE.getString("_UI_XMLEncodingChoices")); stringTokenizer.hasMoreTokens(); ) {
561                                        encodings.add(stringTokenizer.nextToken());
562                                }
563                        }
564                        return encodings;
565                }
566        }
567 
568        /**
569         * The framework calls this to create the contents of the wizard.
570         * <!-- begin-user-doc -->
571         * <!-- end-user-doc -->
572         * @generated
573         */
574                @Override
575        public void addPages() {
576                // Create a page, set the title, and the initial model file name.
577                //
578                newFileCreationPage = new QualityPropertiesModelWizardNewFileCreationPage("Whatever", selection);
579                newFileCreationPage.setTitle(DesignDecisionEditorPlugin.INSTANCE.getString("_UI_QualityPropertiesModelWizard_label"));
580                newFileCreationPage.setDescription(DesignDecisionEditorPlugin.INSTANCE.getString("_UI_QualityPropertiesModelWizard_description"));
581                newFileCreationPage.setFileName(DesignDecisionEditorPlugin.INSTANCE.getString("_UI_QualityPropertiesEditorFilenameDefaultBase") + "." + FILE_EXTENSIONS.get(0));
582                addPage(newFileCreationPage);
583 
584                // Try and get the resource selection to determine a current directory for the file dialog.
585                //
586                if (selection != null && !selection.isEmpty()) {
587                        // Get the resource...
588                        //
589                        Object selectedElement = selection.iterator().next();
590                        if (selectedElement instanceof IResource) {
591                                // Get the resource parent, if its a file.
592                                //
593                                IResource selectedResource = (IResource)selectedElement;
594                                if (selectedResource.getType() == IResource.FILE) {
595                                        selectedResource = selectedResource.getParent();
596                                }
597 
598                                // This gives us a directory...
599                                //
600                                if (selectedResource instanceof IFolder || selectedResource instanceof IProject) {
601                                        // Set this for the container.
602                                        //
603                                        newFileCreationPage.setContainerFullPath(selectedResource.getFullPath());
604 
605                                        // Make up a unique new name here.
606                                        //
607                                        String defaultModelBaseFilename = DesignDecisionEditorPlugin.INSTANCE.getString("_UI_QualityPropertiesEditorFilenameDefaultBase");
608                                        String defaultModelFilenameExtension = FILE_EXTENSIONS.get(0);
609                                        String modelFilename = defaultModelBaseFilename + "." + defaultModelFilenameExtension;
610                                        for (int i = 1; ((IContainer)selectedResource).findMember(modelFilename) != null; ++i) {
611                                                modelFilename = defaultModelBaseFilename + i + "." + defaultModelFilenameExtension;
612                                        }
613                                        newFileCreationPage.setFileName(modelFilename);
614                                }
615                        }
616                }
617                initialObjectCreationPage = new QualityPropertiesModelWizardInitialObjectCreationPage("Whatever2");
618                initialObjectCreationPage.setTitle(DesignDecisionEditorPlugin.INSTANCE.getString("_UI_QualityPropertiesModelWizard_label"));
619                initialObjectCreationPage.setDescription(DesignDecisionEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description"));
620                addPage(initialObjectCreationPage);
621        }
622 
623        /**
624         * Get the file from the page.
625         * <!-- begin-user-doc -->
626         * <!-- end-user-doc -->
627         * @generated
628         */
629        public IFile getModelFile() {
630                return newFileCreationPage.getModelFile();
631        }
632 
633}

[all classes][de.uka.ipd.sdq.pcm.designdecision.QualityProperties.presentation]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov