blob: 0ffb2f2b452554e32b21b0a8091f502d3dbcbae5 [file] [log] [blame]
/**
* Copyright (c) 2012,2014 Mia-Software.
* 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:
* Nicolas Bros (Mia-Software) - Bug 379683 - customizable Tree content provider
* Gregoire Dupe (Mia-Software) - Bug 386387 - [CustomizedTreeContentProvider] The TreeElements are not preserved between two calls to getElements()
* Thomas Cicognani (Soft-Maint) - Bug 441321 - isVisible customisation doesn't work after refreshing a tree
*/
package org.eclipse.emf.facet.custom.metamodel.v0_2_0.internal.treeproxy.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.facet.custom.metamodel.v0_2_0.internal.treeproxy.EStructuralFeatureTreeElement;
import org.eclipse.emf.facet.custom.metamodel.v0_2_0.internal.treeproxy.TreeproxyPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>EStructural Feature Tree Element</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.emf.facet.custom.metamodel.v0_2_0.internal.treeproxy.impl.EStructuralFeatureTreeElementImpl#getEStructuralFeature <em>EStructural Feature</em>}</li>
* </ul>
* </p>
*
* @generated
* @since 0.5
*/
public abstract class EStructuralFeatureTreeElementImpl extends TreeElementImpl implements EStructuralFeatureTreeElement {
/**
* The cached value of the '{@link #getEStructuralFeature() <em>EStructural Feature</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getEStructuralFeature()
* @generated
* @ordered
*/
protected EStructuralFeature eStructuralFeature;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected EStructuralFeatureTreeElementImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return TreeproxyPackage.Literals.ESTRUCTURAL_FEATURE_TREE_ELEMENT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EStructuralFeature getEStructuralFeature() {
if (eStructuralFeature != null && eStructuralFeature.eIsProxy()) {
InternalEObject oldEStructuralFeature = (InternalEObject)eStructuralFeature;
eStructuralFeature = (EStructuralFeature)eResolveProxy(oldEStructuralFeature);
if (eStructuralFeature != oldEStructuralFeature) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, TreeproxyPackage.ESTRUCTURAL_FEATURE_TREE_ELEMENT__ESTRUCTURAL_FEATURE, oldEStructuralFeature, eStructuralFeature));
}
}
return eStructuralFeature;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EStructuralFeature basicGetEStructuralFeature() {
return eStructuralFeature;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setEStructuralFeature(EStructuralFeature newEStructuralFeature) {
EStructuralFeature oldEStructuralFeature = eStructuralFeature;
eStructuralFeature = newEStructuralFeature;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TreeproxyPackage.ESTRUCTURAL_FEATURE_TREE_ELEMENT__ESTRUCTURAL_FEATURE, oldEStructuralFeature, eStructuralFeature));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case TreeproxyPackage.ESTRUCTURAL_FEATURE_TREE_ELEMENT__ESTRUCTURAL_FEATURE:
if (resolve) return getEStructuralFeature();
return basicGetEStructuralFeature();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case TreeproxyPackage.ESTRUCTURAL_FEATURE_TREE_ELEMENT__ESTRUCTURAL_FEATURE:
setEStructuralFeature((EStructuralFeature)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case TreeproxyPackage.ESTRUCTURAL_FEATURE_TREE_ELEMENT__ESTRUCTURAL_FEATURE:
setEStructuralFeature((EStructuralFeature)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case TreeproxyPackage.ESTRUCTURAL_FEATURE_TREE_ELEMENT__ESTRUCTURAL_FEATURE:
return eStructuralFeature != null;
}
return super.eIsSet(featureID);
}
} //EStructuralFeatureTreeElementImpl