/** * <copyright> * </copyright> * */ package at.bestsolution.e4.jfx.xtext.jFXCss.impl; import at.bestsolution.e4.jfx.xtext.jFXCss.JFXCssPackage; import at.bestsolution.e4.jfx.xtext.jFXCss.MultiSizeValue; import at.bestsolution.e4.jfx.xtext.jFXCss.SizeFill; 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.MinimalEObjectImpl; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Size Fill</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link at.bestsolution.e4.jfx.xtext.jFXCss.impl.SizeFillImpl#getValue <em>Value</em>}</li> * <li>{@link at.bestsolution.e4.jfx.xtext.jFXCss.impl.SizeFillImpl#getFill <em>Fill</em>}</li> * </ul> * </p> * * @generated */ public class SizeFillImpl extends MinimalEObjectImpl.Container implements SizeFill { /** * The cached value of the '{@link #getValue() <em>Value</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getValue() * @generated * @ordered */ protected MultiSizeValue value; /** * The default value of the '{@link #getFill() <em>Fill</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getFill() * @generated * @ordered */ protected static final String FILL_EDEFAULT = null; /** * The cached value of the '{@link #getFill() <em>Fill</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getFill() * @generated * @ordered */ protected String fill = FILL_EDEFAULT; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected SizeFillImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return JFXCssPackage.Literals.SIZE_FILL; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public MultiSizeValue getValue() { return value; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetValue(MultiSizeValue newValue, NotificationChain msgs) { MultiSizeValue oldValue = value; value = newValue; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, JFXCssPackage.SIZE_FILL__VALUE, oldValue, newValue); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setValue(MultiSizeValue newValue) { if (newValue != value) { NotificationChain msgs = null; if (value != null) msgs = ((InternalEObject)value).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - JFXCssPackage.SIZE_FILL__VALUE, null, msgs); if (newValue != null) msgs = ((InternalEObject)newValue).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - JFXCssPackage.SIZE_FILL__VALUE, null, msgs); msgs = basicSetValue(newValue, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, JFXCssPackage.SIZE_FILL__VALUE, newValue, newValue)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getFill() { return fill; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setFill(String newFill) { String oldFill = fill; fill = newFill; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, JFXCssPackage.SIZE_FILL__FILL, oldFill, fill)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case JFXCssPackage.SIZE_FILL__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 JFXCssPackage.SIZE_FILL__VALUE: return getValue(); case JFXCssPackage.SIZE_FILL__FILL: return getFill(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case JFXCssPackage.SIZE_FILL__VALUE: setValue((MultiSizeValue)newValue); return; case JFXCssPackage.SIZE_FILL__FILL: setFill((String)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case JFXCssPackage.SIZE_FILL__VALUE: setValue((MultiSizeValue)null); return; case JFXCssPackage.SIZE_FILL__FILL: setFill(FILL_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case JFXCssPackage.SIZE_FILL__VALUE: return value != null; case JFXCssPackage.SIZE_FILL__FILL: return FILL_EDEFAULT == null ? fill != null : !FILL_EDEFAULT.equals(fill); } 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(" (fill: "); result.append(fill); result.append(')'); return result.toString(); } } //SizeFillImpl