blob: 365ba8e61c062f51d4e8fb66cfa6904c2dc9a685 [file] [log] [blame]
/**
* Copyright (c) 2007 Oracle Corporation
*
* $Id: TagCreationInfoImpl.java,v 1.2 2008/11/18 22:24:03 gkessler Exp $
*/
package org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl;
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.impl.EObjectImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.PaletteInfosPackage;
import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationAttribute;
import org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.TagCreationInfo;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Tag Creation Info</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.TagCreationInfoImpl#getAttributes <em>Attributes</em>}</li>
* <li>{@link org.eclipse.jst.jsf.tagdisplay.internal.paletteinfos.impl.TagCreationInfoImpl#getTemplate <em>Template</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class TagCreationInfoImpl extends EObjectImpl implements TagCreationInfo {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static final String copyright = "Copyright (c) 2007 Oracle Corporation"; //$NON-NLS-1$
/**
* The cached value of the '{@link #getAttributes() <em>Attributes</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAttributes()
* @generated
* @ordered
*/
protected EList attributes;
/**
* The default value of the '{@link #getTemplate() <em>Template</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTemplate()
* @generated
* @ordered
*/
protected static final Object TEMPLATE_EDEFAULT = null;
/**
* The cached value of the '{@link #getTemplate() <em>Template</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTemplate()
* @generated
* @ordered
*/
protected Object template = TEMPLATE_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected TagCreationInfoImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected EClass eStaticClass() {
return PaletteInfosPackage.Literals.TAG_CREATION_INFO;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList getAttributes() {
if (attributes == null) {
attributes = new EObjectContainmentEList(TagCreationAttribute.class, this, PaletteInfosPackage.TAG_CREATION_INFO__ATTRIBUTES);
}
return attributes;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Object getTemplate() {
return template;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setTemplate(Object newTemplate) {
Object oldTemplate = template;
template = newTemplate;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, PaletteInfosPackage.TAG_CREATION_INFO__TEMPLATE, oldTemplate, template));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case PaletteInfosPackage.TAG_CREATION_INFO__ATTRIBUTES:
return ((InternalEList)getAttributes()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case PaletteInfosPackage.TAG_CREATION_INFO__ATTRIBUTES:
return getAttributes();
case PaletteInfosPackage.TAG_CREATION_INFO__TEMPLATE:
return getTemplate();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case PaletteInfosPackage.TAG_CREATION_INFO__ATTRIBUTES:
getAttributes().clear();
getAttributes().addAll((Collection)newValue);
return;
case PaletteInfosPackage.TAG_CREATION_INFO__TEMPLATE:
setTemplate(newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void eUnset(int featureID) {
switch (featureID) {
case PaletteInfosPackage.TAG_CREATION_INFO__ATTRIBUTES:
getAttributes().clear();
return;
case PaletteInfosPackage.TAG_CREATION_INFO__TEMPLATE:
setTemplate(TEMPLATE_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean eIsSet(int featureID) {
switch (featureID) {
case PaletteInfosPackage.TAG_CREATION_INFO__ATTRIBUTES:
return attributes != null && !attributes.isEmpty();
case PaletteInfosPackage.TAG_CREATION_INFO__TEMPLATE:
return TEMPLATE_EDEFAULT == null ? template != null : !TEMPLATE_EDEFAULT.equals(template);
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (template: "); //$NON-NLS-1$
result.append(template);
result.append(')');
return result.toString();
}
} //TagCreationInfoImpl