| /** |
| * <copyright> |
| * </copyright> |
| * |
| * $Id: IconImpl.java,v 1.1 2007/03/20 18:04:35 jsholl Exp $ |
| */ |
| package org.eclipse.jst.javaee.core.internal.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.emf.ecore.impl.EObjectImpl; |
| |
| import org.eclipse.jst.javaee.core.Icon; |
| |
| import org.eclipse.jst.javaee.core.internal.metadata.JavaeePackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Icon</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.jst.javaee.core.internal.impl.IconImpl#getSmallIcon <em>Small Icon</em>}</li> |
| * <li>{@link org.eclipse.jst.javaee.core.internal.impl.IconImpl#getLargeIcon <em>Large Icon</em>}</li> |
| * <li>{@link org.eclipse.jst.javaee.core.internal.impl.IconImpl#getId <em>Id</em>}</li> |
| * <li>{@link org.eclipse.jst.javaee.core.internal.impl.IconImpl#getLang <em>Lang</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class IconImpl extends EObjectImpl implements Icon { |
| /** |
| * The default value of the '{@link #getSmallIcon() <em>Small Icon</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getSmallIcon() |
| * @generated |
| * @ordered |
| */ |
| protected static final String SMALL_ICON_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getSmallIcon() <em>Small Icon</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getSmallIcon() |
| * @generated |
| * @ordered |
| */ |
| protected String smallIcon = SMALL_ICON_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getLargeIcon() <em>Large Icon</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getLargeIcon() |
| * @generated |
| * @ordered |
| */ |
| protected static final String LARGE_ICON_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getLargeIcon() <em>Large Icon</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getLargeIcon() |
| * @generated |
| * @ordered |
| */ |
| protected String largeIcon = LARGE_ICON_EDEFAULT; |
| |
| /** |
| * 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 #getLang() <em>Lang</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getLang() |
| * @generated |
| * @ordered |
| */ |
| protected static final String LANG_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getLang() <em>Lang</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getLang() |
| * @generated |
| * @ordered |
| */ |
| protected String lang = LANG_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected IconImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected EClass eStaticClass() { |
| return JavaeePackage.Literals.ICON; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getSmallIcon() { |
| return smallIcon; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setSmallIcon(String newSmallIcon) { |
| String oldSmallIcon = smallIcon; |
| smallIcon = newSmallIcon; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, JavaeePackage.ICON__SMALL_ICON, oldSmallIcon, smallIcon)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getLargeIcon() { |
| return largeIcon; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setLargeIcon(String newLargeIcon) { |
| String oldLargeIcon = largeIcon; |
| largeIcon = newLargeIcon; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, JavaeePackage.ICON__LARGE_ICON, oldLargeIcon, largeIcon)); |
| } |
| |
| /** |
| * <!-- 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, JavaeePackage.ICON__ID, oldId, id)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getLang() { |
| return lang; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setLang(String newLang) { |
| String oldLang = lang; |
| lang = newLang; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, JavaeePackage.ICON__LANG, oldLang, lang)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case JavaeePackage.ICON__SMALL_ICON: |
| return getSmallIcon(); |
| case JavaeePackage.ICON__LARGE_ICON: |
| return getLargeIcon(); |
| case JavaeePackage.ICON__ID: |
| return getId(); |
| case JavaeePackage.ICON__LANG: |
| return getLang(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case JavaeePackage.ICON__SMALL_ICON: |
| setSmallIcon((String)newValue); |
| return; |
| case JavaeePackage.ICON__LARGE_ICON: |
| setLargeIcon((String)newValue); |
| return; |
| case JavaeePackage.ICON__ID: |
| setId((String)newValue); |
| return; |
| case JavaeePackage.ICON__LANG: |
| setLang((String)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case JavaeePackage.ICON__SMALL_ICON: |
| setSmallIcon(SMALL_ICON_EDEFAULT); |
| return; |
| case JavaeePackage.ICON__LARGE_ICON: |
| setLargeIcon(LARGE_ICON_EDEFAULT); |
| return; |
| case JavaeePackage.ICON__ID: |
| setId(ID_EDEFAULT); |
| return; |
| case JavaeePackage.ICON__LANG: |
| setLang(LANG_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case JavaeePackage.ICON__SMALL_ICON: |
| return SMALL_ICON_EDEFAULT == null ? smallIcon != null : !SMALL_ICON_EDEFAULT.equals(smallIcon); |
| case JavaeePackage.ICON__LARGE_ICON: |
| return LARGE_ICON_EDEFAULT == null ? largeIcon != null : !LARGE_ICON_EDEFAULT.equals(largeIcon); |
| case JavaeePackage.ICON__ID: |
| return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id); |
| case JavaeePackage.ICON__LANG: |
| return LANG_EDEFAULT == null ? lang != null : !LANG_EDEFAULT.equals(lang); |
| } |
| 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(" (smallIcon: "); //$NON-NLS-1$ |
| result.append(smallIcon); |
| result.append(", largeIcon: "); //$NON-NLS-1$ |
| result.append(largeIcon); |
| result.append(", id: "); //$NON-NLS-1$ |
| result.append(id); |
| result.append(", lang: "); //$NON-NLS-1$ |
| result.append(lang); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //IconImpl |