// We need to be careful that the proxy may be resolved while we are attaching this adapter.
// We need to avoid attaching the adapter during the resolve
// and also attaching it again as we walk the eContents() later.
// Checking here avoids having to check during addAdapter.
//
Notifier oldValue = (Notifier)notification.getOldValue();
if (oldValue.eAdapters().contains(this))
{
removeAdapter(oldValue);
Notifier newValue = (Notifier)notification.getNewValue();
addAdapter(newValue);
}
break;
}
case Notification.UNSET:
{
Object oldValue = notification.getOldValue();
if (oldValue != Boolean.TRUE && oldValue != Boolean.FALSE)
{
if (oldValue != null)
{
removeAdapter((Notifier)oldValue);
}
Notifier newValue = (Notifier)notification.getNewValue();
if (newValue != null)
{
addAdapter(newValue);
}
}
break;
}
case Notification.SET:
{
Notifier oldValue = (Notifier)notification.getOldValue();
if (oldValue != null)
{
removeAdapter(oldValue);
}
Notifier newValue = (Notifier)notification.getNewValue();
if (newValue != null)
{
addAdapter(newValue);
}
break;
}
case Notification.ADD:
{
Notifier newValue = (Notifier)notification.getNewValue();
if (newValue != null)
{
addAdapter(newValue);
}
break;
}
case Notification.ADD_MANY:
{
@SuppressWarnings("unchecked") Collection<Notifier> newValues = (Collection<Notifier>)notification.getNewValue();
for (Notifier newValue : newValues)
{
addAdapter(newValue);
}
break;
}
case Notification.REMOVE:
{
Notifier oldValue = (Notifier)notification.getOldValue();
if (oldValue != null)
{
removeAdapter(oldValue);
}
break;