/******************************************************************************* * Copyright (c) 2005, 2009 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial implementation *******************************************************************************/ package org.eclipse.epf.xml.uma.impl; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.epf.xml.uma.Descriptor; import org.eclipse.epf.xml.uma.UmaPackage; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Descriptor</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.eclipse.epf.xml.uma.impl.DescriptorImpl#isIsSynchronizedWithSource <em>Is Synchronized With Source</em>}</li> * </ul> * </p> * * @generated */ public class DescriptorImpl extends BreakdownElementImpl implements Descriptor { /** * The default value of the '{@link #isIsSynchronizedWithSource() <em>Is Synchronized With Source</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #isIsSynchronizedWithSource() * @generated * @ordered */ protected static final boolean IS_SYNCHRONIZED_WITH_SOURCE_EDEFAULT = false; /** * The cached value of the '{@link #isIsSynchronizedWithSource() <em>Is Synchronized With Source</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #isIsSynchronizedWithSource() * @generated * @ordered */ protected boolean isSynchronizedWithSource = IS_SYNCHRONIZED_WITH_SOURCE_EDEFAULT; /** * This is true if the Is Synchronized With Source attribute has been set. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ protected boolean isSynchronizedWithSourceESet; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected DescriptorImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return UmaPackage.Literals.DESCRIPTOR; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean isIsSynchronizedWithSource() { return isSynchronizedWithSource; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setIsSynchronizedWithSource(boolean newIsSynchronizedWithSource) { boolean oldIsSynchronizedWithSource = isSynchronizedWithSource; isSynchronizedWithSource = newIsSynchronizedWithSource; boolean oldIsSynchronizedWithSourceESet = isSynchronizedWithSourceESet; isSynchronizedWithSourceESet = true; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, UmaPackage.DESCRIPTOR__IS_SYNCHRONIZED_WITH_SOURCE, oldIsSynchronizedWithSource, isSynchronizedWithSource, !oldIsSynchronizedWithSourceESet)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void unsetIsSynchronizedWithSource() { boolean oldIsSynchronizedWithSource = isSynchronizedWithSource; boolean oldIsSynchronizedWithSourceESet = isSynchronizedWithSourceESet; isSynchronizedWithSource = IS_SYNCHRONIZED_WITH_SOURCE_EDEFAULT; isSynchronizedWithSourceESet = false; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.UNSET, UmaPackage.DESCRIPTOR__IS_SYNCHRONIZED_WITH_SOURCE, oldIsSynchronizedWithSource, IS_SYNCHRONIZED_WITH_SOURCE_EDEFAULT, oldIsSynchronizedWithSourceESet)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean isSetIsSynchronizedWithSource() { return isSynchronizedWithSourceESet; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case UmaPackage.DESCRIPTOR__IS_SYNCHRONIZED_WITH_SOURCE: return isIsSynchronizedWithSource() ? Boolean.TRUE : Boolean.FALSE; } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case UmaPackage.DESCRIPTOR__IS_SYNCHRONIZED_WITH_SOURCE: setIsSynchronizedWithSource(((Boolean)newValue).booleanValue()); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case UmaPackage.DESCRIPTOR__IS_SYNCHRONIZED_WITH_SOURCE: unsetIsSynchronizedWithSource(); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case UmaPackage.DESCRIPTOR__IS_SYNCHRONIZED_WITH_SOURCE: return isSetIsSynchronizedWithSource(); } 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(" (isSynchronizedWithSource: "); if (isSynchronizedWithSourceESet) result.append(isSynchronizedWithSource); else result.append("<unset>"); result.append(')'); return result.toString(); } } //DescriptorImpl