/******************************************************************************* * 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.eef.extended.editor.EEFEditorContribution; import org.eclipse.emf.eef.extended.editor.EEFPageInput; import org.eclipse.emf.eef.extended.editor.EditorPackage; import org.eclipse.emf.eef.extended.editor.StaticEEFEditorContribution; import org.eclipse.emf.eef.mapping.impl.AbstractElementBindingImpl; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Static EEF Editor Contribution</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.eclipse.emf.eef.extended.editor.impl.StaticEEFEditorContributionImpl#getInput <em>Input</em>}</li> * </ul> * </p> * * @generated */ public class StaticEEFEditorContributionImpl extends AbstractElementBindingImpl implements StaticEEFEditorContribution { /** * 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 StaticEEFEditorContributionImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return EditorPackage.Literals.STATIC_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.STATIC_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.STATIC_EEF_EDITOR_CONTRIBUTION__INPUT, null, msgs); if (newInput != null) msgs = ((InternalEObject)newInput).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EditorPackage.STATIC_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.STATIC_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.STATIC_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.STATIC_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.STATIC_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.STATIC_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.STATIC_EEF_EDITOR_CONTRIBUTION__INPUT: return input != null; } return super.eIsSet(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) { if (baseClass == EEFEditorContribution.class) { switch (derivedFeatureID) { case EditorPackage.STATIC_EEF_EDITOR_CONTRIBUTION__INPUT: return EditorPackage.EEF_EDITOR_CONTRIBUTION__INPUT; default: return -1; } } return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) { if (baseClass == EEFEditorContribution.class) { switch (baseFeatureID) { case EditorPackage.EEF_EDITOR_CONTRIBUTION__INPUT: return EditorPackage.STATIC_EEF_EDITOR_CONTRIBUTION__INPUT; default: return -1; } } return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); } } //StaticEEFEditorContributionImpl