/** * <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.UrlProperties; import at.bestsolution.e4.jfx.xtext.jFXCss.UrlValue; import java.util.Collection; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Url Properties</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link at.bestsolution.e4.jfx.xtext.jFXCss.impl.UrlPropertiesImpl#getProperty <em>Property</em>}</li> * <li>{@link at.bestsolution.e4.jfx.xtext.jFXCss.impl.UrlPropertiesImpl#getValues <em>Values</em>}</li> * </ul> * </p> * * @generated */ public class UrlPropertiesImpl extends FXPropertyImpl implements UrlProperties { /** * The default value of the '{@link #getProperty() <em>Property</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getProperty() * @generated * @ordered */ protected static final String PROPERTY_EDEFAULT = null; /** * The cached value of the '{@link #getProperty() <em>Property</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getProperty() * @generated * @ordered */ protected String property = PROPERTY_EDEFAULT; /** * The cached value of the '{@link #getValues() <em>Values</em>}' containment reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getValues() * @generated * @ordered */ protected EList<UrlValue> values; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected UrlPropertiesImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return JFXCssPackage.Literals.URL_PROPERTIES; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getProperty() { return property; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setProperty(String newProperty) { String oldProperty = property; property = newProperty; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, JFXCssPackage.URL_PROPERTIES__PROPERTY, oldProperty, property)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EList<UrlValue> getValues() { if (values == null) { values = new EObjectContainmentEList<UrlValue>(UrlValue.class, this, JFXCssPackage.URL_PROPERTIES__VALUES); } return values; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case JFXCssPackage.URL_PROPERTIES__VALUES: return ((InternalEList<?>)getValues()).basicRemove(otherEnd, 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.URL_PROPERTIES__PROPERTY: return getProperty(); case JFXCssPackage.URL_PROPERTIES__VALUES: return getValues(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case JFXCssPackage.URL_PROPERTIES__PROPERTY: setProperty((String)newValue); return; case JFXCssPackage.URL_PROPERTIES__VALUES: getValues().clear(); getValues().addAll((Collection<? extends UrlValue>)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case JFXCssPackage.URL_PROPERTIES__PROPERTY: setProperty(PROPERTY_EDEFAULT); return; case JFXCssPackage.URL_PROPERTIES__VALUES: getValues().clear(); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case JFXCssPackage.URL_PROPERTIES__PROPERTY: return PROPERTY_EDEFAULT == null ? property != null : !PROPERTY_EDEFAULT.equals(property); case JFXCssPackage.URL_PROPERTIES__VALUES: return values != null && !values.isEmpty(); } 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(" (property: "); result.append(property); result.append(')'); return result.toString(); } } //UrlPropertiesImpl