| /** |
| * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) |
| * 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 |
| * |
| * Based on ideas from Xtext, Xtend, Xcore |
| * |
| * Contributors: |
| * Jose C. Dominguez - Initial implementation |
| * |
| */ |
| package org.eclipse.osbp.xtext.strategy.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.common.notify.NotificationChain; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.eclipse.osbp.dsl.semantic.common.types.impl.LPackageImpl; |
| |
| import org.eclipse.osbp.xtext.strategy.Strategy; |
| import org.eclipse.osbp.xtext.strategy.StrategyDSLPackage; |
| import org.eclipse.osbp.xtext.strategy.StrategyPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Strategy Package</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.xtext.strategy.impl.StrategyPackageImpl#getStrategy <em>Strategy</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class StrategyPackageImpl extends LPackageImpl implements StrategyPackage { |
| /** |
| * The cached value of the '{@link #getStrategy() <em>Strategy</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getStrategy() |
| * @generated |
| * @ordered |
| */ |
| protected Strategy strategy; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected StrategyPackageImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return StrategyDSLPackage.Literals.STRATEGY_PACKAGE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Strategy getStrategy() { |
| return strategy; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetStrategy(Strategy newStrategy, NotificationChain msgs) { |
| Strategy oldStrategy = strategy; |
| strategy = newStrategy; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, StrategyDSLPackage.STRATEGY_PACKAGE__STRATEGY, oldStrategy, newStrategy); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setStrategy(Strategy newStrategy) { |
| if (newStrategy != strategy) { |
| NotificationChain msgs = null; |
| if (strategy != null) |
| msgs = ((InternalEObject)strategy).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - StrategyDSLPackage.STRATEGY_PACKAGE__STRATEGY, null, msgs); |
| if (newStrategy != null) |
| msgs = ((InternalEObject)newStrategy).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - StrategyDSLPackage.STRATEGY_PACKAGE__STRATEGY, null, msgs); |
| msgs = basicSetStrategy(newStrategy, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, StrategyDSLPackage.STRATEGY_PACKAGE__STRATEGY, newStrategy, newStrategy)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case StrategyDSLPackage.STRATEGY_PACKAGE__STRATEGY: |
| return basicSetStrategy(null, 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 StrategyDSLPackage.STRATEGY_PACKAGE__STRATEGY: |
| return getStrategy(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case StrategyDSLPackage.STRATEGY_PACKAGE__STRATEGY: |
| setStrategy((Strategy)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case StrategyDSLPackage.STRATEGY_PACKAGE__STRATEGY: |
| setStrategy((Strategy)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case StrategyDSLPackage.STRATEGY_PACKAGE__STRATEGY: |
| return strategy != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //StrategyPackageImpl |