| /** |
| * Copyright (c) 2011-2015 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.emfforms.spi.spreadsheet.core.error.model.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.emf.ecore.impl.MinimalEObjectImpl; |
| import org.eclipse.emf.ecp.view.spi.model.VDomainModelReference; |
| import org.eclipse.emfforms.spi.spreadsheet.core.error.model.DMRLocation; |
| import org.eclipse.emfforms.spi.spreadsheet.core.error.model.ErrorPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>DMR Location</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.emfforms.spi.spreadsheet.core.error.model.impl.DMRLocationImpl#getDomainModelReference |
| * <em>Domain Model Reference</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class DMRLocationImpl extends MinimalEObjectImpl.Container implements DMRLocation { |
| /** |
| * The cached value of the '{@link #getDomainModelReference() <em>Domain Model Reference</em>}' containment |
| * reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @see #getDomainModelReference() |
| * @generated |
| * @ordered |
| */ |
| protected VDomainModelReference domainModelReference; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| protected DMRLocationImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return ErrorPackage.Literals.DMR_LOCATION; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public VDomainModelReference getDomainModelReference() { |
| return domainModelReference; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public NotificationChain basicSetDomainModelReference(VDomainModelReference newDomainModelReference, |
| NotificationChain msgs) { |
| final VDomainModelReference oldDomainModelReference = domainModelReference; |
| domainModelReference = newDomainModelReference; |
| if (eNotificationRequired()) { |
| final ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, |
| ErrorPackage.DMR_LOCATION__DOMAIN_MODEL_REFERENCE, oldDomainModelReference, newDomainModelReference); |
| if (msgs == null) { |
| msgs = notification; |
| } else { |
| msgs.add(notification); |
| } |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public void setDomainModelReference(VDomainModelReference newDomainModelReference) { |
| if (newDomainModelReference != domainModelReference) { |
| NotificationChain msgs = null; |
| if (domainModelReference != null) { |
| msgs = ((InternalEObject) domainModelReference).eInverseRemove(this, |
| EOPPOSITE_FEATURE_BASE - ErrorPackage.DMR_LOCATION__DOMAIN_MODEL_REFERENCE, null, msgs); |
| } |
| if (newDomainModelReference != null) { |
| msgs = ((InternalEObject) newDomainModelReference).eInverseAdd(this, |
| EOPPOSITE_FEATURE_BASE - ErrorPackage.DMR_LOCATION__DOMAIN_MODEL_REFERENCE, null, msgs); |
| } |
| msgs = basicSetDomainModelReference(newDomainModelReference, msgs); |
| if (msgs != null) { |
| msgs.dispatch(); |
| } |
| } else if (eNotificationRequired()) { |
| eNotify(new ENotificationImpl(this, Notification.SET, ErrorPackage.DMR_LOCATION__DOMAIN_MODEL_REFERENCE, |
| newDomainModelReference, newDomainModelReference)); |
| } |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case ErrorPackage.DMR_LOCATION__DOMAIN_MODEL_REFERENCE: |
| return basicSetDomainModelReference(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 ErrorPackage.DMR_LOCATION__DOMAIN_MODEL_REFERENCE: |
| return getDomainModelReference(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case ErrorPackage.DMR_LOCATION__DOMAIN_MODEL_REFERENCE: |
| setDomainModelReference((VDomainModelReference) newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case ErrorPackage.DMR_LOCATION__DOMAIN_MODEL_REFERENCE: |
| setDomainModelReference((VDomainModelReference) null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case ErrorPackage.DMR_LOCATION__DOMAIN_MODEL_REFERENCE: |
| return domainModelReference != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } // DMRLocationImpl |