/**
* <copyright>
* </copyright>
*
* $Id$
*/
package org.eclipse.papyrus.uml.diagram.paletteconfiguration.impl;
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;
import org.eclipse.papyrus.uml.diagram.paletteconfiguration.Configuration;
import org.eclipse.papyrus.uml.diagram.paletteconfiguration.IconDescriptor;
import org.eclipse.papyrus.uml.diagram.paletteconfiguration.PaletteconfigurationPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Configuration</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.papyrus.uml.diagram.paletteconfiguration.impl.ConfigurationImpl#getId <em>Id</em>}</li>
* <li>{@link org.eclipse.papyrus.uml.diagram.paletteconfiguration.impl.ConfigurationImpl#getLabel <em>Label</em>}</li>
* <li>{@link org.eclipse.papyrus.uml.diagram.paletteconfiguration.impl.ConfigurationImpl#getDescription <em>Description</em>}</li>
* <li>{@link org.eclipse.papyrus.uml.diagram.paletteconfiguration.impl.ConfigurationImpl#getIcon <em>Icon</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public abstract class ConfigurationImpl extends EObjectImpl implements Configuration {
/**
* The default value of the '{@link #getId() <em>Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getId()
* @generated
* @ordered
*/
protected static final String ID_EDEFAULT = null;
/**
* The cached value of the '{@link #getId() <em>Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getId()
* @generated
* @ordered
*/
protected String id = ID_EDEFAULT;
/**
* The default value of the '{@link #getLabel() <em>Label</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLabel()
* @generated
* @ordered
*/
protected static final String LABEL_EDEFAULT = null;
/**
* The cached value of the '{@link #getLabel() <em>Label</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLabel()
* @generated
* @ordered
*/
protected String label = LABEL_EDEFAULT;
/**
* The default value of the '{@link #getDescription() <em>Description</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDescription()
* @generated
* @ordered
*/
protected static final String DESCRIPTION_EDEFAULT = null;
/**
* The cached value of the '{@link #getDescription() <em>Description</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDescription()
* @generated
* @ordered
*/
protected String description = DESCRIPTION_EDEFAULT;
/**
* The cached value of the '{@link #getIcon() <em>Icon</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getIcon()
* @generated
* @ordered
*/
protected IconDescriptor icon;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ConfigurationImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return PaletteconfigurationPackage.Literals.CONFIGURATION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getId() {
return id;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setId(String newId) {
String oldId = id;
id = newId;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, PaletteconfigurationPackage.CONFIGURATION__ID, oldId, id));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getLabel() {
return label;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setLabel(String newLabel) {
String oldLabel = label;
label = newLabel;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, PaletteconfigurationPackage.CONFIGURATION__LABEL, oldLabel, label));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getDescription() {
return description;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDescription(String newDescription) {
String oldDescription = description;
description = newDescription;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, PaletteconfigurationPackage.CONFIGURATION__DESCRIPTION, oldDescription, description));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public IconDescriptor getIcon() {
return icon;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetIcon(IconDescriptor newIcon, NotificationChain msgs) {
IconDescriptor oldIcon = icon;
icon = newIcon;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, PaletteconfigurationPackage.CONFIGURATION__ICON, oldIcon, newIcon);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setIcon(IconDescriptor newIcon) {
if (newIcon != icon) {
NotificationChain msgs = null;
if (icon != null)
msgs = ((InternalEObject)icon).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - PaletteconfigurationPackage.CONFIGURATION__ICON, null, msgs);
if (newIcon != null)
msgs = ((InternalEObject)newIcon).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - PaletteconfigurationPackage.CONFIGURATION__ICON, null, msgs);
msgs = basicSetIcon(newIcon, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, PaletteconfigurationPackage.CONFIGURATION__ICON, newIcon, newIcon));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case PaletteconfigurationPackage.CONFIGURATION__ICON:
return basicSetIcon(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 PaletteconfigurationPackage.CONFIGURATION__ID:
return getId();
case PaletteconfigurationPackage.CONFIGURATION__LABEL:
return getLabel();
case PaletteconfigurationPackage.CONFIGURATION__DESCRIPTION:
return getDescription();
case PaletteconfigurationPackage.CONFIGURATION__ICON:
return getIcon();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case PaletteconfigurationPackage.CONFIGURATION__ID:
setId((String)newValue);
return;
case PaletteconfigurationPackage.CONFIGURATION__LABEL:
setLabel((String)newValue);
return;
case PaletteconfigurationPackage.CONFIGURATION__DESCRIPTION:
setDescription((String)newValue);
return;
case PaletteconfigurationPackage.CONFIGURATION__ICON:
setIcon((IconDescriptor)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case PaletteconfigurationPackage.CONFIGURATION__ID:
setId(ID_EDEFAULT);
return;
case PaletteconfigurationPackage.CONFIGURATION__LABEL:
setLabel(LABEL_EDEFAULT);
return;
case PaletteconfigurationPackage.CONFIGURATION__DESCRIPTION:
setDescription(DESCRIPTION_EDEFAULT);
return;
case PaletteconfigurationPackage.CONFIGURATION__ICON:
setIcon((IconDescriptor)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case PaletteconfigurationPackage.CONFIGURATION__ID:
return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
case PaletteconfigurationPackage.CONFIGURATION__LABEL:
return LABEL_EDEFAULT == null ? label != null : !LABEL_EDEFAULT.equals(label);
case PaletteconfigurationPackage.CONFIGURATION__DESCRIPTION:
return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description);
case PaletteconfigurationPackage.CONFIGURATION__ICON:
return icon != 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(" (id: ");
result.append(id);
result.append(", label: ");
result.append(label);
result.append(", description: ");
result.append(description);
result.append(')');
return result.toString();
}
} //ConfigurationImpl