| /** |
| * <copyright> |
| * |
| * Copyright (c) 2008 E.D.Willink 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: |
| * E.D.Willink - initial API and implementation |
| * |
| * </copyright> |
| * |
| * $Id: OutlineElementImpl.java,v 1.1 2008/08/24 18:56:21 ewillink Exp $ |
| */ |
| package org.eclipse.qvt.declarative.editor.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.qvt.declarative.editor.EditorPackage; |
| import org.eclipse.qvt.declarative.editor.OutlineElement; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Outline Element</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.qvt.declarative.editor.impl.OutlineElementImpl#getFeature <em>Feature</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class OutlineElementImpl extends AbstractOutlineElementImpl implements OutlineElement { |
| /** |
| * The cached value of the '{@link #getFeature() <em>Feature</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getFeature() |
| * @generated |
| * @ordered |
| */ |
| protected EStructuralFeature feature; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected OutlineElementImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return EditorPackage.Literals.OUTLINE_ELEMENT; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EStructuralFeature getFeature() { |
| if (feature != null && feature.eIsProxy()) { |
| InternalEObject oldFeature = (InternalEObject)feature; |
| feature = (EStructuralFeature)eResolveProxy(oldFeature); |
| if (feature != oldFeature) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, EditorPackage.OUTLINE_ELEMENT__FEATURE, oldFeature, feature)); |
| } |
| } |
| return feature; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EStructuralFeature basicGetFeature() { |
| return feature; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setFeature(EStructuralFeature newFeature) { |
| EStructuralFeature oldFeature = feature; |
| feature = newFeature; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, EditorPackage.OUTLINE_ELEMENT__FEATURE, oldFeature, feature)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case EditorPackage.OUTLINE_ELEMENT__FEATURE: |
| if (resolve) return getFeature(); |
| return basicGetFeature(); |
| } |
| 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.OUTLINE_ELEMENT__FEATURE: |
| setFeature((EStructuralFeature)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case EditorPackage.OUTLINE_ELEMENT__FEATURE: |
| setFeature((EStructuralFeature)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case EditorPackage.OUTLINE_ELEMENT__FEATURE: |
| return feature != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //OutlineElementImpl |