this.currentElement = null;
// get the workspace delta, and start processing there.
IResourceDelta[] deltas = changes.getAffectedChildren(IResourceDelta.ADDED | IResourceDelta.REMOVED | IResourceDelta.CHANGED, IContainer.INCLUDE_HIDDEN);
for (int i = 0; i < deltas.length; i++) {
IResourceDelta delta = deltas[i];
IResource res = delta.getResource();
// find out the element type
RootInfo rootInfo = null;
int elementType;
IProject proj = (IProject)res;
boolean wasJavaProject = this.state.findJavaProject(proj.getName()) != null;
boolean isJavaProject = JavaProject.hasJavaNature(proj);
if (!wasJavaProject && !isJavaProject) {
elementType = NON_JAVA_RESOURCE;
} else {
IPath rootPath = externalPath(res);
rootInfo = enclosingRootInfo(rootPath, delta.getKind());
if (rootInfo != null && rootInfo.isRootOfProject(rootPath)) {
elementType = IJavaElement.PACKAGE_FRAGMENT_ROOT;
} else {
elementType = IJavaElement.JAVA_PROJECT;
}
}
// traverse delta
traverseDelta(delta, elementType, rootInfo, null);
if (elementType == NON_JAVA_RESOURCE
|| (wasJavaProject != isJavaProject && (delta.getKind()) == IResourceDelta.CHANGED)) { // project has changed nature (description or open/closed)
try {
// add child as non java resource
nonJavaResourcesChanged((JavaModel)model, delta);
} catch (JavaModelException e) {
// java model could not be opened