mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-28 11:25:35 +02:00
[187732] for refreshing a deleted container - do a requery to make sure we have an uptodate object before determining whether it's a container or not..if it's deleted, it won't have children and we can refresh it's parent
This commit is contained in:
parent
bcf9a1c7b8
commit
835a63b776
1 changed files with 33 additions and 0 deletions
|
@ -2105,6 +2105,39 @@ public class SystemView extends SafeTreeViewer
|
||||||
// make the src the parent of the src
|
// make the src the parent of the src
|
||||||
src = adapter.getParent(src);
|
src = adapter.getParent(src);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// get up-to-date version of the container (need to make sure it still exists)
|
||||||
|
if (ss == null)
|
||||||
|
{
|
||||||
|
ss = adapter.getSubSystem(src);
|
||||||
|
}
|
||||||
|
if (ss != null)
|
||||||
|
{
|
||||||
|
String key = adapter.getAbsoluteName(src);
|
||||||
|
if (key != null)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Object srcParent = adapter.getParent(src); // get parent before we query
|
||||||
|
// because if after query src doesn't exist,
|
||||||
|
// we can't get parent
|
||||||
|
|
||||||
|
src = ss.getObjectWithAbsoluteName(key);
|
||||||
|
hasChildren = adapter.hasChildren((IAdaptable)src);
|
||||||
|
if (!hasChildren)
|
||||||
|
{
|
||||||
|
// make the src the parent of the src
|
||||||
|
src = srcParent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
refreshRemoteObject(src, parent, originatedHere);
|
refreshRemoteObject(src, parent, originatedHere);
|
||||||
|
|
Loading…
Add table
Reference in a new issue