1 | public class Ecore2EcoreModelWizardNewFileCreationPage extends WizardNewFileCreationPage↵ | | 1 | public class Ecore2XMLModelWizardNewFileCreationPage extends WizardNewFileCreationPage↵
|
2 | {↵ | | 2 | {↵
|
3 | /**↵ | | 3 | /**↵
|
4 | * Pass in the selection.↵ | | 4 | * Pass in the selection.↵
|
5 | * <!-- begin-user-doc -->↵ | | 5 | * <!-- begin-user-doc -->↵
|
6 | * <!-- end-user-doc -->↵ | | 6 | * <!-- end-user-doc -->↵
|
7 | * @generated↵ | | 7 | * @generated↵
|
8 | */↵ | | 8 | */↵
|
9 | public Ecore2EcoreModelWizardNewFileCreationPage(String pageId, IStructuredSelection selection)↵ | | 9 | public Ecore2XMLModelWizardNewFileCreationPage(String pageId, IStructuredSelection selection)↵
|
10 | {↵ | | 10 | {↵
|
11 | super(pageId, selection);↵ | | 11 | super(pageId, selection);↵
|
12 | }↵ | | 12 | }↵
|
|
13 | /**↵ | | 13 | /**↵
|
14 | * The framework calls this to see if the file is correct.↵ | | 14 | * The framework calls this to see if the file is correct.↵
|
15 | * <!-- begin-user-doc -->↵ | | 15 | * <!-- begin-user-doc -->↵
|
16 | * <!-- end-user-doc -->↵ | | 16 | * <!-- end-user-doc -->↵
|
17 | * @generated↵ | | 17 | * @generated↵
|
18 | */↵ | | 18 | */↵
|
19 | @Override↵ | | 19 | @Override↵
|
20 | protected boolean validatePage()↵ | | 20 | protected boolean validatePage()↵
|
21 | {↵ | | 21 | {↵
|
22 | if (super.validatePage())↵ | | 22 | if (super.validatePage())↵
|
23 | {↵ | | 23 | {↵
|
24 | String extension = new Path(getFileName()).getFileExtension();↵ | | 24 | String extension = new Path(getFileName()).getFileExtension();↵
|
25 | if (extension == null || !FILE_EXTENSIONS.contains(extension))↵ | | 25 | if (extension == null || !FILE_EXTENSIONS.contains(extension))↵
|
26 | {↵ | | 26 | {↵
|
27 | String key = FILE_EXTENSIONS.size() > 1 ? "_WARN_FilenameExtensions" : "_WARN_FilenameExtension";↵ | | 27 | String key = FILE_EXTENSIONS.size() > 1 ? "_WARN_FilenameExtensions" : "_WARN_FilenameExtension"; //$NON-NLS-1$ //$NON-NLS-2$↵
|
28 | setErrorMessage(Ecore2EcoreEditorPlugin.INSTANCE.getString(key, new Object [] { FORMATTED_FILE_EXTENSIONS }));↵ | | 28 | setErrorMessage(Ecore2XMLUIPlugin.INSTANCE.getString(key, new Object [] { FORMATTED_FILE_EXTENSIONS }));↵
|
29 | return false;↵ | | 29 | return false;↵
|
30 | }↵ | | 30 | }↵
|
31 | return true;↵ | | 31 | return true;↵
|
32 | }↵ | | 32 | }↵
|
33 | return false;↵ | | 33 | return false;↵
|
34 | }↵ | | 34 | }↵
|
|
35 | /**↵ | | 35 | /**↵
|
36 | * <!-- begin-user-doc -->↵ | | 36 | * <!-- begin-user-doc -->↵
|
37 | * <!-- end-user-doc -->↵ | | 37 | * <!-- end-user-doc -->↵
|
38 | * @generated↵ | | 38 | * @generated↵
|
39 | */↵ | | 39 | */↵
|
40 | public IFile getModelFile()↵ | | 40 | public IFile getModelFile()↵
|
41 | {↵ | | 41 | {↵
|
42 | return ResourcesPlugin.getWorkspace().getRoot().getFile(getContainerFullPath().append(getFileName()));↵ | | 42 | return ResourcesPlugin.getWorkspace().getRoot().getFile(getContainerFullPath().append(getFileName()));↵
|
43 | | | 43 |
|