Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(484)

Side by Side Diff: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/projects/CreateFileWizardPage.java

Issue 344033003: do not add extension for file name (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698