/** * <copyright> * </copyright> * * $Id$ */ package org.eclipse.gmf.codegen.gmfgen.impl; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.EObjectImpl; import org.eclipse.gmf.codegen.gmfgen.GMFGenPackage; import org.eclipse.gmf.codegen.gmfgen.GenContributionManager; import org.eclipse.gmf.codegen.gmfgen.GenSeparator; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Gen Separator</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.eclipse.gmf.codegen.gmfgen.impl.GenSeparatorImpl#getOwner <em>Owner</em>}</li> * <li>{@link org.eclipse.gmf.codegen.gmfgen.impl.GenSeparatorImpl#getGroupName <em>Group Name</em>}</li> * </ul> * </p> * * @generated */ public class GenSeparatorImpl extends EObjectImpl implements GenSeparator { /** * The default value of the '{@link #getGroupName() <em>Group Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getGroupName() * @generated * @ordered */ protected static final String GROUP_NAME_EDEFAULT = null; /** * The cached value of the '{@link #getGroupName() <em>Group Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getGroupName() * @generated * @ordered */ protected String groupName = GROUP_NAME_EDEFAULT; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected GenSeparatorImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return GMFGenPackage.eINSTANCE.getGenSeparator(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public GenContributionManager getOwner() { if (eContainerFeatureID() != GMFGenPackage.GEN_SEPARATOR__OWNER) return null; return (GenContributionManager)eInternalContainer(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getGroupName() { return groupName; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setGroupName(String newGroupName) { String oldGroupName = groupName; groupName = newGroupName; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, GMFGenPackage.GEN_SEPARATOR__GROUP_NAME, oldGroupName, groupName)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case GMFGenPackage.GEN_SEPARATOR__OWNER: if (eInternalContainer() != null) msgs = eBasicRemoveFromContainer(msgs); return eBasicSetContainer(otherEnd, GMFGenPackage.GEN_SEPARATOR__OWNER, 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_SEPARATOR__OWNER: return eBasicSetContainer(null, GMFGenPackage.GEN_SEPARATOR__OWNER, 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_SEPARATOR__OWNER: return eInternalContainer().eInverseRemove(this, GMFGenPackage.GEN_CONTRIBUTION_MANAGER__ITEMS, GenContributionManager.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_SEPARATOR__OWNER: return getOwner(); case GMFGenPackage.GEN_SEPARATOR__GROUP_NAME: return getGroupName(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case GMFGenPackage.GEN_SEPARATOR__GROUP_NAME: setGroupName((String)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case GMFGenPackage.GEN_SEPARATOR__GROUP_NAME: setGroupName(GROUP_NAME_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case GMFGenPackage.GEN_SEPARATOR__OWNER: return getOwner() != null; case GMFGenPackage.GEN_SEPARATOR__GROUP_NAME: return GROUP_NAME_EDEFAULT == null ? groupName != null : !GROUP_NAME_EDEFAULT.equals(groupName); } return super.eIsSet(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (groupName: "); result.append(groupName); result.append(')'); return result.toString(); } } //GenSeparatorImpl