| /** |
| * Copyright (c) 2011, 2018 - 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 2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Contributors: |
| * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation |
| * |
| * generated from SignalDSL.xcore |
| * |
| * |
| */ |
| package org.eclipse.osbp.xtext.signal.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.signal.SignalDSLPackage; |
| import org.eclipse.osbp.xtext.signal.SignalWatcher; |
| import org.eclipse.osbp.xtext.signal.WatcherDefinition; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Signal Watcher</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.xtext.signal.impl.SignalWatcherImpl#getDefinition <em>Definition</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class SignalWatcherImpl extends SignalDefinitionImpl implements SignalWatcher { |
| /** |
| * The cached value of the '{@link #getDefinition() <em>Definition</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDefinition() |
| * @generated |
| * @ordered |
| */ |
| protected WatcherDefinition definition; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected SignalWatcherImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return SignalDSLPackage.Literals.SIGNAL_WATCHER; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public WatcherDefinition getDefinition() { |
| return definition; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetDefinition(WatcherDefinition newDefinition, NotificationChain msgs) { |
| WatcherDefinition oldDefinition = definition; |
| definition = newDefinition; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SignalDSLPackage.SIGNAL_WATCHER__DEFINITION, oldDefinition, newDefinition); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setDefinition(WatcherDefinition newDefinition) { |
| if (newDefinition != definition) { |
| NotificationChain msgs = null; |
| if (definition != null) |
| msgs = ((InternalEObject)definition).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SignalDSLPackage.SIGNAL_WATCHER__DEFINITION, null, msgs); |
| if (newDefinition != null) |
| msgs = ((InternalEObject)newDefinition).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SignalDSLPackage.SIGNAL_WATCHER__DEFINITION, null, msgs); |
| msgs = basicSetDefinition(newDefinition, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, SignalDSLPackage.SIGNAL_WATCHER__DEFINITION, newDefinition, newDefinition)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case SignalDSLPackage.SIGNAL_WATCHER__DEFINITION: |
| return basicSetDefinition(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 SignalDSLPackage.SIGNAL_WATCHER__DEFINITION: |
| return getDefinition(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case SignalDSLPackage.SIGNAL_WATCHER__DEFINITION: |
| setDefinition((WatcherDefinition)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case SignalDSLPackage.SIGNAL_WATCHER__DEFINITION: |
| setDefinition((WatcherDefinition)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case SignalDSLPackage.SIGNAL_WATCHER__DEFINITION: |
| return definition != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //SignalWatcherImpl |