blob: c7459effa7975cd733d52b20e46f2bdad6e85c3e [file] [log] [blame]
/**
* Copyright (c) 2008 IBM Corporation and others.
* 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
*
* Contributors:
* IBM Corporation - initial API and implementation
*
* $Id$
*/
package org.eclipse.e4.ui.model.internal.workbench;
import org.eclipse.e4.ui.model.application.MPart;
import org.eclipse.e4.ui.model.internal.application.MPartImpl;
import org.eclipse.e4.ui.model.workbench.MProxyPart;
import org.eclipse.e4.ui.model.workbench.WorkbenchPackage;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>MProxy Part</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.e4.ui.model.internal.workbench.MProxyPartImpl#getPart <em>Part</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public abstract class MProxyPartImpl<P extends MPart<?>> extends MPartImpl<P> implements MProxyPart<P> {
/**
* The cached value of the '{@link #getPart() <em>Part</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPart()
* @generated
* @ordered
*/
protected MPart<?> part;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected MProxyPartImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return WorkbenchPackage.Literals.MPROXY_PART;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public MPart<?> getPart() {
if (part != null && part.eIsProxy()) {
InternalEObject oldPart = (InternalEObject)part;
part = (MPart<?>)eResolveProxy(oldPart);
if (part != oldPart) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, WorkbenchPackage.MPROXY_PART__PART, oldPart, part));
}
}
return part;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public MPart<?> basicGetPart() {
return part;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setPart(MPart<?> newPart) {
MPart<?> oldPart = part;
part = newPart;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, WorkbenchPackage.MPROXY_PART__PART, oldPart, part));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case WorkbenchPackage.MPROXY_PART__PART:
if (resolve) return getPart();
return basicGetPart();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case WorkbenchPackage.MPROXY_PART__PART:
setPart((MPart<?>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case WorkbenchPackage.MPROXY_PART__PART:
setPart((MPart<?>)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case WorkbenchPackage.MPROXY_PART__PART:
return part != null;
}
return super.eIsSet(featureID);
}
} //MProxyPartImpl