/** * <copyright> * </copyright> * * $Id$ */ package no.hal.scxml.scxmlxt.impl; import no.hal.scxml.scxmlxt.Action; import no.hal.scxml.scxmlxt.InitialTransition; import no.hal.scxml.scxmlxt.ScxmlxtPackage; 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; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Initial Transition</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link no.hal.scxml.scxmlxt.impl.InitialTransitionImpl#getAction <em>Action</em>}</li> * </ul> * </p> * * @generated */ public class InitialTransitionImpl extends EObjectImpl implements InitialTransition { /** * The cached value of the '{@link #getAction() <em>Action</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getAction() * @generated * @ordered */ protected Action action; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected InitialTransitionImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return ScxmlxtPackage.Literals.INITIAL_TRANSITION; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Action getAction() { return action; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetAction(Action newAction, NotificationChain msgs) { Action oldAction = action; action = newAction; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ScxmlxtPackage.INITIAL_TRANSITION__ACTION, oldAction, newAction); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setAction(Action newAction) { if (newAction != action) { NotificationChain msgs = null; if (action != null) msgs = ((InternalEObject)action).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ScxmlxtPackage.INITIAL_TRANSITION__ACTION, null, msgs); if (newAction != null) msgs = ((InternalEObject)newAction).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ScxmlxtPackage.INITIAL_TRANSITION__ACTION, null, msgs); msgs = basicSetAction(newAction, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, ScxmlxtPackage.INITIAL_TRANSITION__ACTION, newAction, newAction)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case ScxmlxtPackage.INITIAL_TRANSITION__ACTION: return basicSetAction(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 ScxmlxtPackage.INITIAL_TRANSITION__ACTION: return getAction(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case ScxmlxtPackage.INITIAL_TRANSITION__ACTION: setAction((Action)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case ScxmlxtPackage.INITIAL_TRANSITION__ACTION: setAction((Action)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case ScxmlxtPackage.INITIAL_TRANSITION__ACTION: return action != null; } return super.eIsSet(featureID); } } //InitialTransitionImpl