blob: 12007b9203a5fb9c7179f2e10f065d0fd2c200eb [file] [log] [blame]
/**
* Copyright (c) 2011-2014 EclipseSource Muenchen GmbH and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Johannes Faltermeier - initial API and implementation
*/
package org.eclipse.emf.ecp.view.spi.compoundcontrol.model.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.emf.ecp.view.spi.compoundcontrol.model.VCompoundControl;
import org.eclipse.emf.ecp.view.spi.compoundcontrol.model.VCompoundcontrolPackage;
import org.eclipse.emf.ecp.view.spi.model.VControl;
import org.eclipse.emf.ecp.view.spi.model.impl.VControlImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Compound Control</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.emf.ecp.view.spi.compoundcontrol.model.impl.VCompoundControlImpl#getControls <em>Controls</em>
* }</li>
* </ul>
*
* @generated
*/
public class VCompoundControlImpl extends VControlImpl implements VCompoundControl {
/**
* The cached value of the '{@link #getControls() <em>Controls</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @see #getControls()
* @generated
* @ordered
*/
protected EList<VControl> controls;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
protected VCompoundControlImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return VCompoundcontrolPackage.Literals.COMPOUND_CONTROL;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public EList<VControl> getControls() {
if (controls == null) {
controls = new EObjectContainmentEList<VControl>(VControl.class, this,
VCompoundcontrolPackage.COMPOUND_CONTROL__CONTROLS);
}
return controls;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case VCompoundcontrolPackage.COMPOUND_CONTROL__CONTROLS:
return ((InternalEList<?>) getControls()).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 VCompoundcontrolPackage.COMPOUND_CONTROL__CONTROLS:
return getControls();
}
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 VCompoundcontrolPackage.COMPOUND_CONTROL__CONTROLS:
getControls().clear();
getControls().addAll((Collection<? extends VControl>) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case VCompoundcontrolPackage.COMPOUND_CONTROL__CONTROLS:
getControls().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case VCompoundcontrolPackage.COMPOUND_CONTROL__CONTROLS:
return controls != null && !controls.isEmpty();
}
return super.eIsSet(featureID);
}
} // VCompoundControlImpl