1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-03 07:05:24 +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:
David McKnight 2007-05-23 16:05:35 +00:00
parent bcf9a1c7b8
commit 835a63b776

View file

@ -2105,6 +2105,39 @@ public class SystemView extends SafeTreeViewer
// make the src the parent of the 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);