| /**
|
| * Copyright (c) 2011, 2019 Mia-Software.
|
| *
|
| * 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
|
| * http://www.eclipse.org/legal/epl-v20.html
|
| *
|
| * Contributors:
|
| * Grégoire Dupé (Mia-Software) - Design
|
| * Nicolas Guyomar (Mia-Software) - Implementation
|
| * Grégoire Dupé (Mia-Software) - Bug 477657 - The catalog manager should be able to manage workspace model
|
| */ |
| package org.eclipse.modisco.facet.util.emf.catalog.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.impl.EObjectImpl;
|
|
|
| import org.eclipse.emf.ecore.util.EObjectContainmentEList;
|
| import org.eclipse.emf.ecore.util.InternalEList;
|
| import org.eclipse.modisco.facet.util.emf.catalog.Catalog;
|
| import org.eclipse.modisco.facet.util.emf.catalog.CatalogPackage;
|
| import org.eclipse.modisco.facet.util.emf.catalog.CatalogSet;
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * An implementation of the model object '<em><b>Set</b></em>'.
|
| * <!-- end-user-doc -->
|
| * <p>
|
| * The following features are implemented:
|
| * <ul>
|
| * <li>{@link org.eclipse.modisco.facet.util.emf.catalog.impl.CatalogSetImpl#getCatalogs <em>Catalogs</em>}</li>
|
| * </ul>
|
| * </p>
|
| *
|
| * @generated
|
| */
|
| @Deprecated
|
| public class CatalogSetImpl extends EObjectImpl implements CatalogSet {
|
| /**
|
| * The cached value of the '{@link #getCatalogs() <em>Catalogs</em>}' containment reference list.
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @see #getCatalogs()
|
| * @generated
|
| * @ordered
|
| */
|
| protected EList<Catalog> catalogs;
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| protected CatalogSetImpl() {
|
| super();
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| protected EClass eStaticClass() {
|
| return CatalogPackage.Literals.CATALOG_SET;
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| public EList<Catalog> getCatalogs() {
|
| if (catalogs == null) {
|
| catalogs = new EObjectContainmentEList<Catalog>(Catalog.class, this, CatalogPackage.CATALOG_SET__CATALOGS);
|
| }
|
| return catalogs;
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
|
| switch (featureID) {
|
| case CatalogPackage.CATALOG_SET__CATALOGS:
|
| return ((InternalEList<?>)getCatalogs()).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 CatalogPackage.CATALOG_SET__CATALOGS:
|
| return getCatalogs();
|
| }
|
| 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 CatalogPackage.CATALOG_SET__CATALOGS:
|
| getCatalogs().clear();
|
| getCatalogs().addAll((Collection<? extends Catalog>)newValue);
|
| return;
|
| }
|
| super.eSet(featureID, newValue);
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| public void eUnset(int featureID) {
|
| switch (featureID) {
|
| case CatalogPackage.CATALOG_SET__CATALOGS:
|
| getCatalogs().clear();
|
| return;
|
| }
|
| super.eUnset(featureID);
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| public boolean eIsSet(int featureID) {
|
| switch (featureID) {
|
| case CatalogPackage.CATALOG_SET__CATALOGS:
|
| return catalogs != null && !catalogs.isEmpty();
|
| }
|
| return super.eIsSet(featureID);
|
| }
|
|
|
| } //CatalogSetImpl
|