/** * Copyright (c) 2010, 2015 BestSolution.at 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: * Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation * IBM Corporation - initial API and implementation */ package org.eclipse.e4.ui.model.fragment.impl; import java.util.Collection; import java.util.List; import org.eclipse.e4.ui.model.application.MApplication; import org.eclipse.e4.ui.model.application.MApplicationElement; import org.eclipse.e4.ui.model.fragment.MModelFragment; 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; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Model Fragment</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * </p> * <ul> * <li>{@link org.eclipse.e4.ui.model.fragment.impl.ModelFragmentImpl#getElements <em>Elements</em>}</li> * </ul> * * @generated */ public abstract class ModelFragmentImpl extends org.eclipse.emf.ecore.impl.MinimalEObjectImpl.Container implements MModelFragment { /** * The cached value of the '{@link #getElements() <em>Elements</em>}' containment reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getElements() * @generated * @ordered */ protected EList<MApplicationElement> elements; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected ModelFragmentImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return FragmentPackageImpl.Literals.MODEL_FRAGMENT; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public List<MApplicationElement> getElements() { if (elements == null) { elements = new EObjectContainmentEList<MApplicationElement>(MApplicationElement.class, this, FragmentPackageImpl.MODEL_FRAGMENT__ELEMENTS); } return elements; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public List<MApplicationElement> merge(MApplication application) { // TODO: implement this method // Ensure that you remove @generated or mark it @generated NOT throw new UnsupportedOperationException(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case FragmentPackageImpl.MODEL_FRAGMENT__ELEMENTS: return ((InternalEList<?>)getElements()).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 FragmentPackageImpl.MODEL_FRAGMENT__ELEMENTS: return getElements(); } 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 FragmentPackageImpl.MODEL_FRAGMENT__ELEMENTS: getElements().clear(); getElements().addAll((Collection<? extends MApplicationElement>)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case FragmentPackageImpl.MODEL_FRAGMENT__ELEMENTS: getElements().clear(); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case FragmentPackageImpl.MODEL_FRAGMENT__ELEMENTS: return elements != null && !elements.isEmpty(); } return super.eIsSet(featureID); } } //ModelFragmentImpl