blob: 29769668cd7a2df915bed32b640d42d320143329 [file] [log] [blame]
/**
* 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 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Based on ideas from Xtext, Xtend, Xcore
*
* Contributors:
* Joerg Riegel - 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.FSMActionFieldConcatenation;
import org.eclipse.osbp.xtext.statemachine.FSMActionPeripheralLineDisplayTextAt;
import org.eclipse.osbp.xtext.statemachine.FSMLineDisplayTextType;
import org.eclipse.osbp.xtext.statemachine.FSMPeripheralDeviceLineDisplay;
import org.eclipse.osbp.xtext.statemachine.StatemachineDSLPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>FSM Action Peripheral Line Display Text At</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.osbp.xtext.statemachine.impl.FSMActionPeripheralLineDisplayTextAtImpl#getDevice <em>Device</em>}</li>
* <li>{@link org.eclipse.osbp.xtext.statemachine.impl.FSMActionPeripheralLineDisplayTextAtImpl#getRow <em>Row</em>}</li>
* <li>{@link org.eclipse.osbp.xtext.statemachine.impl.FSMActionPeripheralLineDisplayTextAtImpl#getColumn <em>Column</em>}</li>
* <li>{@link org.eclipse.osbp.xtext.statemachine.impl.FSMActionPeripheralLineDisplayTextAtImpl#getText <em>Text</em>}</li>
* <li>{@link org.eclipse.osbp.xtext.statemachine.impl.FSMActionPeripheralLineDisplayTextAtImpl#isHasType <em>Has Type</em>}</li>
* <li>{@link org.eclipse.osbp.xtext.statemachine.impl.FSMActionPeripheralLineDisplayTextAtImpl#getTextType <em>Text Type</em>}</li>
* </ul>
*
* @generated
*/
public class FSMActionPeripheralLineDisplayTextAtImpl extends FSMLazyResolverImpl implements FSMActionPeripheralLineDisplayTextAt {
/**
* The cached value of the '{@link #getDevice() <em>Device</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDevice()
* @generated
* @ordered
*/
protected FSMPeripheralDeviceLineDisplay device;
/**
* The default value of the '{@link #getRow() <em>Row</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getRow()
* @generated
* @ordered
*/
protected static final int ROW_EDEFAULT = 0;
/**
* The cached value of the '{@link #getRow() <em>Row</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getRow()
* @generated
* @ordered
*/
protected int row = ROW_EDEFAULT;
/**
* The default value of the '{@link #getColumn() <em>Column</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getColumn()
* @generated
* @ordered
*/
protected static final int COLUMN_EDEFAULT = 0;
/**
* The cached value of the '{@link #getColumn() <em>Column</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getColumn()
* @generated
* @ordered
*/
protected int column = COLUMN_EDEFAULT;
/**
* The cached value of the '{@link #getText() <em>Text</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getText()
* @generated
* @ordered
*/
protected FSMActionFieldConcatenation text;
/**
* The default value of the '{@link #isHasType() <em>Has Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isHasType()
* @generated
* @ordered
*/
protected static final boolean HAS_TYPE_EDEFAULT = false;
/**
* The cached value of the '{@link #isHasType() <em>Has Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isHasType()
* @generated
* @ordered
*/
protected boolean hasType = HAS_TYPE_EDEFAULT;
/**
* The default value of the '{@link #getTextType() <em>Text Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTextType()
* @generated
* @ordered
*/
protected static final FSMLineDisplayTextType TEXT_TYPE_EDEFAULT = FSMLineDisplayTextType.DISP_DT_NORMAL;
/**
* The cached value of the '{@link #getTextType() <em>Text Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTextType()
* @generated
* @ordered
*/
protected FSMLineDisplayTextType textType = TEXT_TYPE_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected FSMActionPeripheralLineDisplayTextAtImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return StatemachineDSLPackage.Literals.FSM_ACTION_PERIPHERAL_LINE_DISPLAY_TEXT_AT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public FSMPeripheralDeviceLineDisplay getDevice() {
if (device != null && device.eIsProxy()) {
InternalEObject oldDevice = (InternalEObject)device;
device = (FSMPeripheralDeviceLineDisplay)eResolveProxy(oldDevice);
if (device != oldDevice) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_LINE_DISPLAY_TEXT_AT__DEVICE, oldDevice, device));
}
}
return device;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public FSMPeripheralDeviceLineDisplay basicGetDevice() {
return device;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDevice(FSMPeripheralDeviceLineDisplay newDevice) {
FSMPeripheralDeviceLineDisplay oldDevice = device;
device = newDevice;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_LINE_DISPLAY_TEXT_AT__DEVICE, oldDevice, device));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public int getRow() {
return row;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setRow(int newRow) {
int oldRow = row;
row = newRow;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_LINE_DISPLAY_TEXT_AT__ROW, oldRow, row));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public int getColumn() {
return column;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setColumn(int newColumn) {
int oldColumn = column;
column = newColumn;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_LINE_DISPLAY_TEXT_AT__COLUMN, oldColumn, column));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public FSMActionFieldConcatenation getText() {
return text;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetText(FSMActionFieldConcatenation newText, NotificationChain msgs) {
FSMActionFieldConcatenation oldText = text;
text = newText;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_LINE_DISPLAY_TEXT_AT__TEXT, oldText, newText);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setText(FSMActionFieldConcatenation newText) {
if (newText != text) {
NotificationChain msgs = null;
if (text != null)
msgs = ((InternalEObject)text).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_LINE_DISPLAY_TEXT_AT__TEXT, null, msgs);
if (newText != null)
msgs = ((InternalEObject)newText).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_LINE_DISPLAY_TEXT_AT__TEXT, null, msgs);
msgs = basicSetText(newText, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_LINE_DISPLAY_TEXT_AT__TEXT, newText, newText));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isHasType() {
return hasType;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setHasType(boolean newHasType) {
boolean oldHasType = hasType;
hasType = newHasType;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_LINE_DISPLAY_TEXT_AT__HAS_TYPE, oldHasType, hasType));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public FSMLineDisplayTextType getTextType() {
return textType;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setTextType(FSMLineDisplayTextType newTextType) {
FSMLineDisplayTextType oldTextType = textType;
textType = newTextType == null ? TEXT_TYPE_EDEFAULT : newTextType;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_LINE_DISPLAY_TEXT_AT__TEXT_TYPE, oldTextType, textType));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_LINE_DISPLAY_TEXT_AT__TEXT:
return basicSetText(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.FSM_ACTION_PERIPHERAL_LINE_DISPLAY_TEXT_AT__DEVICE:
if (resolve) return getDevice();
return basicGetDevice();
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_LINE_DISPLAY_TEXT_AT__ROW:
return getRow();
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_LINE_DISPLAY_TEXT_AT__COLUMN:
return getColumn();
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_LINE_DISPLAY_TEXT_AT__TEXT:
return getText();
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_LINE_DISPLAY_TEXT_AT__HAS_TYPE:
return isHasType();
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_LINE_DISPLAY_TEXT_AT__TEXT_TYPE:
return getTextType();
}
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.FSM_ACTION_PERIPHERAL_LINE_DISPLAY_TEXT_AT__DEVICE:
setDevice((FSMPeripheralDeviceLineDisplay)newValue);
return;
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_LINE_DISPLAY_TEXT_AT__ROW:
setRow((Integer)newValue);
return;
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_LINE_DISPLAY_TEXT_AT__COLUMN:
setColumn((Integer)newValue);
return;
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_LINE_DISPLAY_TEXT_AT__TEXT:
setText((FSMActionFieldConcatenation)newValue);
return;
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_LINE_DISPLAY_TEXT_AT__HAS_TYPE:
setHasType((Boolean)newValue);
return;
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_LINE_DISPLAY_TEXT_AT__TEXT_TYPE:
setTextType((FSMLineDisplayTextType)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_LINE_DISPLAY_TEXT_AT__DEVICE:
setDevice((FSMPeripheralDeviceLineDisplay)null);
return;
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_LINE_DISPLAY_TEXT_AT__ROW:
setRow(ROW_EDEFAULT);
return;
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_LINE_DISPLAY_TEXT_AT__COLUMN:
setColumn(COLUMN_EDEFAULT);
return;
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_LINE_DISPLAY_TEXT_AT__TEXT:
setText((FSMActionFieldConcatenation)null);
return;
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_LINE_DISPLAY_TEXT_AT__HAS_TYPE:
setHasType(HAS_TYPE_EDEFAULT);
return;
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_LINE_DISPLAY_TEXT_AT__TEXT_TYPE:
setTextType(TEXT_TYPE_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_LINE_DISPLAY_TEXT_AT__DEVICE:
return device != null;
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_LINE_DISPLAY_TEXT_AT__ROW:
return row != ROW_EDEFAULT;
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_LINE_DISPLAY_TEXT_AT__COLUMN:
return column != COLUMN_EDEFAULT;
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_LINE_DISPLAY_TEXT_AT__TEXT:
return text != null;
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_LINE_DISPLAY_TEXT_AT__HAS_TYPE:
return hasType != HAS_TYPE_EDEFAULT;
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_LINE_DISPLAY_TEXT_AT__TEXT_TYPE:
return textType != TEXT_TYPE_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(" (row: ");
result.append(row);
result.append(", column: ");
result.append(column);
result.append(", hasType: ");
result.append(hasType);
result.append(", textType: ");
result.append(textType);
result.append(')');
return result.toString();
}
} //FSMActionPeripheralLineDisplayTextAtImpl