blob: cb4e64795f90a5dc4b0366b0a4215fcc3184c697 [file] [log] [blame]
/**
* Copyright (c) 2009-2010 Thales Corporate Services S.A.S.
* 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:
* Thales Corporate Services S.A.S - initial API and implementation
*
* $Id$
*/
package org.eclipse.egf.portfolio.eclipse.build.buildcore.impl;
import org.eclipse.egf.portfolio.eclipse.build.buildcore.BuildcorePackage;
import org.eclipse.egf.portfolio.eclipse.build.buildcore.Job;
import org.eclipse.egf.portfolio.eclipse.build.buildcore.Step;
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.emf.ecore.util.EcoreUtil;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Step</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.egf.portfolio.eclipse.build.buildcore.impl.StepImpl#getJob <em>Job</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public abstract class StepImpl extends EObjectImpl implements Step {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static final String copyright = " Copyright (c) 2009-2010 Thales Corporate Services S.A.S.\r\n All rights reserved. This program and the accompanying materials\r\n are made available under the terms of the Eclipse Public License v1.0\r\n which accompanies this distribution, and is available at\r\n http://www.eclipse.org/legal/epl-v10.html\r\n \r\n Contributors:\r\n Thales Corporate Services S.A.S - initial API and implementation";
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected StepImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return BuildcorePackage.Literals.STEP;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Job getJob() {
if (eContainerFeatureID() != BuildcorePackage.STEP__JOB) return null;
return (Job)eContainer();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Job basicGetJob() {
if (eContainerFeatureID() != BuildcorePackage.STEP__JOB) return null;
return (Job)eInternalContainer();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetJob(Job newJob, NotificationChain msgs) {
msgs = eBasicSetContainer((InternalEObject)newJob, BuildcorePackage.STEP__JOB, msgs);
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setJob(Job newJob) {
if (newJob != eInternalContainer() || (eContainerFeatureID() != BuildcorePackage.STEP__JOB && newJob != null)) {
if (EcoreUtil.isAncestor(this, newJob))
throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
NotificationChain msgs = null;
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
if (newJob != null)
msgs = ((InternalEObject)newJob).eInverseAdd(this, BuildcorePackage.JOB__STEPS, Job.class, msgs);
msgs = basicSetJob(newJob, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BuildcorePackage.STEP__JOB, newJob, newJob));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case BuildcorePackage.STEP__JOB:
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
return basicSetJob((Job)otherEnd, msgs);
}
return super.eInverseAdd(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case BuildcorePackage.STEP__JOB:
return basicSetJob(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
switch (eContainerFeatureID()) {
case BuildcorePackage.STEP__JOB:
return eInternalContainer().eInverseRemove(this, BuildcorePackage.JOB__STEPS, Job.class, msgs);
}
return super.eBasicRemoveFromContainerFeature(msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case BuildcorePackage.STEP__JOB:
if (resolve) return getJob();
return basicGetJob();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case BuildcorePackage.STEP__JOB:
setJob((Job)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case BuildcorePackage.STEP__JOB:
setJob((Job)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case BuildcorePackage.STEP__JOB:
return basicGetJob() != null;
}
return super.eIsSet(featureID);
}
} //StepImpl