mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-05 16:56:04 +02:00
make getChildren() a synchronous
and getBinaries synchronous. Change the provider.
This commit is contained in:
parent
121377b097
commit
8e1114ed84
1 changed files with 4 additions and 16 deletions
|
@ -121,22 +121,10 @@ public class BaseCElementContentProvider implements ITreeContentProvider {
|
||||||
ICElement[] children = ((IParent)celement).getChildren();
|
ICElement[] children = ((IParent)celement).getChildren();
|
||||||
ArrayList list = new ArrayList(children.length);
|
ArrayList list = new ArrayList(children.length);
|
||||||
for( int i = 0; i < children.length; i++ ) {
|
for( int i = 0; i < children.length; i++ ) {
|
||||||
// Note, here we are using getBinaries() and getArchives()
|
// Note, here we are starting the Archive and binary containers thread upfront.
|
||||||
// instead. Those methods are async and they start threads
|
if (children[i] instanceof IArchiveContainer || children[i] instanceof IBinaryContainer) {
|
||||||
// in the background. This will not freeze the viewer
|
((IParent)children[i]).getChildren();
|
||||||
// But we should note that the user should add itself to
|
continue;
|
||||||
// the listener of the Core Model so when the threads discover
|
|
||||||
// new binaries/archives to get notification.
|
|
||||||
if (children[i] instanceof IArchiveContainer) {
|
|
||||||
IArchiveContainer carchive = (IArchiveContainer)children[i];
|
|
||||||
if (carchive.getArchives().length == 0) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
} else if (children[i] instanceof IBinaryContainer) {
|
|
||||||
IBinaryContainer cbin = (IBinaryContainer)children[i];
|
|
||||||
if (cbin.getBinaries().length == 0) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
list.add(children[i]);
|
list.add(children[i]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue