OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012, the Dart project authors. | 2 * Copyright (c) 2012, the Dart project authors. |
3 * | 3 * |
4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u
se this file except | 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u
se this file except |
5 * in compliance with the License. You may obtain a copy of the License at | 5 * in compliance with the License. You may obtain a copy of the License at |
6 * | 6 * |
7 * http://www.eclipse.org/legal/epl-v10.html | 7 * http://www.eclipse.org/legal/epl-v10.html |
8 * | 8 * |
9 * Unless required by applicable law or agreed to in writing, software distribut
ed under the License | 9 * Unless required by applicable law or agreed to in writing, software distribut
ed under the License |
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K
IND, either express | 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K
IND, either express |
(...skipping 24 matching lines...) Expand all Loading... |
35 public class CreateFileWizardPage extends WizardNewFileCreationPage { | 35 public class CreateFileWizardPage extends WizardNewFileCreationPage { |
36 | 36 |
37 public CreateFileWizardPage(String pageName, IStructuredSelection selection) { | 37 public CreateFileWizardPage(String pageName, IStructuredSelection selection) { |
38 super(pageName, selection); | 38 super(pageName, selection); |
39 } | 39 } |
40 | 40 |
41 @Override | 41 @Override |
42 public IFile createNewFile() { | 42 public IFile createNewFile() { |
43 | 43 |
44 String fileName = getFileName().trim(); | 44 String fileName = getFileName().trim(); |
45 if (fileName.indexOf(".") == -1) { //$NON-NLS-1$ | 45 if (fileName.indexOf(".") == -1 && !fileName.equals("BUILD")) { //$NON-NLS-1
$ |
46 setFileName(fileName + ".dart"); //$NON-NLS-1$ | 46 setFileName(fileName + ".dart"); //$NON-NLS-1$ |
47 } | 47 } |
48 | 48 |
49 return super.createNewFile(); | 49 return super.createNewFile(); |
50 } | 50 } |
51 | 51 |
52 @Override | 52 @Override |
53 protected void createAdvancedControls(Composite parent) { | 53 protected void createAdvancedControls(Composite parent) { |
54 //no-op to ensure we don't get silly resource linking options | 54 //no-op to ensure we don't get silly resource linking options |
55 } | 55 } |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 && (StringUtilities.containsUpperCase(fileName) || StringUtilities.conta
insWhitespace(fileName))) { | 94 && (StringUtilities.containsUpperCase(fileName) || StringUtilities.conta
insWhitespace(fileName))) { |
95 setMessage( | 95 setMessage( |
96 ProjectMessages.CreateFileWizardPage_filename_content_warning_label, | 96 ProjectMessages.CreateFileWizardPage_filename_content_warning_label, |
97 IMessageProvider.WARNING); | 97 IMessageProvider.WARNING); |
98 } | 98 } |
99 | 99 |
100 return true; | 100 return true; |
101 } | 101 } |
102 | 102 |
103 } | 103 } |
OLD | NEW |