/** | |
* <copyright> | |
* </copyright> | |
* | |
* $Id$ | |
*/ | |
package org.eclipse.emf.eef.modelingBot.EEFActions.impl; | |
import java.util.Collection; | |
import org.eclipse.emf.common.notify.Notification; | |
import org.eclipse.emf.common.util.EList; | |
import org.eclipse.emf.ecore.EClass; | |
import org.eclipse.emf.ecore.EStructuralFeature; | |
import org.eclipse.emf.ecore.InternalEObject; | |
import org.eclipse.emf.ecore.impl.ENotificationImpl; | |
import org.eclipse.emf.ecore.util.EDataTypeUniqueEList; | |
import org.eclipse.emf.eef.modelingBot.EEFActions.EEFActionsPackage; | |
import org.eclipse.emf.eef.modelingBot.EEFActions.UnsetAttribute; | |
/** | |
* <!-- begin-user-doc --> | |
* An implementation of the model object '<em><b>Unset Attribute</b></em>'. | |
* <!-- end-user-doc --> | |
* <p> | |
* The following features are implemented: | |
* <ul> | |
* <li>{@link org.eclipse.emf.eef.modelingBot.EEFActions.impl.UnsetAttributeImpl#getValues <em>Values</em>}</li> | |
* <li>{@link org.eclipse.emf.eef.modelingBot.EEFActions.impl.UnsetAttributeImpl#getEContainingFeature <em>EContaining Feature</em>}</li> | |
* </ul> | |
* </p> | |
* | |
* @generated | |
*/ | |
public class UnsetAttributeImpl extends EditActionImpl implements UnsetAttribute { | |
/** | |
* The cached value of the '{@link #getValues() <em>Values</em>}' attribute list. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getValues() | |
* @generated | |
* @ordered | |
*/ | |
protected EList<String> values; | |
/** | |
* The cached value of the '{@link #getEContainingFeature() <em>EContaining Feature</em>}' reference. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getEContainingFeature() | |
* @generated | |
* @ordered | |
*/ | |
protected EStructuralFeature eContainingFeature; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
protected UnsetAttributeImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() { | |
return EEFActionsPackage.Literals.UNSET_ATTRIBUTE; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EList<String> getValues() { | |
if (values == null) { | |
values = new EDataTypeUniqueEList<String>(String.class, this, EEFActionsPackage.UNSET_ATTRIBUTE__VALUES); | |
} | |
return values; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EStructuralFeature getEContainingFeature() { | |
if (eContainingFeature != null && eContainingFeature.eIsProxy()) { | |
InternalEObject oldEContainingFeature = (InternalEObject)eContainingFeature; | |
eContainingFeature = (EStructuralFeature)eResolveProxy(oldEContainingFeature); | |
if (eContainingFeature != oldEContainingFeature) { | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.RESOLVE, EEFActionsPackage.UNSET_ATTRIBUTE__ECONTAINING_FEATURE, oldEContainingFeature, eContainingFeature)); | |
} | |
} | |
return eContainingFeature; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EStructuralFeature basicGetEContainingFeature() { | |
return eContainingFeature; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setEContainingFeature(EStructuralFeature newEContainingFeature) { | |
EStructuralFeature oldEContainingFeature = eContainingFeature; | |
eContainingFeature = newEContainingFeature; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, EEFActionsPackage.UNSET_ATTRIBUTE__ECONTAINING_FEATURE, oldEContainingFeature, eContainingFeature)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public Object eGet(int featureID, boolean resolve, boolean coreType) { | |
switch (featureID) { | |
case EEFActionsPackage.UNSET_ATTRIBUTE__VALUES: | |
return getValues(); | |
case EEFActionsPackage.UNSET_ATTRIBUTE__ECONTAINING_FEATURE: | |
if (resolve) return getEContainingFeature(); | |
return basicGetEContainingFeature(); | |
} | |
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 EEFActionsPackage.UNSET_ATTRIBUTE__VALUES: | |
getValues().clear(); | |
getValues().addAll((Collection<? extends String>)newValue); | |
return; | |
case EEFActionsPackage.UNSET_ATTRIBUTE__ECONTAINING_FEATURE: | |
setEContainingFeature((EStructuralFeature)newValue); | |
return; | |
} | |
super.eSet(featureID, newValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eUnset(int featureID) { | |
switch (featureID) { | |
case EEFActionsPackage.UNSET_ATTRIBUTE__VALUES: | |
getValues().clear(); | |
return; | |
case EEFActionsPackage.UNSET_ATTRIBUTE__ECONTAINING_FEATURE: | |
setEContainingFeature((EStructuralFeature)null); | |
return; | |
} | |
super.eUnset(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean eIsSet(int featureID) { | |
switch (featureID) { | |
case EEFActionsPackage.UNSET_ATTRIBUTE__VALUES: | |
return values != null && !values.isEmpty(); | |
case EEFActionsPackage.UNSET_ATTRIBUTE__ECONTAINING_FEATURE: | |
return eContainingFeature != null; | |
} | |
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(" (values: "); | |
result.append(values); | |
result.append(')'); | |
return result.toString(); | |
} | |
} //UnsetAttributeImpl |