blob: 75ed881f0fd0cd92c700ad8e1395f7a18d3d301c [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.buildstep.impl;
import java.util.Collection;
import org.eclipse.egf.portfolio.eclipse.build.buildcore.BuildcorePackage;
import org.eclipse.egf.portfolio.eclipse.build.buildcore.Item;
import org.eclipse.egf.portfolio.eclipse.build.buildcore.Property;
import org.eclipse.egf.portfolio.eclipse.build.buildcore.impl.StepImpl;
import org.eclipse.egf.portfolio.eclipse.build.buildstep.BuildstepPackage;
import org.eclipse.egf.portfolio.eclipse.build.buildstep.EGFSystemProperty;
import org.eclipse.egf.portfolio.eclipse.build.buildstep.EgfActivity;
import org.eclipse.egf.portfolio.eclipse.build.buildstep.EgfStep;
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.util.EDataTypeEList;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Egf Step</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.egf.portfolio.eclipse.build.buildstep.impl.EgfStepImpl#getProperties <em>Properties</em>}</li>
* <li>{@link org.eclipse.egf.portfolio.eclipse.build.buildstep.impl.EgfStepImpl#getEgfActivities <em>Egf Activities</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class EgfStepImpl extends StepImpl implements EgfStep {
/**
* <!-- 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";
/**
* The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getProperties()
* @generated
* @ordered
*/
protected EList<EGFSystemProperty> properties;
/**
* The cached value of the '{@link #getEgfActivities() <em>Egf Activities</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getEgfActivities()
* @generated
* @ordered
*/
protected EList<EgfActivity> egfActivities;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected EgfStepImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return BuildstepPackage.Literals.EGF_STEP;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<EGFSystemProperty> getProperties() {
if (properties == null) {
properties = new EObjectContainmentEList<EGFSystemProperty>(EGFSystemProperty.class, this, BuildstepPackage.EGF_STEP__PROPERTIES);
}
return properties;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<EgfActivity> getEgfActivities() {
if (egfActivities == null) {
egfActivities = new EObjectContainmentEList.Resolving<EgfActivity>(EgfActivity.class, this, BuildstepPackage.EGF_STEP__EGF_ACTIVITIES);
}
return egfActivities;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case BuildstepPackage.EGF_STEP__PROPERTIES:
return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
case BuildstepPackage.EGF_STEP__EGF_ACTIVITIES:
return ((InternalEList<?>)getEgfActivities()).basicRemove(otherEnd, 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 BuildstepPackage.EGF_STEP__PROPERTIES:
return getProperties();
case BuildstepPackage.EGF_STEP__EGF_ACTIVITIES:
return getEgfActivities();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case BuildstepPackage.EGF_STEP__PROPERTIES:
getProperties().clear();
getProperties().addAll((Collection<? extends EGFSystemProperty>)newValue);
return;
case BuildstepPackage.EGF_STEP__EGF_ACTIVITIES:
getEgfActivities().clear();
getEgfActivities().addAll((Collection<? extends EgfActivity>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case BuildstepPackage.EGF_STEP__PROPERTIES:
getProperties().clear();
return;
case BuildstepPackage.EGF_STEP__EGF_ACTIVITIES:
getEgfActivities().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case BuildstepPackage.EGF_STEP__PROPERTIES:
return properties != null && !properties.isEmpty();
case BuildstepPackage.EGF_STEP__EGF_ACTIVITIES:
return egfActivities != null && !egfActivities.isEmpty();
}
return super.eIsSet(featureID);
}
} //EgfStepImpl