| /** |
| * Copyright (c) 2014, Loetz GmbH&Co.KG (Heidelberg) |
| * 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 |
| * |
| * Based on ideas from Xtext, Xtend, Xcore |
| * |
| * Contributors: |
| * Loetz GmbH&Co.KG - Initial implementation |
| * |
| */ |
| package org.eclipse.osbp.xtext.blip.impl; |
| |
| import org.eclipse.bpmn2.ScriptTask; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.eclipse.osbp.xtext.blip.BlipDSLPackage; |
| import org.eclipse.osbp.xtext.blip.BlipScript; |
| |
| import org.eclipse.osbp.xtext.functionlibrarydsl.FunctionLibraryFunction; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Blip Script</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.xtext.blip.impl.BlipScriptImpl#getTask <em>Task</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.blip.impl.BlipScriptImpl#getFunction <em>Function</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class BlipScriptImpl extends BlipItemImpl implements BlipScript { |
| /** |
| * The cached value of the '{@link #getTask() <em>Task</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getTask() |
| * @generated |
| * @ordered |
| */ |
| protected ScriptTask task; |
| |
| /** |
| * The cached value of the '{@link #getFunction() <em>Function</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getFunction() |
| * @generated |
| * @ordered |
| */ |
| protected FunctionLibraryFunction function; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected BlipScriptImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return BlipDSLPackage.Literals.BLIP_SCRIPT; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ScriptTask getTask() { |
| if (task != null && task.eIsProxy()) { |
| InternalEObject oldTask = (InternalEObject)task; |
| task = (ScriptTask)eResolveProxy(oldTask); |
| if (task != oldTask) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, BlipDSLPackage.BLIP_SCRIPT__TASK, oldTask, task)); |
| } |
| } |
| return task; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ScriptTask basicGetTask() { |
| return task; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setTask(ScriptTask newTask) { |
| ScriptTask oldTask = task; |
| task = newTask; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, BlipDSLPackage.BLIP_SCRIPT__TASK, oldTask, task)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public FunctionLibraryFunction getFunction() { |
| if (function != null && function.eIsProxy()) { |
| InternalEObject oldFunction = (InternalEObject)function; |
| function = (FunctionLibraryFunction)eResolveProxy(oldFunction); |
| if (function != oldFunction) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, BlipDSLPackage.BLIP_SCRIPT__FUNCTION, oldFunction, function)); |
| } |
| } |
| return function; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public FunctionLibraryFunction basicGetFunction() { |
| return function; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setFunction(FunctionLibraryFunction newFunction) { |
| FunctionLibraryFunction oldFunction = function; |
| function = newFunction; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, BlipDSLPackage.BLIP_SCRIPT__FUNCTION, oldFunction, function)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case BlipDSLPackage.BLIP_SCRIPT__TASK: |
| if (resolve) return getTask(); |
| return basicGetTask(); |
| case BlipDSLPackage.BLIP_SCRIPT__FUNCTION: |
| if (resolve) return getFunction(); |
| return basicGetFunction(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case BlipDSLPackage.BLIP_SCRIPT__TASK: |
| setTask((ScriptTask)newValue); |
| return; |
| case BlipDSLPackage.BLIP_SCRIPT__FUNCTION: |
| setFunction((FunctionLibraryFunction)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case BlipDSLPackage.BLIP_SCRIPT__TASK: |
| setTask((ScriptTask)null); |
| return; |
| case BlipDSLPackage.BLIP_SCRIPT__FUNCTION: |
| setFunction((FunctionLibraryFunction)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case BlipDSLPackage.BLIP_SCRIPT__TASK: |
| return task != null; |
| case BlipDSLPackage.BLIP_SCRIPT__FUNCTION: |
| return function != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //BlipScriptImpl |