View | Details | Raw Unified | Return to bug 141906
Collapse All | Expand All

(-)ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerContentProvider.java (-3 / +28 lines)
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
		}
(-)ui/org/eclipse/jdt/ui/StandardJavaElementContentProvider.java (-2 / +9 lines)
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 334-340 Link Here
334
	/**
334
	/**
335
	 * Evaluates all children of a given {@link IFolder}. Clients can override this method.
335
	 * Evaluates all children of a given {@link IFolder}. Clients can override this method.
336
	 * @param folder The folder to evaluate the children for.
336
	 * @param folder The folder to evaluate the children for.
337
	 * @return The children of the given package fragment.
337
	 * @return The children of the given folder.
338
	 * @exception CoreException if the folder does not exist.
338
	 * @exception CoreException if the folder does not exist.
339
	 *
339
	 *
340
	 * @since 3.3
340
	 * @since 3.3
Lines 359-364 Link Here
359
				}
359
				}
360
			} else if (!javaProject.isOnClasspath(member)) {
360
			} else if (!javaProject.isOnClasspath(member)) {
361
				nonJavaResources.add(member);
361
				nonJavaResources.add(member);
362
			} else {
363
				IJavaElement element= JavaCore.create(member, javaProject);
364
				if (element instanceof IPackageFragmentRoot
365
						&& javaProject.equals(element.getJavaProject())) {
366
					// don't skip PFRs on the classpath of their project
367
					nonJavaResources.add(member);
368
				}
362
			}
369
			}
363
		}
370
		}
364
		return nonJavaResources.toArray();
371
		return nonJavaResources.toArray();

Return to bug 141906