/**
*/
package at.bestsolution.efxclipse.tooling.css.cssext.cssExtDsl.impl;
import at.bestsolution.efxclipse.tooling.css.cssext.cssExtDsl.CssExtDslPackage;
import at.bestsolution.efxclipse.tooling.css.cssext.cssExtDsl.Doku;
import at.bestsolution.efxclipse.tooling.css.cssext.cssExtDsl.PseudoClassDefinition;
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>Pseudo Class Definition</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link at.bestsolution.efxclipse.tooling.css.cssext.cssExtDsl.impl.PseudoClassDefinitionImpl#getDoku <em>Doku</em>}</li>
* <li>{@link at.bestsolution.efxclipse.tooling.css.cssext.cssExtDsl.impl.PseudoClassDefinitionImpl#getName <em>Name</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class PseudoClassDefinitionImpl extends MinimalEObjectImpl.Container implements PseudoClassDefinition
{
/**
* The cached value of the '{@link #getDoku() <em>Doku</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDoku()
* @generated
* @ordered
*/
protected Doku doku;
/**
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected static final String NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected String name = NAME_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected PseudoClassDefinitionImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return CssExtDslPackage.Literals.PSEUDO_CLASS_DEFINITION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Doku getDoku()
{
return doku;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetDoku(Doku newDoku, NotificationChain msgs)
{
Doku oldDoku = doku;
doku = newDoku;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, CssExtDslPackage.PSEUDO_CLASS_DEFINITION__DOKU, oldDoku, newDoku);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDoku(Doku newDoku)
{
if (newDoku != doku)
{
NotificationChain msgs = null;
if (doku != null)
msgs = ((InternalEObject)doku).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - CssExtDslPackage.PSEUDO_CLASS_DEFINITION__DOKU, null, msgs);
if (newDoku != null)
msgs = ((InternalEObject)newDoku).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CssExtDslPackage.PSEUDO_CLASS_DEFINITION__DOKU, null, msgs);
msgs = basicSetDoku(newDoku, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CssExtDslPackage.PSEUDO_CLASS_DEFINITION__DOKU, newDoku, newDoku));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getName()
{
return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setName(String newName)
{
String oldName = name;
name = newName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CssExtDslPackage.PSEUDO_CLASS_DEFINITION__NAME, oldName, name));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case CssExtDslPackage.PSEUDO_CLASS_DEFINITION__DOKU:
return basicSetDoku(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 CssExtDslPackage.PSEUDO_CLASS_DEFINITION__DOKU:
return getDoku();
case CssExtDslPackage.PSEUDO_CLASS_DEFINITION__NAME:
return getName();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case CssExtDslPackage.PSEUDO_CLASS_DEFINITION__DOKU:
setDoku((Doku)newValue);
return;
case CssExtDslPackage.PSEUDO_CLASS_DEFINITION__NAME:
setName((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case CssExtDslPackage.PSEUDO_CLASS_DEFINITION__DOKU:
setDoku((Doku)null);
return;
case CssExtDslPackage.PSEUDO_CLASS_DEFINITION__NAME:
setName(NAME_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case CssExtDslPackage.PSEUDO_CLASS_DEFINITION__DOKU:
return doku != null;
case CssExtDslPackage.PSEUDO_CLASS_DEFINITION__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
}
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(" (name: ");
result.append(name);
result.append(')');
return result.toString();
}
} //PseudoClassDefinitionImpl