| /** |
| * Copyright (c) 2011, 2017 - 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 |
| * |
| * Based on ideas from Xtext, Xtend, Xcore |
| * |
| * Contributors: |
| * Christophe Loetz (Loetz GmbH&Co.KG) - Initial implementation |
| * |
| */ |
| package org.eclipse.osbp.xtext.statemachine.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| 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.ENotificationImpl; |
| |
| import org.eclipse.osbp.xtext.statemachine.StatemachineControlDTOAttribute; |
| import org.eclipse.osbp.xtext.statemachine.StatemachineDSLPackage; |
| import org.eclipse.osbp.xtext.statemachine.StatemachineDTOType; |
| import org.eclipse.osbp.xtext.statemachine.StatemachineEvent; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Statemachine Control DTO Attribute</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.osbp.xtext.statemachine.impl.StatemachineControlDTOAttributeImpl#getAttributeType <em>Attribute Type</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.statemachine.impl.StatemachineControlDTOAttributeImpl#isHasEvent <em>Has Event</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.statemachine.impl.StatemachineControlDTOAttributeImpl#getEvent <em>Event</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class StatemachineControlDTOAttributeImpl extends StatemachineBaseImpl implements StatemachineControlDTOAttribute { |
| /** |
| * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getAttributeType() |
| * @generated |
| * @ordered |
| */ |
| protected StatemachineDTOType attributeType; |
| |
| /** |
| * The default value of the '{@link #isHasEvent() <em>Has Event</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isHasEvent() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean HAS_EVENT_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isHasEvent() <em>Has Event</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isHasEvent() |
| * @generated |
| * @ordered |
| */ |
| protected boolean hasEvent = HAS_EVENT_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getEvent() <em>Event</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getEvent() |
| * @generated |
| * @ordered |
| */ |
| protected StatemachineEvent event; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected StatemachineControlDTOAttributeImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return StatemachineDSLPackage.Literals.STATEMACHINE_CONTROL_DTO_ATTRIBUTE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public StatemachineDTOType getAttributeType() { |
| return attributeType; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetAttributeType(StatemachineDTOType newAttributeType, NotificationChain msgs) { |
| StatemachineDTOType oldAttributeType = attributeType; |
| attributeType = newAttributeType; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, StatemachineDSLPackage.STATEMACHINE_CONTROL_DTO_ATTRIBUTE__ATTRIBUTE_TYPE, oldAttributeType, newAttributeType); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setAttributeType(StatemachineDTOType newAttributeType) { |
| if (newAttributeType != attributeType) { |
| NotificationChain msgs = null; |
| if (attributeType != null) |
| msgs = ((InternalEObject)attributeType).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - StatemachineDSLPackage.STATEMACHINE_CONTROL_DTO_ATTRIBUTE__ATTRIBUTE_TYPE, null, msgs); |
| if (newAttributeType != null) |
| msgs = ((InternalEObject)newAttributeType).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - StatemachineDSLPackage.STATEMACHINE_CONTROL_DTO_ATTRIBUTE__ATTRIBUTE_TYPE, null, msgs); |
| msgs = basicSetAttributeType(newAttributeType, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, StatemachineDSLPackage.STATEMACHINE_CONTROL_DTO_ATTRIBUTE__ATTRIBUTE_TYPE, newAttributeType, newAttributeType)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean isHasEvent() { |
| return hasEvent; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setHasEvent(boolean newHasEvent) { |
| boolean oldHasEvent = hasEvent; |
| hasEvent = newHasEvent; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, StatemachineDSLPackage.STATEMACHINE_CONTROL_DTO_ATTRIBUTE__HAS_EVENT, oldHasEvent, hasEvent)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public StatemachineEvent getEvent() { |
| if (event != null && event.eIsProxy()) { |
| InternalEObject oldEvent = (InternalEObject)event; |
| event = (StatemachineEvent)eResolveProxy(oldEvent); |
| if (event != oldEvent) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, StatemachineDSLPackage.STATEMACHINE_CONTROL_DTO_ATTRIBUTE__EVENT, oldEvent, event)); |
| } |
| } |
| return event; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public StatemachineEvent basicGetEvent() { |
| return event; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setEvent(StatemachineEvent newEvent) { |
| StatemachineEvent oldEvent = event; |
| event = newEvent; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, StatemachineDSLPackage.STATEMACHINE_CONTROL_DTO_ATTRIBUTE__EVENT, oldEvent, event)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case StatemachineDSLPackage.STATEMACHINE_CONTROL_DTO_ATTRIBUTE__ATTRIBUTE_TYPE: |
| return basicSetAttributeType(null, 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 StatemachineDSLPackage.STATEMACHINE_CONTROL_DTO_ATTRIBUTE__ATTRIBUTE_TYPE: |
| return getAttributeType(); |
| case StatemachineDSLPackage.STATEMACHINE_CONTROL_DTO_ATTRIBUTE__HAS_EVENT: |
| return isHasEvent(); |
| case StatemachineDSLPackage.STATEMACHINE_CONTROL_DTO_ATTRIBUTE__EVENT: |
| if (resolve) return getEvent(); |
| return basicGetEvent(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case StatemachineDSLPackage.STATEMACHINE_CONTROL_DTO_ATTRIBUTE__ATTRIBUTE_TYPE: |
| setAttributeType((StatemachineDTOType)newValue); |
| return; |
| case StatemachineDSLPackage.STATEMACHINE_CONTROL_DTO_ATTRIBUTE__HAS_EVENT: |
| setHasEvent((Boolean)newValue); |
| return; |
| case StatemachineDSLPackage.STATEMACHINE_CONTROL_DTO_ATTRIBUTE__EVENT: |
| setEvent((StatemachineEvent)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case StatemachineDSLPackage.STATEMACHINE_CONTROL_DTO_ATTRIBUTE__ATTRIBUTE_TYPE: |
| setAttributeType((StatemachineDTOType)null); |
| return; |
| case StatemachineDSLPackage.STATEMACHINE_CONTROL_DTO_ATTRIBUTE__HAS_EVENT: |
| setHasEvent(HAS_EVENT_EDEFAULT); |
| return; |
| case StatemachineDSLPackage.STATEMACHINE_CONTROL_DTO_ATTRIBUTE__EVENT: |
| setEvent((StatemachineEvent)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case StatemachineDSLPackage.STATEMACHINE_CONTROL_DTO_ATTRIBUTE__ATTRIBUTE_TYPE: |
| return attributeType != null; |
| case StatemachineDSLPackage.STATEMACHINE_CONTROL_DTO_ATTRIBUTE__HAS_EVENT: |
| return hasEvent != HAS_EVENT_EDEFAULT; |
| case StatemachineDSLPackage.STATEMACHINE_CONTROL_DTO_ATTRIBUTE__EVENT: |
| return event != null; |
| } |
| 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(" (hasEvent: "); |
| result.append(hasEvent); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //StatemachineControlDTOAttributeImpl |