/** | |
* Copyright (c) 2011 Mia-Software. | |
* | |
* All rights reserved. This program and the accompanying materials | |
* 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: | |
* Gregoire Dupe (Mia-Software) - Bug 361794 - [Restructuring] New customization meta-model | |
* Gregoire Dupe (Mia-Software) - Bug 369987 - [Restructuring][Table] Switch to the new customization and facet framework | |
* Gregoire Dupe (Mia-Software) - Bug 373078 - API Cleaning | |
*/ | |
package org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.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.ETypedElement; | |
import org.eclipse.emf.ecore.InternalEObject; | |
import org.eclipse.emf.ecore.impl.ENotificationImpl; | |
import org.eclipse.emf.ecore.impl.EObjectImpl; | |
import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.CustomPackage; | |
import org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.ETypedElementCase; | |
import org.eclipse.emf.facet.efacet.metamodel.v0_2_0.efacet.extensible.Query; | |
/** | |
* <!-- begin-user-doc --> | |
* An implementation of the model object '<em><b>ETyped Element Case</b></em>'. | |
* <!-- end-user-doc --> | |
* <p> | |
* The following features are implemented: | |
* <ul> | |
* <li>{@link org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.impl.ETypedElementCaseImpl#getCase <em>Case</em>}</li> | |
* <li>{@link org.eclipse.emf.facet.custom.metamodel.v0_2_0.custom.impl.ETypedElementCaseImpl#getValue <em>Value</em>}</li> | |
* </ul> | |
* </p> | |
* | |
* @generated | |
*/ | |
public class ETypedElementCaseImpl extends EObjectImpl implements ETypedElementCase { | |
/** | |
* The cached value of the '{@link #getCase() <em>Case</em>}' reference. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getCase() | |
* @generated | |
* @ordered | |
*/ | |
protected ETypedElement case_; | |
/** | |
* The cached value of the '{@link #getValue() <em>Value</em>}' containment reference. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getValue() | |
* @generated | |
* @ordered | |
*/ | |
protected Query value; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
protected ETypedElementCaseImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() { | |
return CustomPackage.Literals.ETYPED_ELEMENT_CASE; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public ETypedElement getCase() { | |
if (case_ != null && case_.eIsProxy()) { | |
InternalEObject oldCase = (InternalEObject)case_; | |
case_ = (ETypedElement)eResolveProxy(oldCase); | |
if (case_ != oldCase) { | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.RESOLVE, CustomPackage.ETYPED_ELEMENT_CASE__CASE, oldCase, case_)); | |
} | |
} | |
return case_; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public ETypedElement basicGetCase() { | |
return case_; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setCase(ETypedElement newCase) { | |
ETypedElement oldCase = case_; | |
case_ = newCase; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, CustomPackage.ETYPED_ELEMENT_CASE__CASE, oldCase, case_)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public Query getValue() { | |
return value; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public NotificationChain basicSetValue(Query newValue, NotificationChain msgs) { | |
Query oldValue = value; | |
value = newValue; | |
if (eNotificationRequired()) { | |
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, CustomPackage.ETYPED_ELEMENT_CASE__VALUE, oldValue, newValue); | |
if (msgs == null) msgs = notification; else msgs.add(notification); | |
} | |
return msgs; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setValue(Query newValue) { | |
if (newValue != value) { | |
NotificationChain msgs = null; | |
if (value != null) | |
msgs = ((InternalEObject)value).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - CustomPackage.ETYPED_ELEMENT_CASE__VALUE, null, msgs); | |
if (newValue != null) | |
msgs = ((InternalEObject)newValue).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CustomPackage.ETYPED_ELEMENT_CASE__VALUE, null, msgs); | |
msgs = basicSetValue(newValue, msgs); | |
if (msgs != null) msgs.dispatch(); | |
} | |
else if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, CustomPackage.ETYPED_ELEMENT_CASE__VALUE, newValue, newValue)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | |
switch (featureID) { | |
case CustomPackage.ETYPED_ELEMENT_CASE__VALUE: | |
return basicSetValue(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 CustomPackage.ETYPED_ELEMENT_CASE__CASE: | |
if (resolve) return getCase(); | |
return basicGetCase(); | |
case CustomPackage.ETYPED_ELEMENT_CASE__VALUE: | |
return getValue(); | |
} | |
return super.eGet(featureID, resolve, coreType); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eSet(int featureID, Object newValue) { | |
switch (featureID) { | |
case CustomPackage.ETYPED_ELEMENT_CASE__CASE: | |
setCase((ETypedElement)newValue); | |
return; | |
case CustomPackage.ETYPED_ELEMENT_CASE__VALUE: | |
setValue((Query)newValue); | |
return; | |
} | |
super.eSet(featureID, newValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eUnset(int featureID) { | |
switch (featureID) { | |
case CustomPackage.ETYPED_ELEMENT_CASE__CASE: | |
setCase((ETypedElement)null); | |
return; | |
case CustomPackage.ETYPED_ELEMENT_CASE__VALUE: | |
setValue((Query)null); | |
return; | |
} | |
super.eUnset(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean eIsSet(int featureID) { | |
switch (featureID) { | |
case CustomPackage.ETYPED_ELEMENT_CASE__CASE: | |
return case_ != null; | |
case CustomPackage.ETYPED_ELEMENT_CASE__VALUE: | |
return value != null; | |
} | |
return super.eIsSet(featureID); | |
} | |
} //ETypedElementCaseImpl |