/** * When concerns are added or removed from the URNdefinition, start/stop listening to the concern. When maps are added or removed from the URNdefinition, * start/stop listening to the map. * * @see seg.jUCMNav.editparts.treeEditparts.UrnModelElementTreeEditPart#notifyChanged(org.eclipse.emf.common.notify.Notification) */ public void notifyChanged(Notification notification) { // only start listening to a new concern if ((notification.getEventType() == Notification.ADD || notification.getEventType() == Notification.ADD_MANY) && notification.getNotifier() instanceof URNdefinition) { if (notification.getFeature() instanceof EReferenceImpl && ((EReferenceImpl) notification.getFeature()).getName().equals("concerns")) //$NON-NLS-1$ matchObservedToConcerns(); } super.notifyChanged(notification); // only stop listening to removed concerns if ((notification.getEventType() == Notification.REMOVE || notification.getEventType() == Notification.REMOVE_MANY) && notification.getNotifier() instanceof URNdefinition) { if (notification.getFeature() instanceof EReferenceImpl && ((EReferenceImpl) notification.getFeature()).getName().equals("concerns")) //$NON-NLS-1$ matchObservedToConcerns(); } }
/** * When the concerns of the URNdefinition change, refresh the children of this ConcernsRootTreeEditPart. There is no need to refresh the visuals of this * ConcernsRootTreeEditPart since it is not displayed. * * @see org.eclipse.emf.common.notify.Adapter#notifyChanged(org.eclipse.emf.common.notify.Notification) */ public void notifyChanged(Notification notification) { if (notification.getEventType() != Notification.REMOVING_ADAPTER || notification.getEventType() != Notification.MOVE) { // refresh only if concerns changed if (notification.getFeature() instanceof EReferenceImpl && ((EReferenceImpl) notification.getFeature()).getName().equals("concerns")) //$NON-NLS-1$ refreshChildren(); } }