summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoopur Gupta2013-01-14 05:13:12 (EST)
committerDani Megert2013-01-14 05:13:12 (EST)
commit1843abac02e5aa418cf51d7874e53fef99c1ffc2 (patch)
tree71593251cb273b75dd84e7615396e2ab2cdb35f3
parent1eb4ac014de23c6931919520c6a4b755a59833ad (diff)
downloadeclipse.jdt.ui-1843abac02e5aa418cf51d7874e53fef99c1ffc2.zip
eclipse.jdt.ui-1843abac02e5aa418cf51d7874e53fef99c1ffc2.tar.gz
eclipse.jdt.ui-1843abac02e5aa418cf51d7874e53fef99c1ffc2.tar.bz2
Fixed bug 357450: Class folder in Java project have refresh problem
-rw-r--r--org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerContentProvider.java19
1 files changed, 14 insertions, 5 deletions
diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerContentProvider.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerContentProvider.java
index 27d2e91..462432b 100644
--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerContentProvider.java
+++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerContentProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -723,10 +723,19 @@ public class PackageExplorerContentProvider extends StandardJavaElementContentPr
postRefresh(element, ORIGINAL, element, runnables);
return false;
}
- if ((flags & (IJavaElementDelta.F_CONTENT | IJavaElementDelta.F_CHILDREN)) == IJavaElementDelta.F_CONTENT) {
- // TODO: This should never be true for folders (F_CONTENT is only for files)
- // content change, without children info (for example resource added/removed to class folder package)
- postRefresh(internalGetParent(element), PARENT, element, runnables);
+ // http://bugs.eclipse.org/bugs/show_bug.cgi?id=357450
+ int result= flags & (IJavaElementDelta.F_CONTENT | IJavaElementDelta.F_CHILDREN);
+ if (result == IJavaElementDelta.F_CONTENT || result == IJavaElementDelta.F_CHILDREN) {
+ Object parent= internalGetParent(element);
+ postRefresh(parent, PARENT, element, runnables);
+ if (parent instanceof LibraryContainer) {
+ IResource resource= element.getResource();
+ if (resource != null) {
+ if (((LibraryContainer) parent).getJavaProject().getResource().equals(resource.getProject())) {
+ postRefresh(resource, ORIGINAL, element, runnables);
+ }
+ }
+ }
return true;
}