mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-29 20:05:35 +02:00
Performance tuning expanding large resource trees
This commit is contained in:
parent
3007736997
commit
4177ecd4aa
1 changed files with 18 additions and 5 deletions
|
@ -16,6 +16,7 @@ import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.eclipse.core.resources.IContainer;
|
||||||
import org.eclipse.core.resources.IFile;
|
import org.eclipse.core.resources.IFile;
|
||||||
import org.eclipse.core.resources.IFolder;
|
import org.eclipse.core.resources.IFolder;
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
|
@ -246,6 +247,18 @@ public class BaseCElementContentProvider implements ITreeContentProvider {
|
||||||
return true;
|
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) {
|
if (element instanceof IParent) {
|
||||||
// when we have C children return true, else we fetch all the children
|
// when we have C children return true, else we fetch all the children
|
||||||
if (((IParent)element).hasChildren()) {
|
if (((IParent)element).hasChildren()) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue