/******************************************************************************* * Copyright (c) 2006, 2020 Borland Software Corporation, CEA LIST, ARTAL * * 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: * Borland - initial API and implementation * Aurelien Didier (ARTAL) - aurelien.didier51@gmail.com - Bug 569174 ******************************************************************************/ /** * * * * $Id$ */ package org.eclipse.papyrus.gmf.tooldef.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.papyrus.gmf.tooldef.GMFToolPackage; import org.eclipse.papyrus.gmf.tooldef.ItemBase; import org.eclipse.papyrus.gmf.tooldef.Menu; /** * * An implementation of the model object 'Menu'. * *

* The following features are implemented: *

*

* * @generated */ public abstract class MenuImpl extends EObjectImpl implements Menu { /** * The cached value of the '{@link #getItems() Items}' containment reference list. * * * @see #getItems() * @generated * @ordered */ protected EList items; /** * * * @generated */ protected MenuImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return GMFToolPackage.eINSTANCE.getMenu(); } /** * * * @generated */ public EList getItems() { if (items == null) { items = new EObjectContainmentEList(ItemBase.class, this, GMFToolPackage.MENU__ITEMS); } return items; } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case GMFToolPackage.MENU__ITEMS: return ((InternalEList) getItems()).basicRemove(otherEnd, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case GMFToolPackage.MENU__ITEMS: return getItems(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case GMFToolPackage.MENU__ITEMS: getItems().clear(); getItems().addAll((Collection) newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case GMFToolPackage.MENU__ITEMS: getItems().clear(); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case GMFToolPackage.MENU__ITEMS: return items != null && !items.isEmpty(); } return super.eIsSet(featureID); } } //MenuImpl