| /** |
| * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) |
| * 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: |
| * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation |
| * |
| * generated from ActionDSL.xcore |
| * |
| * |
| */ |
| package org.eclipse.osbp.xtext.action.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.eclipse.osbp.xtext.action.ActionDSLPackage; |
| import org.eclipse.osbp.xtext.action.ActionTask; |
| import org.eclipse.osbp.xtext.action.TaskActionEnum; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Action Task</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.xtext.action.impl.ActionTaskImpl#getAction <em>Action</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class ActionTaskImpl extends ActionLazyResolverImpl implements ActionTask { |
| /** |
| * The default value of the '{@link #getAction() <em>Action</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getAction() |
| * @generated |
| * @ordered |
| */ |
| protected static final TaskActionEnum ACTION_EDEFAULT = TaskActionEnum.TASK_ACTION_CLAIM; |
| |
| /** |
| * The cached value of the '{@link #getAction() <em>Action</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getAction() |
| * @generated |
| * @ordered |
| */ |
| protected TaskActionEnum action = ACTION_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ActionTaskImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return ActionDSLPackage.Literals.ACTION_TASK; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public TaskActionEnum getAction() { |
| return action; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setAction(TaskActionEnum newAction) { |
| TaskActionEnum oldAction = action; |
| action = newAction == null ? ACTION_EDEFAULT : newAction; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ActionDSLPackage.ACTION_TASK__ACTION, oldAction, action)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case ActionDSLPackage.ACTION_TASK__ACTION: |
| return getAction(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case ActionDSLPackage.ACTION_TASK__ACTION: |
| setAction((TaskActionEnum)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case ActionDSLPackage.ACTION_TASK__ACTION: |
| setAction(ACTION_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case ActionDSLPackage.ACTION_TASK__ACTION: |
| return action != ACTION_EDEFAULT; |
| } |
| 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(" (action: "); |
| result.append(action); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //ActionTaskImpl |