### Eclipse Workspace Patch 1.0 #P org.eclipse.gmf.runtime.diagram.ui Index: src/org/eclipse/gmf/runtime/diagram/ui/editparts/SemanticListCompartmentEditPart.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.runtime.diagram.ui/src/org/eclipse/gmf/runtime/diagram/ui/editparts/SemanticListCompartmentEditPart.java,v retrieving revision 1.2.2.4 diff -u -r1.2.2.4 SemanticListCompartmentEditPart.java --- src/org/eclipse/gmf/runtime/diagram/ui/editparts/SemanticListCompartmentEditPart.java 28 Jul 2006 20:40:45 -0000 1.2.2.4 +++ src/org/eclipse/gmf/runtime/diagram/ui/editparts/SemanticListCompartmentEditPart.java 6 Sep 2006 15:18:56 -0000 @@ -175,7 +175,7 @@ while( childrenIT.hasNext() ) { GraphicalEditPart eP = (GraphicalEditPart)childrenIT.next(); semanticChild = (EObject)eP.basicGetModel(); - semanticChildren.remove(semanticChild); + semanticChildren.remove(semanticChild); } // @@ -237,15 +237,20 @@ * @param evt */ protected void semanticChildrenListChanged(Notification event) { - if (!isCanonicalEnabled()) - return; - if (NotificationUtil.isElementAddedToSlot(event) || - NotificationUtil.isMove(event)){ - refreshChildren(); - } - else if(NotificationUtil.isElementRemovedFromSlot(event) && + if (isCanonicalEnabled()){ + if (NotificationUtil.isElementAddedToSlot(event) || + NotificationUtil.isMove(event)){ + refreshChildren(); + } + else if(NotificationUtil.isElementRemovedFromSlot(event) && event.getOldValue() instanceof EObject){ semanticChildRemoved((EObject)event.getOldValue()); + + } + }else if(NotificationUtil.isElementRemovedFromSlot(event) && + event.getOldValue() instanceof EObject && + !getChildren().isEmpty()){ + semanticChildRemoved((EObject)event.getOldValue()); } } @@ -390,6 +395,6 @@ public boolean isCanonical() { return true; - } + } }