OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014, the Dart project authors. | 2 * Copyright (c) 2014, 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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 return absoluteFile.toURI().toString(); | 290 return absoluteFile.toURI().toString(); |
291 } | 291 } |
292 } | 292 } |
293 } | 293 } |
294 return null; | 294 return null; |
295 } | 295 } |
296 | 296 |
297 private String resolveRelativePath(String url) { | 297 private String resolveRelativePath(String url) { |
298 if (container != null) { | 298 if (container != null) { |
299 IResource file = container.findMember(url); | 299 IResource file = container.findMember(url); |
| 300 if (file == null) { |
| 301 file = container.getProject().findMember(url); |
| 302 } |
300 if (file != null) { | 303 if (file != null) { |
301 return file.getLocation().toOSString(); | 304 return file.getLocation().toOSString(); |
302 } | 305 } |
303 } | 306 } |
304 return null; | 307 return null; |
305 } | 308 } |
306 | 309 |
307 private String returnAbsoluteOrRelative(String path) { | 310 private String returnAbsoluteOrRelative(String path) { |
308 // If path exists, return that. | 311 // If path exists, return that. |
309 File file = new File(path); | 312 File file = new File(path); |
(...skipping 12 matching lines...) Expand all Loading... |
322 return resource.getLocation().toFile().getAbsolutePath(); | 325 return resource.getLocation().toFile().getAbsolutePath(); |
323 } | 326 } |
324 index = path.indexOf('/', index + 1); | 327 index = path.indexOf('/', index + 1); |
325 } | 328 } |
326 } | 329 } |
327 | 330 |
328 // Else, return the original path. | 331 // Else, return the original path. |
329 return path; | 332 return path; |
330 } | 333 } |
331 } | 334 } |
OLD | NEW |