]>
Commit | Line | Data |
---|---|---|
1b2798f6 EK |
1 | /******************************************************************************* |
2 | * Copyright (c) 2000, 2011 IBM Corporation and others. | |
3 | * All rights reserved. This program and the accompanying materials | |
4 | * are made available under the terms of the Eclipse Public License v1.0 | |
5 | * which accompanies this distribution, and is available at | |
6 | * http://www.eclipse.org/legal/epl-v10.html | |
7 | * | |
8 | * Contributors: | |
9 | * IBM Corporation - initial API and implementation | |
10 | *******************************************************************************/ | |
11 | package org.eclipse.jdt.internal.ui.search; | |
12 | ||
13 | import java.util.ArrayList; | |
14 | import java.util.Arrays; | |
15 | import java.util.Collection; | |
16 | import java.util.HashSet; | |
17 | import java.util.Set; | |
18 | ||
19 | import org.eclipse.swt.widgets.Shell; | |
20 | ||
21 | import org.eclipse.core.runtime.CoreException; | |
22 | import org.eclipse.core.runtime.IAdaptable; | |
23 | import org.eclipse.core.runtime.IPath; | |
24 | ||
25 | import org.eclipse.core.resources.IFolder; | |
26 | import org.eclipse.core.resources.IProject; | |
27 | import org.eclipse.core.resources.IResource; | |
28 | import org.eclipse.core.resources.IWorkspaceRoot; | |
29 | import org.eclipse.core.resources.ResourcesPlugin; | |
30 | ||
31 | import org.eclipse.jface.viewers.ISelection; | |
32 | import org.eclipse.jface.viewers.IStructuredSelection; | |
33 | import org.eclipse.jface.window.Window; | |
34 | ||
35 | import org.eclipse.ui.IEditorInput; | |
36 | import org.eclipse.ui.IWorkingSet; | |
37 | import org.eclipse.ui.PlatformUI; | |
38 | import org.eclipse.ui.dialogs.IWorkingSetSelectionDialog; | |
39 | ||
40 | import org.eclipse.jdt.core.IClasspathContainer; | |
41 | import org.eclipse.jdt.core.IClasspathEntry; | |
42 | import org.eclipse.jdt.core.IJavaElement; | |
43 | import org.eclipse.jdt.core.IJavaProject; | |
44 | import org.eclipse.jdt.core.IPackageFragment; | |
45 | import org.eclipse.jdt.core.IPackageFragmentRoot; | |
46 | import org.eclipse.jdt.core.IType; | |
47 | import org.eclipse.jdt.core.JavaCore; | |
48 | import org.eclipse.jdt.core.JavaModelException; | |
49 | import org.eclipse.jdt.core.search.IJavaSearchScope; | |
50 | import org.eclipse.jdt.core.search.SearchEngine; | |
51 | ||
52 | import org.eclipse.jdt.internal.corext.util.Messages; | |
53 | ||
54 | import org.eclipse.jdt.ui.JavaElementLabels; | |
55 | import org.eclipse.jdt.ui.JavaUI; | |
56 | ||
57 | import org.eclipse.jdt.internal.ui.JavaPlugin; | |
58 | import org.eclipse.jdt.internal.ui.browsing.LogicalPackage; | |
59 | import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels; | |
60 | import org.eclipse.jdt.internal.ui.workingsets.WorkingSetComparator; | |
61 | ||
62 | public class JavaSearchScopeFactory { | |
63 | ||
64 | public static final int JRE= IJavaSearchScope.SYSTEM_LIBRARIES; | |
65 | public static final int LIBS= IJavaSearchScope.APPLICATION_LIBRARIES; | |
66 | public static final int PROJECTS= IJavaSearchScope.REFERENCED_PROJECTS; | |
67 | public static final int SOURCES= IJavaSearchScope.SOURCES; | |
68 | ||
69 | public static final int ALL= JRE | LIBS | PROJECTS | SOURCES; | |
70 | public static final int NO_PROJ= JRE | LIBS | SOURCES; | |
71 | public static final int NO_JRE= LIBS | PROJECTS | SOURCES; | |
72 | public static final int NO_JRE_NO_PROJ= LIBS | PROJECTS | SOURCES; | |
73 | ||
74 | private static JavaSearchScopeFactory fgInstance; | |
75 | private final IJavaSearchScope EMPTY_SCOPE= SearchEngine.createJavaSearchScope(new IJavaElement[] {}); | |
76 | ||
77 | private JavaSearchScopeFactory() { | |
78 | } | |
79 | ||
80 | public static JavaSearchScopeFactory getInstance() { | |
81 | if (fgInstance == null) | |
82 | fgInstance= new JavaSearchScopeFactory(); | |
83 | return fgInstance; | |
84 | } | |
85 | ||
86 | public IWorkingSet[] queryWorkingSets() throws InterruptedException { | |
87 | Shell shell= JavaPlugin.getActiveWorkbenchShell(); | |
88 | if (shell == null) | |
89 | return null; | |
90 | IWorkingSetSelectionDialog dialog= PlatformUI.getWorkbench().getWorkingSetManager().createWorkingSetSelectionDialog(shell, true); | |
91 | if (dialog.open() != Window.OK) { | |
92 | throw new InterruptedException(); | |
93 | } | |
94 | ||
95 | IWorkingSet[] workingSets= dialog.getSelection(); | |
96 | if (workingSets.length > 0) | |
97 | return workingSets; | |
98 | return null; // 'no working set' selected | |
99 | } | |
100 | ||
101 | public IJavaSearchScope createJavaSearchScope(IWorkingSet[] workingSets, boolean includeJRE) { | |
102 | return createJavaSearchScope(workingSets, includeJRE ? ALL : NO_JRE); | |
103 | } | |
104 | ||
105 | public IJavaSearchScope createJavaSearchScope(IWorkingSet[] workingSets, int includeMask) { | |
106 | if (workingSets == null || workingSets.length < 1) | |
107 | return EMPTY_SCOPE; | |
108 | ||
109 | Set<IJavaElement> javaElements= new HashSet<IJavaElement>(workingSets.length * 10); | |
110 | for (int i= 0; i < workingSets.length; i++) { | |
111 | IWorkingSet workingSet= workingSets[i]; | |
112 | if (workingSet.isEmpty() && workingSet.isAggregateWorkingSet()) { | |
113 | return createWorkspaceScope(includeMask); | |
114 | } | |
115 | addJavaElements(javaElements, workingSet); | |
116 | } | |
117 | return createJavaSearchScope(javaElements, includeMask); | |
118 | } | |
119 | ||
120 | public IJavaSearchScope createJavaSearchScope(IWorkingSet workingSet, boolean includeJRE) { | |
121 | return createJavaSearchScope(workingSet, includeJRE ? NO_PROJ : NO_JRE_NO_PROJ); | |
122 | } | |
123 | ||
124 | public IJavaSearchScope createJavaSearchScope(IWorkingSet workingSet, int includeMask) { | |
125 | Set<IJavaElement> javaElements= new HashSet<IJavaElement>(10); | |
126 | if (workingSet.isEmpty() && workingSet.isAggregateWorkingSet()) { | |
127 | return createWorkspaceScope(includeMask); | |
128 | } | |
129 | addJavaElements(javaElements, workingSet); | |
130 | return createJavaSearchScope(javaElements, includeMask); | |
131 | } | |
132 | ||
133 | public IJavaSearchScope createJavaSearchScope(IResource[] resources, boolean includeJRE) { | |
134 | return createJavaSearchScope(resources, includeJRE ? NO_PROJ : NO_JRE_NO_PROJ); | |
135 | } | |
136 | ||
137 | public IJavaSearchScope createJavaSearchScope(IResource[] resources, int includeMask) { | |
138 | if (resources == null) | |
139 | return EMPTY_SCOPE; | |
140 | Set<IJavaElement> javaElements= new HashSet<IJavaElement>(resources.length); | |
141 | addJavaElements(javaElements, resources); | |
142 | return createJavaSearchScope(javaElements, includeMask); | |
143 | } | |
144 | ||
145 | public IJavaSearchScope createJavaSearchScope(ISelection selection, boolean includeJRE) { | |
146 | return createJavaSearchScope(selection, includeJRE ? NO_PROJ : NO_JRE_NO_PROJ); | |
147 | } | |
148 | ||
149 | public IJavaSearchScope createJavaSearchScope(ISelection selection, int includeMask) { | |
150 | return createJavaSearchScope(getJavaElements(selection), includeMask); | |
151 | } | |
152 | ||
153 | public IJavaSearchScope createJavaProjectSearchScope(String[] projectNames, boolean includeJRE) { | |
154 | return createJavaProjectSearchScope(projectNames, includeJRE ? NO_PROJ : NO_JRE_NO_PROJ); | |
155 | } | |
156 | ||
157 | public IJavaSearchScope createJavaProjectSearchScope(String[] projectNames, int includeMask) { | |
158 | ArrayList<IJavaElement> res= new ArrayList<IJavaElement>(); | |
159 | IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot(); | |
160 | for (int i= 0; i < projectNames.length; i++) { | |
161 | IJavaProject project= JavaCore.create(root.getProject(projectNames[i])); | |
162 | if (project.exists()) { | |
163 | res.add(project); | |
164 | } | |
165 | } | |
166 | return createJavaSearchScope(res, includeMask); | |
167 | } | |
168 | ||
169 | public IJavaSearchScope createJavaProjectSearchScope(IJavaProject project, boolean includeJRE) { | |
170 | return createJavaProjectSearchScope(project, includeJRE ? NO_PROJ : NO_JRE_NO_PROJ); | |
171 | } | |
172 | ||
173 | public IJavaSearchScope createJavaProjectSearchScope(IJavaProject project, int includeMask) { | |
174 | return SearchEngine.createJavaSearchScope(new IJavaElement[] { project }, getSearchFlags(includeMask)); | |
175 | } | |
176 | ||
177 | public IJavaSearchScope createJavaProjectSearchScope(IEditorInput editorInput, boolean includeJRE) { | |
178 | return createJavaProjectSearchScope(editorInput, includeJRE ? ALL : NO_JRE); | |
179 | } | |
180 | ||
181 | public IJavaSearchScope createJavaProjectSearchScope(IEditorInput editorInput, int includeMask) { | |
182 | IJavaElement elem= JavaUI.getEditorInputJavaElement(editorInput); | |
183 | if (elem != null) { | |
184 | IJavaProject project= elem.getJavaProject(); | |
185 | if (project != null) { | |
186 | return createJavaProjectSearchScope(project, includeMask); | |
187 | } | |
188 | } | |
189 | return EMPTY_SCOPE; | |
190 | } | |
191 | ||
192 | public String getWorkspaceScopeDescription(boolean includeJRE) { | |
193 | return includeJRE ? SearchMessages.WorkspaceScope : SearchMessages.WorkspaceScopeNoJRE; | |
194 | } | |
195 | ||
196 | public String getWorkspaceScopeDescription(int includeMask) { | |
197 | return getWorkspaceScopeDescription((includeMask & JRE) != 0); | |
198 | } | |
199 | ||
200 | public String getProjectScopeDescription(String[] projectNames, int includeMask) { | |
201 | if (projectNames.length == 0) { | |
202 | return SearchMessages.JavaSearchScopeFactory_undefined_projects; | |
203 | } | |
204 | boolean includeJRE= (includeMask & JRE) != 0; | |
205 | String scopeDescription; | |
206 | if (projectNames.length == 1) { | |
207 | String label= includeJRE ? SearchMessages.EnclosingProjectScope : SearchMessages.EnclosingProjectScopeNoJRE; | |
208 | scopeDescription= Messages.format(label, BasicElementLabels.getJavaElementName(projectNames[0])); | |
209 | } else if (projectNames.length == 2) { | |
210 | String label= includeJRE ? SearchMessages.EnclosingProjectsScope2 : SearchMessages.EnclosingProjectsScope2NoJRE; | |
211 | scopeDescription= Messages.format(label, new String[] { BasicElementLabels.getJavaElementName(projectNames[0]), BasicElementLabels.getJavaElementName(projectNames[1])}); | |
212 | } else { | |
213 | String label= includeJRE ? SearchMessages.EnclosingProjectsScope : SearchMessages.EnclosingProjectsScopeNoJRE; | |
214 | scopeDescription= Messages.format(label, new String[] { BasicElementLabels.getJavaElementName(projectNames[0]), BasicElementLabels.getJavaElementName(projectNames[1])}); | |
215 | } | |
216 | return scopeDescription; | |
217 | } | |
218 | ||
219 | public String getProjectScopeDescription(IJavaProject project, boolean includeJRE) { | |
220 | if (includeJRE) { | |
221 | return Messages.format(SearchMessages.ProjectScope, BasicElementLabels.getJavaElementName(project.getElementName())); | |
222 | } else { | |
223 | return Messages.format(SearchMessages.ProjectScopeNoJRE, BasicElementLabels.getJavaElementName(project.getElementName())); | |
224 | } | |
225 | } | |
226 | ||
227 | public String getProjectScopeDescription(IEditorInput editorInput, boolean includeJRE) { | |
228 | IJavaElement elem= JavaUI.getEditorInputJavaElement(editorInput); | |
229 | if (elem != null) { | |
230 | IJavaProject project= elem.getJavaProject(); | |
231 | if (project != null) { | |
232 | return getProjectScopeDescription(project, includeJRE); | |
233 | } | |
234 | } | |
235 | return Messages.format(SearchMessages.ProjectScope, ""); //$NON-NLS-1$ | |
236 | } | |
237 | ||
238 | public String getHierarchyScopeDescription(IType type) { | |
239 | return Messages.format(SearchMessages.HierarchyScope, new String[] { JavaElementLabels.getElementLabel(type, JavaElementLabels.ALL_DEFAULT) }); | |
240 | } | |
241 | ||
242 | public String getSelectionScopeDescription(IJavaElement[] javaElements, int includeMask) { | |
243 | return getSelectionScopeDescription(javaElements, (includeMask & JRE) != 0); | |
244 | } | |
245 | ||
246 | ||
247 | public String getSelectionScopeDescription(IJavaElement[] javaElements, boolean includeJRE) { | |
248 | if (javaElements.length == 0) { | |
249 | return SearchMessages.JavaSearchScopeFactory_undefined_selection; | |
250 | } | |
251 | String scopeDescription; | |
252 | if (javaElements.length == 1) { | |
253 | String label= includeJRE ? SearchMessages.SingleSelectionScope : SearchMessages.SingleSelectionScopeNoJRE; | |
254 | scopeDescription= Messages.format(label, JavaElementLabels.getElementLabel(javaElements[0], JavaElementLabels.ALL_DEFAULT)); | |
255 | } else if (javaElements.length == 2) { | |
256 | String label= includeJRE ? SearchMessages.DoubleSelectionScope : SearchMessages.DoubleSelectionScopeNoJRE; | |
257 | scopeDescription= Messages.format(label, new String[] { JavaElementLabels.getElementLabel(javaElements[0], JavaElementLabels.ALL_DEFAULT), JavaElementLabels.getElementLabel(javaElements[1], JavaElementLabels.ALL_DEFAULT)}); | |
258 | } else { | |
259 | String label= includeJRE ? SearchMessages.SelectionScope : SearchMessages.SelectionScopeNoJRE; | |
260 | scopeDescription= Messages.format(label, new String[] { JavaElementLabels.getElementLabel(javaElements[0], JavaElementLabels.ALL_DEFAULT), JavaElementLabels.getElementLabel(javaElements[1], JavaElementLabels.ALL_DEFAULT)}); | |
261 | } | |
262 | return scopeDescription; | |
263 | } | |
264 | ||
265 | public String getWorkingSetScopeDescription(IWorkingSet[] workingSets, int includeMask) { | |
266 | return getWorkingSetScopeDescription(workingSets, (includeMask & JRE) != 0); | |
267 | } | |
268 | ||
269 | public String getWorkingSetScopeDescription(IWorkingSet[] workingSets, boolean includeJRE) { | |
270 | if (workingSets.length == 0) { | |
271 | return SearchMessages.JavaSearchScopeFactory_undefined_workingsets; | |
272 | } | |
273 | if (workingSets.length == 1) { | |
274 | String label= includeJRE ? SearchMessages.SingleWorkingSetScope : SearchMessages.SingleWorkingSetScopeNoJRE; | |
275 | return Messages.format(label, BasicElementLabels.getWorkingSetLabel(workingSets[0])); | |
276 | } | |
277 | Arrays.sort(workingSets, new WorkingSetComparator()); | |
278 | if (workingSets.length == 2) { | |
279 | String label= includeJRE ? SearchMessages.DoubleWorkingSetScope : SearchMessages.DoubleWorkingSetScopeNoJRE; | |
280 | return Messages.format(label, new String[] { BasicElementLabels.getWorkingSetLabel(workingSets[0]), BasicElementLabels.getWorkingSetLabel(workingSets[1])}); | |
281 | } | |
282 | String label= includeJRE ? SearchMessages.WorkingSetsScope : SearchMessages.WorkingSetsScopeNoJRE; | |
283 | return Messages.format(label, new String[] { BasicElementLabels.getWorkingSetLabel(workingSets[0]), BasicElementLabels.getWorkingSetLabel(workingSets[1])}); | |
284 | } | |
285 | ||
286 | public IProject[] getProjects(IJavaSearchScope scope) { | |
287 | IPath[] paths= scope.enclosingProjectsAndJars(); | |
288 | HashSet<IResource> temp= new HashSet<IResource>(); | |
289 | for (int i= 0; i < paths.length; i++) { | |
290 | IResource resource= ResourcesPlugin.getWorkspace().getRoot().findMember(paths[i]); | |
291 | if (resource != null && resource.getType() == IResource.PROJECT) | |
292 | temp.add(resource); | |
293 | } | |
294 | return temp.toArray(new IProject[temp.size()]); | |
295 | } | |
296 | ||
297 | public IJavaElement[] getJavaElements(ISelection selection) { | |
298 | if (selection instanceof IStructuredSelection && !selection.isEmpty()) { | |
299 | return getJavaElements(((IStructuredSelection)selection).toArray()); | |
300 | } else { | |
301 | return new IJavaElement[0]; | |
302 | } | |
303 | } | |
304 | ||
305 | private IJavaElement[] getJavaElements(Object[] elements) { | |
306 | if (elements.length == 0) | |
307 | return new IJavaElement[0]; | |
308 | ||
309 | Set<IJavaElement> result= new HashSet<IJavaElement>(elements.length); | |
310 | for (int i= 0; i < elements.length; i++) { | |
311 | Object selectedElement= elements[i]; | |
312 | if (selectedElement instanceof IJavaElement) { | |
313 | addJavaElements(result, (IJavaElement) selectedElement); | |
314 | } else if (selectedElement instanceof IResource) { | |
315 | addJavaElements(result, (IResource) selectedElement); | |
316 | } else if (selectedElement instanceof LogicalPackage) { | |
317 | addJavaElements(result, (LogicalPackage) selectedElement); | |
318 | } else if (selectedElement instanceof IWorkingSet) { | |
319 | IWorkingSet ws= (IWorkingSet)selectedElement; | |
320 | addJavaElements(result, ws); | |
321 | } else if (selectedElement instanceof IAdaptable) { | |
322 | IResource resource= (IResource) ((IAdaptable) selectedElement).getAdapter(IResource.class); | |
323 | if (resource != null) | |
324 | addJavaElements(result, resource); | |
325 | } | |
326 | ||
327 | } | |
328 | return result.toArray(new IJavaElement[result.size()]); | |
329 | } | |
330 | ||
331 | public IJavaSearchScope createJavaSearchScope(IJavaElement[] javaElements, boolean includeJRE) { | |
332 | return createJavaSearchScope(javaElements, includeJRE ? NO_PROJ : NO_JRE_NO_PROJ); | |
333 | } | |
334 | ||
335 | public IJavaSearchScope createJavaSearchScope(IJavaElement[] javaElements, int includeMask) { | |
336 | if (javaElements.length == 0) | |
337 | return EMPTY_SCOPE; | |
338 | return SearchEngine.createJavaSearchScope(javaElements, getSearchFlags(includeMask)); | |
339 | } | |
340 | ||
341 | private IJavaSearchScope createJavaSearchScope(Collection<IJavaElement> javaElements, int includeMask) { | |
342 | if (javaElements.isEmpty()) | |
343 | return EMPTY_SCOPE; | |
344 | IJavaElement[] elementArray= javaElements.toArray(new IJavaElement[javaElements.size()]); | |
345 | return SearchEngine.createJavaSearchScope(elementArray, getSearchFlags(includeMask)); | |
346 | } | |
347 | ||
348 | private static int getSearchFlags(int includeMask) { | |
349 | return includeMask; | |
350 | } | |
351 | ||
352 | private void addJavaElements(Set<IJavaElement> javaElements, IResource[] resources) { | |
353 | for (int i= 0; i < resources.length; i++) | |
354 | addJavaElements(javaElements, resources[i]); | |
355 | } | |
356 | ||
357 | private void addJavaElements(Set<IJavaElement> javaElements, IResource resource) { | |
358 | IJavaElement javaElement= (IJavaElement)resource.getAdapter(IJavaElement.class); | |
359 | if (javaElement == null) | |
360 | // not a Java resource | |
361 | return; | |
362 | ||
363 | if (javaElement.getElementType() == IJavaElement.PACKAGE_FRAGMENT) { | |
364 | // add other possible package fragments | |
365 | try { | |
366 | addJavaElements(javaElements, ((IFolder)resource).members()); | |
367 | } catch (CoreException ex) { | |
368 | // don't add elements | |
369 | } | |
370 | } | |
371 | ||
372 | javaElements.add(javaElement); | |
373 | } | |
374 | ||
375 | private void addJavaElements(Set<IJavaElement> javaElements, IJavaElement javaElement) { | |
376 | javaElements.add(javaElement); | |
377 | } | |
378 | ||
379 | private void addJavaElements(Set<IJavaElement> javaElements, IWorkingSet workingSet) { | |
380 | if (workingSet == null) | |
381 | return; | |
382 | ||
383 | if (workingSet.isAggregateWorkingSet() && workingSet.isEmpty()) { | |
384 | try { | |
385 | IJavaProject[] projects= JavaCore.create(ResourcesPlugin.getWorkspace().getRoot()).getJavaProjects(); | |
386 | javaElements.addAll(Arrays.asList(projects)); | |
387 | } catch (JavaModelException e) { | |
388 | JavaPlugin.log(e); | |
389 | } | |
390 | return; | |
391 | } | |
392 | ||
393 | IAdaptable[] elements= workingSet.getElements(); | |
394 | for (int i= 0; i < elements.length; i++) { | |
395 | IJavaElement javaElement=(IJavaElement) elements[i].getAdapter(IJavaElement.class); | |
396 | if (javaElement != null) { | |
397 | addJavaElements(javaElements, javaElement); | |
398 | continue; | |
399 | } | |
400 | IResource resource= (IResource)elements[i].getAdapter(IResource.class); | |
401 | if (resource != null) { | |
402 | addJavaElements(javaElements, resource); | |
403 | } | |
404 | ||
405 | // else we don't know what to do with it, ignore. | |
406 | } | |
407 | } | |
408 | ||
409 | private void addJavaElements(Set<IJavaElement> javaElements, LogicalPackage selectedElement) { | |
410 | IPackageFragment[] packages= selectedElement.getFragments(); | |
411 | for (int i= 0; i < packages.length; i++) | |
412 | addJavaElements(javaElements, packages[i]); | |
413 | } | |
414 | ||
415 | public IJavaSearchScope createWorkspaceScope(boolean includeJRE) { | |
416 | return createWorkspaceScope(includeJRE ? ALL : NO_JRE); | |
417 | } | |
418 | ||
419 | public IJavaSearchScope createWorkspaceScope(int includeMask) { | |
420 | if ((includeMask & NO_PROJ) != NO_PROJ) { | |
421 | try { | |
422 | IJavaProject[] projects= JavaCore.create(ResourcesPlugin.getWorkspace().getRoot()).getJavaProjects(); | |
423 | return SearchEngine.createJavaSearchScope(projects, getSearchFlags(includeMask)); | |
424 | } catch (JavaModelException e) { | |
425 | // ignore, use workspace scope instead | |
426 | } | |
427 | } | |
428 | return SearchEngine.createWorkspaceScope(); | |
429 | } | |
430 | ||
431 | public boolean isInsideJRE(IJavaElement element) { | |
432 | IPackageFragmentRoot root= (IPackageFragmentRoot) element.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT); | |
433 | if (root != null) { | |
434 | try { | |
435 | IClasspathEntry entry= root.getRawClasspathEntry(); | |
436 | if (entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) { | |
437 | IClasspathContainer container= JavaCore.getClasspathContainer(entry.getPath(), root.getJavaProject()); | |
438 | return container != null && container.getKind() == IClasspathContainer.K_DEFAULT_SYSTEM; | |
439 | } | |
440 | return false; | |
441 | } catch (JavaModelException e) { | |
442 | JavaPlugin.log(e); | |
443 | } | |
444 | } | |
445 | return true; // include JRE in doubt | |
446 | } | |
447 | } |