| /** |
| * 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 v1.0 |
| * which accompanies this distribution, and is available at |
| * http{//www.eclipse.org/legal/epl-v10.html |
| * |
| * Based on ideas from Xtext, Xtend, Xcore |
| * |
| * Contributors{ |
| * Christophe Loetz (Loetz GmbH&Co.KG) - Initial implementation |
| * |
| */ |
| package org.eclipse.osbp.xtext.perspective.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.xtext.perspective.PerspectiveDslPackage; |
| import org.eclipse.osbp.xtext.perspective.PerspectiveReport; |
| |
| import org.eclipse.osbp.xtext.reportdsl.Report; |
| |
| import org.eclipse.xtext.common.types.JvmTypeReference; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Perspective Report</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.osbp.xtext.perspective.impl.PerspectiveReportImpl#getRef <em>Ref</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.perspective.impl.PerspectiveReportImpl#getRefTypeJvm <em>Ref Type Jvm</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class PerspectiveReportImpl extends PerspectiveLazyResolverImpl implements PerspectiveReport { |
| /** |
| * The cached value of the '{@link #getRef() <em>Ref</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getRef() |
| * @generated |
| * @ordered |
| */ |
| protected Report ref; |
| |
| /** |
| * The cached value of the '{@link #getRefTypeJvm() <em>Ref Type Jvm</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getRefTypeJvm() |
| * @generated |
| * @ordered |
| */ |
| protected JvmTypeReference refTypeJvm; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected PerspectiveReportImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return PerspectiveDslPackage.Literals.PERSPECTIVE_REPORT; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Report getRef() { |
| if (ref != null && ref.eIsProxy()) { |
| InternalEObject oldRef = (InternalEObject)ref; |
| ref = (Report)eResolveProxy(oldRef); |
| if (ref != oldRef) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, PerspectiveDslPackage.PERSPECTIVE_REPORT__REF, oldRef, ref)); |
| } |
| } |
| return ref; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Report basicGetRef() { |
| return ref; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setRef(Report newRef) { |
| Report oldRef = ref; |
| ref = newRef; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, PerspectiveDslPackage.PERSPECTIVE_REPORT__REF, oldRef, ref)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public JvmTypeReference getRefTypeJvm() { |
| if (refTypeJvm != null && refTypeJvm.eIsProxy()) { |
| InternalEObject oldRefTypeJvm = (InternalEObject)refTypeJvm; |
| refTypeJvm = (JvmTypeReference)eResolveProxy(oldRefTypeJvm); |
| if (refTypeJvm != oldRefTypeJvm) { |
| InternalEObject newRefTypeJvm = (InternalEObject)refTypeJvm; |
| NotificationChain msgs = oldRefTypeJvm.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - PerspectiveDslPackage.PERSPECTIVE_REPORT__REF_TYPE_JVM, null, null); |
| if (newRefTypeJvm.eInternalContainer() == null) { |
| msgs = newRefTypeJvm.eInverseAdd(this, EOPPOSITE_FEATURE_BASE - PerspectiveDslPackage.PERSPECTIVE_REPORT__REF_TYPE_JVM, null, msgs); |
| } |
| if (msgs != null) msgs.dispatch(); |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, PerspectiveDslPackage.PERSPECTIVE_REPORT__REF_TYPE_JVM, oldRefTypeJvm, refTypeJvm)); |
| } |
| } |
| return refTypeJvm; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public JvmTypeReference basicGetRefTypeJvm() { |
| return refTypeJvm; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetRefTypeJvm(JvmTypeReference newRefTypeJvm, NotificationChain msgs) { |
| JvmTypeReference oldRefTypeJvm = refTypeJvm; |
| refTypeJvm = newRefTypeJvm; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, PerspectiveDslPackage.PERSPECTIVE_REPORT__REF_TYPE_JVM, oldRefTypeJvm, newRefTypeJvm); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setRefTypeJvm(JvmTypeReference newRefTypeJvm) { |
| if (newRefTypeJvm != refTypeJvm) { |
| NotificationChain msgs = null; |
| if (refTypeJvm != null) |
| msgs = ((InternalEObject)refTypeJvm).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - PerspectiveDslPackage.PERSPECTIVE_REPORT__REF_TYPE_JVM, null, msgs); |
| if (newRefTypeJvm != null) |
| msgs = ((InternalEObject)newRefTypeJvm).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - PerspectiveDslPackage.PERSPECTIVE_REPORT__REF_TYPE_JVM, null, msgs); |
| msgs = basicSetRefTypeJvm(newRefTypeJvm, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, PerspectiveDslPackage.PERSPECTIVE_REPORT__REF_TYPE_JVM, newRefTypeJvm, newRefTypeJvm)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case PerspectiveDslPackage.PERSPECTIVE_REPORT__REF_TYPE_JVM: |
| return basicSetRefTypeJvm(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 PerspectiveDslPackage.PERSPECTIVE_REPORT__REF: |
| if (resolve) return getRef(); |
| return basicGetRef(); |
| case PerspectiveDslPackage.PERSPECTIVE_REPORT__REF_TYPE_JVM: |
| if (resolve) return getRefTypeJvm(); |
| return basicGetRefTypeJvm(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case PerspectiveDslPackage.PERSPECTIVE_REPORT__REF: |
| setRef((Report)newValue); |
| return; |
| case PerspectiveDslPackage.PERSPECTIVE_REPORT__REF_TYPE_JVM: |
| setRefTypeJvm((JvmTypeReference)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case PerspectiveDslPackage.PERSPECTIVE_REPORT__REF: |
| setRef((Report)null); |
| return; |
| case PerspectiveDslPackage.PERSPECTIVE_REPORT__REF_TYPE_JVM: |
| setRefTypeJvm((JvmTypeReference)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case PerspectiveDslPackage.PERSPECTIVE_REPORT__REF: |
| return ref != null; |
| case PerspectiveDslPackage.PERSPECTIVE_REPORT__REF_TYPE_JVM: |
| return refTypeJvm != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //PerspectiveReportImpl |