blob: d4be362a0693da3a72504eada7336f929fe4147e [file] [log] [blame]
/**
* 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{
* Joerg Riegel - 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.PerspectiveSelection;
import org.eclipse.osbp.xtext.table.Table;
import org.eclipse.xtext.common.types.JvmTypeReference;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Perspective Selection</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.osbp.xtext.perspective.impl.PerspectiveSelectionImpl#getRef <em>Ref</em>}</li>
* <li>{@link org.eclipse.osbp.xtext.perspective.impl.PerspectiveSelectionImpl#getRefTypeJvm <em>Ref Type Jvm</em>}</li>
* </ul>
*
* @generated
*/
public class PerspectiveSelectionImpl extends PerspectiveLazyResolverImpl implements PerspectiveSelection {
/**
* The cached value of the '{@link #getRef() <em>Ref</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getRef()
* @generated
* @ordered
*/
protected Table 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 PerspectiveSelectionImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return PerspectiveDslPackage.Literals.PERSPECTIVE_SELECTION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Table getRef() {
if (ref != null && ref.eIsProxy()) {
InternalEObject oldRef = (InternalEObject)ref;
ref = (Table)eResolveProxy(oldRef);
if (ref != oldRef) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, PerspectiveDslPackage.PERSPECTIVE_SELECTION__REF, oldRef, ref));
}
}
return ref;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Table basicGetRef() {
return ref;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setRef(Table newRef) {
Table oldRef = ref;
ref = newRef;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, PerspectiveDslPackage.PERSPECTIVE_SELECTION__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_SELECTION__REF_TYPE_JVM, null, null);
if (newRefTypeJvm.eInternalContainer() == null) {
msgs = newRefTypeJvm.eInverseAdd(this, EOPPOSITE_FEATURE_BASE - PerspectiveDslPackage.PERSPECTIVE_SELECTION__REF_TYPE_JVM, null, msgs);
}
if (msgs != null) msgs.dispatch();
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, PerspectiveDslPackage.PERSPECTIVE_SELECTION__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_SELECTION__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_SELECTION__REF_TYPE_JVM, null, msgs);
if (newRefTypeJvm != null)
msgs = ((InternalEObject)newRefTypeJvm).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - PerspectiveDslPackage.PERSPECTIVE_SELECTION__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_SELECTION__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_SELECTION__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_SELECTION__REF:
if (resolve) return getRef();
return basicGetRef();
case PerspectiveDslPackage.PERSPECTIVE_SELECTION__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_SELECTION__REF:
setRef((Table)newValue);
return;
case PerspectiveDslPackage.PERSPECTIVE_SELECTION__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_SELECTION__REF:
setRef((Table)null);
return;
case PerspectiveDslPackage.PERSPECTIVE_SELECTION__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_SELECTION__REF:
return ref != null;
case PerspectiveDslPackage.PERSPECTIVE_SELECTION__REF_TYPE_JVM:
return refTypeJvm != null;
}
return super.eIsSet(featureID);
}
} //PerspectiveSelectionImpl