Lines 1-5
Link Here
|
1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2000, 2008 IBM Corporation and others. |
2 |
* Copyright (c) 2000, 2009 IBM Corporation and others. |
3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
Lines 321-327
Link Here
|
321 |
if (entryKind == IClasspathEntry.CPE_CONTAINER) { |
321 |
if (entryKind == IClasspathEntry.CPE_CONTAINER) { |
322 |
// all ClassPathContainers are added later |
322 |
// all ClassPathContainers are added later |
323 |
} else if (fShowLibrariesNode && (entryKind == IClasspathEntry.CPE_LIBRARY || entryKind == IClasspathEntry.CPE_VARIABLE)) { |
323 |
} else if (fShowLibrariesNode && (entryKind == IClasspathEntry.CPE_LIBRARY || entryKind == IClasspathEntry.CPE_VARIABLE)) { |
324 |
// skip: will add the referenced library node later |
324 |
IResource resource= root.getResource(); |
|
|
325 |
if (resource != null && project.getResource().equals(resource.getParent())) { |
326 |
// show resource as child of project, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=141906 |
327 |
result.add(resource); |
328 |
} else { |
329 |
// skip: will add the referenced library node later |
330 |
} |
325 |
} else { |
331 |
} else { |
326 |
if (isProjectPackageFragmentRoot(root)) { |
332 |
if (isProjectPackageFragmentRoot(root)) { |
327 |
// filter out package fragments that correspond to projects and |
333 |
// filter out package fragments that correspond to projects and |
Lines 340-346
Link Here
|
340 |
result.add(new LibraryContainer(project)); |
346 |
result.add(new LibraryContainer(project)); |
341 |
} |
347 |
} |
342 |
|
348 |
|
343 |
// separate loop to make sure all containers are on the classpath |
349 |
// separate loop to make sure all containers are on the classpath (even empty ones) |
344 |
IClasspathEntry[] rawClasspath= project.getRawClasspath(); |
350 |
IClasspathEntry[] rawClasspath= project.getRawClasspath(); |
345 |
for (int i= 0; i < rawClasspath.length; i++) { |
351 |
for (int i= 0; i < rawClasspath.length; i++) { |
346 |
IClasspathEntry classpathEntry= rawClasspath[i]; |
352 |
IClasspathEntry classpathEntry= rawClasspath[i]; |
Lines 634-639
Link Here
|
634 |
if (fViewer.testFindItem(parent) != null) |
640 |
if (fViewer.testFindItem(parent) != null) |
635 |
postRefresh(parent, PARENT, element, runnables); |
641 |
postRefresh(parent, PARENT, element, runnables); |
636 |
return true; |
642 |
return true; |
|
|
643 |
|
644 |
} else if (element instanceof IPackageFragmentRoot) { |
645 |
// PFR can show up twice (in library container and as resource at original location) |
646 |
IResource resource= element.getResource(); |
647 |
if (resource != null) |
648 |
postRemove(resource, runnables); |
637 |
} |
649 |
} |
638 |
|
650 |
|
639 |
postRemove(element, runnables); |
651 |
postRemove(element, runnables); |
Lines 669-674
Link Here
|
669 |
} |
681 |
} |
670 |
return true; |
682 |
return true; |
671 |
} else { |
683 |
} else { |
|
|
684 |
if (element instanceof IPackageFragmentRoot) { |
685 |
// PFR can show up twice (in library container or under project, and as resource at original location) |
686 |
IResource resource= element.getResource(); |
687 |
if (resource != null) { |
688 |
Object resourceParent= super.internalGetParent(resource); |
689 |
if (resourceParent != null) { |
690 |
IJavaProject proj= element.getJavaProject(); |
691 |
if (fShowLibrariesNode || !resourceParent.equals(proj)) { |
692 |
postAdd(resourceParent, resource, runnables); |
693 |
} |
694 |
} |
695 |
} |
696 |
} |
672 |
postAdd(parent, element, runnables); |
697 |
postAdd(parent, element, runnables); |
673 |
} |
698 |
} |
674 |
} |
699 |
} |