Lines 75-83
Link Here
|
75 |
throw new IllegalStateException("given file is not eclipse .project file"); // NOI18N |
75 |
throw new IllegalStateException("given file is not eclipse .project file"); // NOI18N |
76 |
} |
76 |
} |
77 |
|
77 |
|
78 |
Element naturesEl = Util.findElement(projectDescriptionEl, "natures", null); // NOI18N |
78 |
Element naturesEl = XMLUtil.findElement(projectDescriptionEl, "natures", null); // NOI18N |
79 |
if (naturesEl != null) { |
79 |
if (naturesEl != null) { |
80 |
List<Element> natureEls = Util.findSubElements(naturesEl); |
80 |
List<Element> natureEls = XMLUtil.findSubElements(naturesEl); |
81 |
if (natureEls != null) { |
81 |
if (natureEls != null) { |
82 |
for (Element nature : natureEls) { |
82 |
for (Element nature : natureEls) { |
83 |
natures.add(nature.getTextContent()); |
83 |
natures.add(nature.getTextContent()); |
Lines 85-114
Link Here
|
85 |
} |
85 |
} |
86 |
} |
86 |
} |
87 |
|
87 |
|
88 |
Element linksEl = Util.findElement(projectDescriptionEl, "linkedResources", null); // NOI18N |
88 |
Element linksEl = XMLUtil.findElement(projectDescriptionEl, "linkedResources", null); // NOI18N |
89 |
if (linksEl != null) { |
89 |
if (linksEl != null) { |
90 |
List<Element> linkEls = Util.findSubElements(linksEl); |
90 |
List<Element> linkEls = XMLUtil.findSubElements(linksEl); |
91 |
if (linkEls != null) { |
91 |
if (linkEls != null) { |
92 |
for (Element link : linkEls) { |
92 |
for (Element link : linkEls) { |
93 |
Element locationElement = Util.findElement(link, "location", null); // NOI18N |
93 |
Element locationElement = XMLUtil.findElement(link, "location", null); // NOI18N |
94 |
String loc; |
94 |
String loc; |
95 |
if (locationElement == null) { |
95 |
if (locationElement == null) { |
96 |
assert Util.findElement(link, "locationURI", null) != null : Util.findSubElements(link); // NOI18N |
96 |
assert XMLUtil.findElement(link, "locationURI", null) != null : XMLUtil.findSubElements(link); // NOI18N |
97 |
// XXX external source root can be defined using IDE variable. For some reason (in Eclipse) |
97 |
// XXX external source root can be defined using IDE variable. For some reason (in Eclipse) |
98 |
// these variables are stored/managed separately from variables which can be used |
98 |
// these variables are stored/managed separately from variables which can be used |
99 |
// in classpath. For now these variables are not transfer to NetBeans and normalized |
99 |
// in classpath. For now these variables are not transfer to NetBeans and normalized |
100 |
// path will be returned instead. |
100 |
// path will be returned instead. |
101 |
loc = resolveLink(Util.findElement(link, "locationURI", null).getTextContent(), variables); // NOI18N |
101 |
loc = resolveLink(XMLUtil.findElement(link, "locationURI", null).getTextContent(), variables); // NOI18N |
102 |
} else { |
102 |
} else { |
103 |
loc = locationElement.getTextContent(); |
103 |
loc = locationElement.getTextContent(); |
104 |
} |
104 |
} |
105 |
links.add(new Link(Util.findElement(link, "name", null).getTextContent(), // NOI18N |
105 |
links.add(new Link(XMLUtil.findElement(link, "name", null).getTextContent(), // NOI18N |
106 |
"1".equals(Util.findElement(link, "type", null).getTextContent()), // NOI18N |
106 |
"1".equals(XMLUtil.findElement(link, "type", null).getTextContent()), // NOI18N |
107 |
loc)); |
107 |
loc)); |
108 |
} |
108 |
} |
109 |
} |
109 |
} |
110 |
} |
110 |
} |
111 |
return Util.findElement(projectDescriptionEl, "name", null).getTextContent(); //NOI18N |
111 |
return XMLUtil.findElement(projectDescriptionEl, "name", null).getTextContent(); //NOI18N |
112 |
} |
112 |
} |
113 |
|
113 |
|
114 |
public static Facets readProjectFacets(File projectDir, Set<String> natures) throws IOException { |
114 |
public static Facets readProjectFacets(File projectDir, Set<String> natures) throws IOException { |
Lines 132-138
Link Here
|
132 |
} |
132 |
} |
133 |
|
133 |
|
134 |
List<Facets.Facet> facets = new ArrayList<Facets.Facet>(); |
134 |
List<Facets.Facet> facets = new ArrayList<Facets.Facet>(); |
135 |
List<Element> elements = Util.findSubElements(root); |
135 |
List<Element> elements = XMLUtil.findSubElements(root); |
136 |
for (Element element : elements) { |
136 |
for (Element element : elements) { |
137 |
if (!"installed".equals(element.getNodeName())) { // NOI18N |
137 |
if (!"installed".equals(element.getNodeName())) { // NOI18N |
138 |
continue; |
138 |
continue; |