/*******************************************************************************
* Copyright (c) 2008, 2012 Obeo.
* 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:
* Obeo - initial API and implementation
*******************************************************************************/
package org.eclipse.emf.eef.extended.editor.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.EObjectImpl;
import org.eclipse.emf.eef.extended.editor.EEFEditorContribution;
import org.eclipse.emf.eef.extended.editor.EEFPageInput;
import org.eclipse.emf.eef.extended.editor.EditorPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>EEF Editor Contribution</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.emf.eef.extended.editor.impl.EEFEditorContributionImpl#getInput <em>Input</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public abstract class EEFEditorContributionImpl extends EObjectImpl implements EEFEditorContribution {
/**
* The cached value of the '{@link #getInput() <em>Input</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getInput()
* @generated
* @ordered
*/
protected EEFPageInput input;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected EEFEditorContributionImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return EditorPackage.Literals.EEF_EDITOR_CONTRIBUTION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EEFPageInput getInput() {
return input;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetInput(EEFPageInput newInput, NotificationChain msgs) {
EEFPageInput oldInput = input;
input = newInput;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EditorPackage.EEF_EDITOR_CONTRIBUTION__INPUT, oldInput, newInput);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setInput(EEFPageInput newInput) {
if (newInput != input) {
NotificationChain msgs = null;
if (input != null)
msgs = ((InternalEObject)input).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EditorPackage.EEF_EDITOR_CONTRIBUTION__INPUT, null, msgs);
if (newInput != null)
msgs = ((InternalEObject)newInput).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EditorPackage.EEF_EDITOR_CONTRIBUTION__INPUT, null, msgs);
msgs = basicSetInput(newInput, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EditorPackage.EEF_EDITOR_CONTRIBUTION__INPUT, newInput, newInput));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case EditorPackage.EEF_EDITOR_CONTRIBUTION__INPUT:
return basicSetInput(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 EditorPackage.EEF_EDITOR_CONTRIBUTION__INPUT:
return getInput();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case EditorPackage.EEF_EDITOR_CONTRIBUTION__INPUT:
setInput((EEFPageInput)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case EditorPackage.EEF_EDITOR_CONTRIBUTION__INPUT:
setInput((EEFPageInput)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case EditorPackage.EEF_EDITOR_CONTRIBUTION__INPUT:
return input != null;
}
return super.eIsSet(featureID);
}
} //EEFEditorContributionImpl