EMMA Coverage Report (generated Sun Feb 05 10:43:15 CET 2012)
[all classes][edu.kit.ipd.sdq.completionfeaturemodel.presentation]

COVERAGE SUMMARY FOR SOURCE FILE [completionfeaturemodelModelWizard.java]

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

COVERAGE BREAKDOWN BY CLASS AND METHOD

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

[all classes][edu.kit.ipd.sdq.completionfeaturemodel.presentation]
EMMA 2.0.9414 (unsupported private build) (C) Vladimir Roubtsov