/** * <copyright> * </copyright> * * $Id$ */ package org.eclipse.gmf.codegen.gmfgen.impl; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.gmf.codegen.gmfgen.GMFGenPackage; import org.eclipse.gmf.codegen.gmfgen.GenDiagram; import org.eclipse.gmf.codegen.gmfgen.GenTopLevelNode; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Gen Top Level Node</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.eclipse.gmf.codegen.gmfgen.impl.GenTopLevelNodeImpl#getDiagram <em>Diagram</em>}</li> * </ul> * </p> * * @generated */ public class GenTopLevelNodeImpl extends GenNodeImpl implements GenTopLevelNode { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected GenTopLevelNodeImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return GMFGenPackage.eINSTANCE.getGenTopLevelNode(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public GenDiagram getDiagram() { if (eContainerFeatureID() != GMFGenPackage.GEN_TOP_LEVEL_NODE__DIAGRAM) return null; return (GenDiagram)eInternalContainer(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case GMFGenPackage.GEN_TOP_LEVEL_NODE__DIAGRAM: if (eInternalContainer() != null) msgs = eBasicRemoveFromContainer(msgs); return eBasicSetContainer(otherEnd, GMFGenPackage.GEN_TOP_LEVEL_NODE__DIAGRAM, msgs); } return super.eInverseAdd(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case GMFGenPackage.GEN_TOP_LEVEL_NODE__DIAGRAM: return eBasicSetContainer(null, GMFGenPackage.GEN_TOP_LEVEL_NODE__DIAGRAM, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { switch (eContainerFeatureID()) { case GMFGenPackage.GEN_TOP_LEVEL_NODE__DIAGRAM: return eInternalContainer().eInverseRemove(this, GMFGenPackage.GEN_DIAGRAM__TOP_LEVEL_NODES, GenDiagram.class, msgs); } return super.eBasicRemoveFromContainerFeature(msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case GMFGenPackage.GEN_TOP_LEVEL_NODE__DIAGRAM: return getDiagram(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case GMFGenPackage.GEN_TOP_LEVEL_NODE__DIAGRAM: return getDiagram() != null; } return super.eIsSet(featureID); } } //GenTopLevelNodeImpl