1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Performance tuning expanding large resource trees

This commit is contained in:
Anton Leherbauer 2008-05-20 12:43:36 +00:00
parent 3007736997
commit 4177ecd4aa

View file

@ -16,6 +16,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
@ -246,6 +247,18 @@ public class BaseCElementContentProvider implements ITreeContentProvider {
return true;
}
if (element instanceof ICContainer) {
ICContainer container= (ICContainer)element;
IResource resource= container.getResource();
if (resource instanceof IContainer) {
try {
return ((IContainer)resource).members().length > 0;
} catch (CoreException exc) {
return false;
}
}
}
if (element instanceof IParent) {
// when we have C children return true, else we fetch all the children
if (((IParent)element).hasChildren()) {