/**
* <copyright>
* </copyright>
*
* $Id$
*/
package org.eclipse.emf.eef.mapping.navigation.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.eef.mapping.navigation.NavigationPackage;
import org.eclipse.emf.eef.mapping.navigation.NavigationStep;
import org.eclipse.emf.eef.mapping.navigation.SmartModelNavigation;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Smart Model Navigation</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.emf.eef.mapping.navigation.impl.SmartModelNavigationImpl#getStep <em>Step</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class SmartModelNavigationImpl extends ModelNavigationImpl implements
SmartModelNavigation {
/**
* The cached value of the '{@link #getStep() <em>Step</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getStep()
* @generated
* @ordered
*/
protected NavigationStep step;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected SmartModelNavigationImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return NavigationPackage.Literals.SMART_MODEL_NAVIGATION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NavigationStep getStep() {
return step;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetStep(NavigationStep newStep,
NotificationChain msgs) {
NavigationStep oldStep = step;
step = newStep;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this,
Notification.SET,
NavigationPackage.SMART_MODEL_NAVIGATION__STEP, oldStep,
newStep);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setStep(NavigationStep newStep) {
if (newStep != step) {
NotificationChain msgs = null;
if (step != null)
msgs = ((InternalEObject) step)
.eInverseRemove(
this,
EOPPOSITE_FEATURE_BASE
- NavigationPackage.SMART_MODEL_NAVIGATION__STEP,
null, msgs);
if (newStep != null)
msgs = ((InternalEObject) newStep)
.eInverseAdd(
this,
EOPPOSITE_FEATURE_BASE
- NavigationPackage.SMART_MODEL_NAVIGATION__STEP,
null, msgs);
msgs = basicSetStep(newStep, msgs);
if (msgs != null)
msgs.dispatch();
} else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
NavigationPackage.SMART_MODEL_NAVIGATION__STEP, newStep,
newStep));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd,
int featureID, NotificationChain msgs) {
switch (featureID) {
case NavigationPackage.SMART_MODEL_NAVIGATION__STEP:
return basicSetStep(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 NavigationPackage.SMART_MODEL_NAVIGATION__STEP:
return getStep();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case NavigationPackage.SMART_MODEL_NAVIGATION__STEP:
setStep((NavigationStep) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case NavigationPackage.SMART_MODEL_NAVIGATION__STEP:
setStep((NavigationStep) null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case NavigationPackage.SMART_MODEL_NAVIGATION__STEP:
return step != null;
}
return super.eIsSet(featureID);
}
} //SmartModelNavigationImpl