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 902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
913 }); | 913 }); |
914 | 914 |
915 // find html files for library | 915 // find html files for library |
916 if (getDartProject().exists()) { // will not look into ExternalDartProject | 916 if (getDartProject().exists()) { // will not look into ExternalDartProject |
917 | 917 |
918 HashMap<String, List<String>> mapping; | 918 HashMap<String, List<String>> mapping; |
919 try { | 919 try { |
920 mapping = getDartProject().getHtmlMapping(); | 920 mapping = getDartProject().getHtmlMapping(); |
921 | 921 |
922 final String elementName = getElementName(); | 922 final String elementName = getElementName(); |
923 final String libraryName = new Path(elementName).lastSegment().toString(
); | 923 final String libraryName = getCorrespondingResource().getLocation().toPo
rtableString(); |
924 | 924 |
925 Set<String> keys = mapping.keySet(); | 925 Set<String> keys = mapping.keySet(); |
926 for (String key : keys) { | 926 for (String key : keys) { |
927 List<String> libraries = mapping.get(key); | 927 List<String> libraries = mapping.get(key); |
928 if (libraries.contains(libraryName) || libraries.contains(elementName)
) { | 928 if (libraries.contains(libraryName) || libraries.contains(elementName)
) { |
929 IResource htmlFile = ResourceUtil.getResource(new File(key)); | 929 IResource htmlFile = ResourceUtil.getResource(new File(key)); |
930 if (htmlFile != null & htmlFile.exists()) { | 930 if (htmlFile != null & htmlFile.exists()) { |
931 children.add(new HTMLFileImpl(DartLibraryImpl.this, (IFile) htmlFi
le)); | 931 children.add(new HTMLFileImpl(DartLibraryImpl.this, (IFile) htmlFi
le)); |
932 } | 932 } |
933 } | 933 } |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1167 IFileUtilities.getContents(libraryFile), | 1167 IFileUtilities.getContents(libraryFile), |
1168 null); | 1168 null); |
1169 } | 1169 } |
1170 } catch (Exception exception) { | 1170 } catch (Exception exception) { |
1171 DartCore.logInformation("Could not read and parse the file " + fileName, e
xception); | 1171 DartCore.logInformation("Could not read and parse the file " + fileName, e
xception); |
1172 // Fall through to return null. | 1172 // Fall through to return null. |
1173 } | 1173 } |
1174 return null; | 1174 return null; |
1175 } | 1175 } |
1176 } | 1176 } |
OLD | NEW |