diff options
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/impl/NodeBImpl.java')
-rw-r--r-- | plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/impl/NodeBImpl.java | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/impl/NodeBImpl.java b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/impl/NodeBImpl.java index 78d85b1d57..3df5023be5 100644 --- a/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/impl/NodeBImpl.java +++ b/plugins/org.eclipse.emf.cdo.tests.model3/src/org/eclipse/emf/cdo/tests/model3/legacy/impl/NodeBImpl.java @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Eike Stepper - initial API and implementation */ @@ -54,7 +54,7 @@ public class NodeBImpl extends EObjectImpl implements NodeB /** * The default value of the '{@link #getName() <em>Name</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc * --> - * + * * @see #getName() * @generated * @ordered @@ -110,7 +110,9 @@ public class NodeBImpl extends EObjectImpl implements NodeB public NodeB getParent() { if (eContainerFeatureID() != Model3Package.NODE_B__PARENT) + { return null; + } return (NodeB)eContainer(); } @@ -130,22 +132,31 @@ public class NodeBImpl extends EObjectImpl implements NodeB */ public void setParent(NodeB newParent) { - if (newParent != eInternalContainer() - || (eContainerFeatureID() != Model3Package.NODE_B__PARENT && newParent != null)) + if (newParent != eInternalContainer() || eContainerFeatureID() != Model3Package.NODE_B__PARENT && newParent != null) { if (EcoreUtil.isAncestor(this, newParent)) + { throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); + } NotificationChain msgs = null; if (eInternalContainer() != null) + { msgs = eBasicRemoveFromContainer(msgs); + } if (newParent != null) + { msgs = ((InternalEObject)newParent).eInverseAdd(this, Model3Package.NODE_B__CHILDREN, NodeB.class, msgs); + } msgs = basicSetParent(newParent, msgs); if (msgs != null) + { msgs.dispatch(); + } } else if (eNotificationRequired()) + { eNotify(new ENotificationImpl(this, Notification.SET, Model3Package.NODE_B__PARENT, newParent, newParent)); + } } /** @@ -166,7 +177,9 @@ public class NodeBImpl extends EObjectImpl implements NodeB String oldName = name; name = newName; if (eNotificationRequired()) + { eNotify(new ENotificationImpl(this, Notification.SET, Model3Package.NODE_B__NAME, oldName, name)); + } } /** @@ -183,7 +196,9 @@ public class NodeBImpl extends EObjectImpl implements NodeB return ((InternalEList<InternalEObject>)(InternalEList<?>)getChildren()).basicAdd(otherEnd, msgs); case Model3Package.NODE_B__PARENT: if (eInternalContainer() != null) + { msgs = eBasicRemoveFromContainer(msgs); + } return basicSetParent((NodeB)otherEnd, msgs); } return super.eInverseAdd(otherEnd, featureID, msgs); @@ -313,7 +328,9 @@ public class NodeBImpl extends EObjectImpl implements NodeB public String toString() { if (eIsProxy()) + { return super.toString(); + } StringBuffer result = new StringBuffer(super.toString()); result.append(" (name: "); |