| /** |
| */ |
| package org.eclipse.osee.framework.core.dsl.oseeDsl.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.osee.framework.core.dsl.oseeDsl.OseeDslPackage; |
| import org.eclipse.osee.framework.core.dsl.oseeDsl.UpdateAttribute; |
| import org.eclipse.osee.framework.core.dsl.oseeDsl.XAttributeTypeRef; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Update Attribute</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.osee.framework.core.dsl.oseeDsl.impl.UpdateAttributeImpl#getAttribute <em>Attribute</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class UpdateAttributeImpl extends AttributeOverrideOptionImpl implements UpdateAttribute |
| { |
| /** |
| * The cached value of the '{@link #getAttribute() <em>Attribute</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getAttribute() |
| * @generated |
| * @ordered |
| */ |
| protected XAttributeTypeRef attribute; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected UpdateAttributeImpl() |
| { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() |
| { |
| return OseeDslPackage.Literals.UPDATE_ATTRIBUTE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public XAttributeTypeRef getAttribute() |
| { |
| return attribute; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetAttribute(XAttributeTypeRef newAttribute, NotificationChain msgs) |
| { |
| XAttributeTypeRef oldAttribute = attribute; |
| attribute = newAttribute; |
| if (eNotificationRequired()) |
| { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OseeDslPackage.UPDATE_ATTRIBUTE__ATTRIBUTE, oldAttribute, newAttribute); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setAttribute(XAttributeTypeRef newAttribute) |
| { |
| if (newAttribute != attribute) |
| { |
| NotificationChain msgs = null; |
| if (attribute != null) |
| msgs = ((InternalEObject)attribute).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OseeDslPackage.UPDATE_ATTRIBUTE__ATTRIBUTE, null, msgs); |
| if (newAttribute != null) |
| msgs = ((InternalEObject)newAttribute).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OseeDslPackage.UPDATE_ATTRIBUTE__ATTRIBUTE, null, msgs); |
| msgs = basicSetAttribute(newAttribute, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, OseeDslPackage.UPDATE_ATTRIBUTE__ATTRIBUTE, newAttribute, newAttribute)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) |
| { |
| switch (featureID) |
| { |
| case OseeDslPackage.UPDATE_ATTRIBUTE__ATTRIBUTE: |
| return basicSetAttribute(null, msgs); |
| } |
| return super.eInverseRemove(otherEnd, featureID, msgs); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) |
| { |
| switch (featureID) |
| { |
| case OseeDslPackage.UPDATE_ATTRIBUTE__ATTRIBUTE: |
| return getAttribute(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) |
| { |
| switch (featureID) |
| { |
| case OseeDslPackage.UPDATE_ATTRIBUTE__ATTRIBUTE: |
| setAttribute((XAttributeTypeRef)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) |
| { |
| switch (featureID) |
| { |
| case OseeDslPackage.UPDATE_ATTRIBUTE__ATTRIBUTE: |
| setAttribute((XAttributeTypeRef)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) |
| { |
| switch (featureID) |
| { |
| case OseeDslPackage.UPDATE_ATTRIBUTE__ATTRIBUTE: |
| return attribute != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //UpdateAttributeImpl |