blob: 222605c69f593af60e5fa65fc1c222300c85030c [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2009, 2019 Xored Software Inc and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-v20.html
*
* Contributors:
* Xored Software Inc - initial API and implementation and/or initial documentation
*******************************************************************************/
package org.eclipse.rcptt.parameters.impl;
import java.util.Collection;
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.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.rcptt.core.scenario.impl.ContextImpl;
import org.eclipse.rcptt.parameters.Parameter;
import org.eclipse.rcptt.parameters.ParametersContext;
import org.eclipse.rcptt.parameters.ParametersPackage;
/**
* <!-- begin-user-doc --> An implementation of the model object '
* <em><b>Context</b></em>'. <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.rcptt.parameters.impl.ParametersContextImpl#getParameters <em>Parameters</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class ParametersContextImpl extends ContextImpl implements ParametersContext {
/**
* The cached value of the '{@link #getParameters() <em>Parameters</em>}' containment reference list.
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @see #getParameters()
* @generated
* @ordered
*/
protected EList<Parameter> parameters;
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
protected ParametersContextImpl() {
super();
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ParametersPackage.Literals.PARAMETERS_CONTEXT;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
public EList<Parameter> getParameters() {
if (parameters == null) {
parameters = new EObjectContainmentEList<Parameter>(Parameter.class, this, ParametersPackage.PARAMETERS_CONTEXT__PARAMETERS);
}
return parameters;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case ParametersPackage.PARAMETERS_CONTEXT__PARAMETERS:
return ((InternalEList<?>)getParameters()).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 ParametersPackage.PARAMETERS_CONTEXT__PARAMETERS:
return getParameters();
}
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 ParametersPackage.PARAMETERS_CONTEXT__PARAMETERS:
getParameters().clear();
getParameters().addAll((Collection<? extends Parameter>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ParametersPackage.PARAMETERS_CONTEXT__PARAMETERS:
getParameters().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ParametersPackage.PARAMETERS_CONTEXT__PARAMETERS:
return parameters != null && !parameters.isEmpty();
}
return super.eIsSet(featureID);
}
} // ParametersContextImpl