blob: 4fcb550b1fe01d27f68fdc3e9b269ab8df8aad50 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2009, 2019 Xored Software Inc and others.
* 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
* https://www.eclipse.org/legal/epl-v20.html
*
* Contributors:
* Xored Software Inc - initial API and implementation and/or initial documentation
*******************************************************************************/
package org.eclipse.rcptt.tesla.ecl.model.impl;
import org.eclipse.rcptt.tesla.ecl.model.ControlHandler;
import org.eclipse.rcptt.tesla.ecl.model.TeslaPackage;
import org.eclipse.rcptt.tesla.ecl.model.TypeText;
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.rcptt.ecl.core.impl.CommandImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Type Text</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.rcptt.tesla.ecl.model.impl.TypeTextImpl#getControl <em>Control</em>}</li>
* <li>{@link org.eclipse.rcptt.tesla.ecl.model.impl.TypeTextImpl#getText <em>Text</em>}</li>
* <li>{@link org.eclipse.rcptt.tesla.ecl.model.impl.TypeTextImpl#isDisplay <em>Display</em>}</li>
* </ul>
*
* @generated
*/
public class TypeTextImpl extends CommandImpl implements TypeText {
/**
* The cached value of the '{@link #getControl() <em>Control</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getControl()
* @generated
* @ordered
*/
protected ControlHandler control;
/**
* The default value of the '{@link #getText() <em>Text</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getText()
* @generated
* @ordered
*/
protected static final String TEXT_EDEFAULT = null;
/**
* The cached value of the '{@link #getText() <em>Text</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getText()
* @generated
* @ordered
*/
protected String text = TEXT_EDEFAULT;
/**
* The default value of the '{@link #isDisplay() <em>Display</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isDisplay()
* @generated
* @ordered
*/
protected static final boolean DISPLAY_EDEFAULT = false;
/**
* The cached value of the '{@link #isDisplay() <em>Display</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isDisplay()
* @generated
* @ordered
*/
protected boolean display = DISPLAY_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected TypeTextImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return TeslaPackage.Literals.TYPE_TEXT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ControlHandler getControl() {
if (control != null && control.eIsProxy()) {
InternalEObject oldControl = (InternalEObject)control;
control = (ControlHandler)eResolveProxy(oldControl);
if (control != oldControl) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, TeslaPackage.TYPE_TEXT__CONTROL, oldControl, control));
}
}
return control;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ControlHandler basicGetControl() {
return control;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setControl(ControlHandler newControl) {
ControlHandler oldControl = control;
control = newControl;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TeslaPackage.TYPE_TEXT__CONTROL, oldControl, control));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getText() {
return text;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setText(String newText) {
String oldText = text;
text = newText;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TeslaPackage.TYPE_TEXT__TEXT, oldText, text));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isDisplay() {
return display;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDisplay(boolean newDisplay) {
boolean oldDisplay = display;
display = newDisplay;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TeslaPackage.TYPE_TEXT__DISPLAY, oldDisplay, display));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case TeslaPackage.TYPE_TEXT__CONTROL:
if (resolve) return getControl();
return basicGetControl();
case TeslaPackage.TYPE_TEXT__TEXT:
return getText();
case TeslaPackage.TYPE_TEXT__DISPLAY:
return isDisplay();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case TeslaPackage.TYPE_TEXT__CONTROL:
setControl((ControlHandler)newValue);
return;
case TeslaPackage.TYPE_TEXT__TEXT:
setText((String)newValue);
return;
case TeslaPackage.TYPE_TEXT__DISPLAY:
setDisplay((Boolean)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case TeslaPackage.TYPE_TEXT__CONTROL:
setControl((ControlHandler)null);
return;
case TeslaPackage.TYPE_TEXT__TEXT:
setText(TEXT_EDEFAULT);
return;
case TeslaPackage.TYPE_TEXT__DISPLAY:
setDisplay(DISPLAY_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case TeslaPackage.TYPE_TEXT__CONTROL:
return control != null;
case TeslaPackage.TYPE_TEXT__TEXT:
return TEXT_EDEFAULT == null ? text != null : !TEXT_EDEFAULT.equals(text);
case TeslaPackage.TYPE_TEXT__DISPLAY:
return display != DISPLAY_EDEFAULT;
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuilder result = new StringBuilder(super.toString());
result.append(" (text: ");
result.append(text);
result.append(", display: ");
result.append(display);
result.append(')');
return result.toString();
}
} //TypeTextImpl