| /** |
| * Copyright (c) 2000-2009, Intalio Inc. |
| * 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: |
| * Intalio Inc. - initial API and implementation |
| * |
| */ |
| package org.eclipse.mdt.bpmn.impl; |
| |
| 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.EObjectImpl; |
| |
| import org.eclipse.emf.ecore.util.BasicFeatureMap; |
| import org.eclipse.emf.ecore.util.FeatureMap; |
| import org.eclipse.emf.ecore.util.InternalEList; |
| |
| import org.eclipse.mdt.bpmn.BpmnPackage; |
| import org.eclipse.mdt.bpmn.Script; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Script</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.mdt.bpmn.impl.ScriptImpl#getMixed <em>Mixed</em>}</li> |
| * <li>{@link org.eclipse.mdt.bpmn.impl.ScriptImpl#getAny <em>Any</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class ScriptImpl extends EObjectImpl implements Script { |
| /** |
| * The cached value of the '{@link #getMixed() <em>Mixed</em>}' attribute list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getMixed() |
| * @generated |
| * @ordered |
| */ |
| protected FeatureMap mixed; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ScriptImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return BpmnPackage.eINSTANCE.getScript(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public FeatureMap getMixed() { |
| if (mixed == null) { |
| mixed = new BasicFeatureMap(this, BpmnPackage.SCRIPT__MIXED); |
| } |
| return mixed; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public FeatureMap getAny() { |
| return (FeatureMap) getMixed().<FeatureMap.Entry> list( |
| BpmnPackage.eINSTANCE.getScript_Any()); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, |
| int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case BpmnPackage.SCRIPT__MIXED: |
| return ((InternalEList<?>) getMixed()).basicRemove(otherEnd, msgs); |
| case BpmnPackage.SCRIPT__ANY: |
| return ((InternalEList<?>) getAny()).basicRemove(otherEnd, 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 BpmnPackage.SCRIPT__MIXED: |
| if (coreType) |
| return getMixed(); |
| return ((FeatureMap.Internal) getMixed()).getWrapper(); |
| case BpmnPackage.SCRIPT__ANY: |
| if (coreType) |
| return getAny(); |
| return ((FeatureMap.Internal) getAny()).getWrapper(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case BpmnPackage.SCRIPT__MIXED: |
| ((FeatureMap.Internal) getMixed()).set(newValue); |
| return; |
| case BpmnPackage.SCRIPT__ANY: |
| ((FeatureMap.Internal) getAny()).set(newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case BpmnPackage.SCRIPT__MIXED: |
| getMixed().clear(); |
| return; |
| case BpmnPackage.SCRIPT__ANY: |
| getAny().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case BpmnPackage.SCRIPT__MIXED: |
| return mixed != null && !mixed.isEmpty(); |
| case BpmnPackage.SCRIPT__ANY: |
| return !getAny().isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) |
| return super.toString(); |
| |
| StringBuffer result = new StringBuffer(super.toString()); |
| result.append(" (mixed: "); //$NON-NLS-1$ |
| result.append(mixed); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //ScriptImpl |