1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-09 18:15:23 +02:00

[186880] allow deletion of all local and deletion of connected local

This commit is contained in:
David McKnight 2007-05-14 20:58:36 +00:00
parent e972c253f0
commit 5855b156d0

View file

@ -713,20 +713,18 @@ public class SystemViewConnectionAdapter
{ {
if (element instanceof IHost) if (element instanceof IHost)
{ {
IHost sysCon = (IHost) element;
if (sysCon.getSystemType().isLocal()) return existsMoreThanOneLocalConnection();
ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry(); ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
if (((IHost)element).getSystemType().isLocal())
{
// local is always connected so always allow delete
return true;
}
return !sr.isAnySubSystemConnected((IHost)element); return !sr.isAnySubSystemConnected((IHost)element);
} }
return true; return true;
} }
protected boolean existsMoreThanOneLocalConnection()
{
IRSESystemType localType = RSECorePlugin.getTheCoreRegistry().getSystemTypeById(IRSESystemType.SYSTEMTYPE_LOCAL_ID);
IHost[] localCons = RSECorePlugin.getTheSystemRegistry().getHostsBySystemType(localType);
return localCons.length > 1;
}
/** /**
* Perform the delete action. * Perform the delete action.