blob: 11d0497be2053d9b1e21e008be67eb3fbe9f4aa9 [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.core.protocol.impl;
import org.eclipse.rcptt.tesla.core.protocol.ClickText;
import org.eclipse.rcptt.tesla.core.protocol.ProtocolPackage;
import org.eclipse.rcptt.tesla.core.protocol.raw.Element;
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.emf.ecore.impl.EObjectImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Click Text</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.rcptt.tesla.core.protocol.impl.ClickTextImpl#getId <em>Id</em>}</li>
* <li>{@link org.eclipse.rcptt.tesla.core.protocol.impl.ClickTextImpl#getElement <em>Element</em>}</li>
* <li>{@link org.eclipse.rcptt.tesla.core.protocol.impl.ClickTextImpl#getStart <em>Start</em>}</li>
* <li>{@link org.eclipse.rcptt.tesla.core.protocol.impl.ClickTextImpl#getEnd <em>End</em>}</li>
* <li>{@link org.eclipse.rcptt.tesla.core.protocol.impl.ClickTextImpl#getButton <em>Button</em>}</li>
* </ul>
*
* @generated
*/
public class ClickTextImpl extends EObjectImpl implements ClickText {
/**
* The default value of the '{@link #getId() <em>Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getId()
* @generated
* @ordered
*/
protected static final int ID_EDEFAULT = 0;
/**
* The cached value of the '{@link #getId() <em>Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getId()
* @generated
* @ordered
*/
protected int id = ID_EDEFAULT;
/**
* The cached value of the '{@link #getElement() <em>Element</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getElement()
* @generated
* @ordered
*/
protected Element element;
/**
* The default value of the '{@link #getStart() <em>Start</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getStart()
* @generated
* @ordered
*/
protected static final String START_EDEFAULT = "";
/**
* The cached value of the '{@link #getStart() <em>Start</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getStart()
* @generated
* @ordered
*/
protected String start = START_EDEFAULT;
/**
* The default value of the '{@link #getEnd() <em>End</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getEnd()
* @generated
* @ordered
*/
protected static final String END_EDEFAULT = "";
/**
* The cached value of the '{@link #getEnd() <em>End</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getEnd()
* @generated
* @ordered
*/
protected String end = END_EDEFAULT;
/**
* The default value of the '{@link #getButton() <em>Button</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getButton()
* @generated
* @ordered
*/
protected static final String BUTTON_EDEFAULT = "left";
/**
* The cached value of the '{@link #getButton() <em>Button</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getButton()
* @generated
* @ordered
*/
protected String button = BUTTON_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ClickTextImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ProtocolPackage.Literals.CLICK_TEXT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public int getId() {
return id;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setId(int newId) {
int oldId = id;
id = newId;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ProtocolPackage.CLICK_TEXT__ID, oldId, id));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Element getElement() {
return element;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetElement(Element newElement, NotificationChain msgs) {
Element oldElement = element;
element = newElement;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ProtocolPackage.CLICK_TEXT__ELEMENT, oldElement, newElement);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setElement(Element newElement) {
if (newElement != element) {
NotificationChain msgs = null;
if (element != null)
msgs = ((InternalEObject)element).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ProtocolPackage.CLICK_TEXT__ELEMENT, null, msgs);
if (newElement != null)
msgs = ((InternalEObject)newElement).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ProtocolPackage.CLICK_TEXT__ELEMENT, null, msgs);
msgs = basicSetElement(newElement, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ProtocolPackage.CLICK_TEXT__ELEMENT, newElement, newElement));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getStart() {
return start;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setStart(String newStart) {
String oldStart = start;
start = newStart;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ProtocolPackage.CLICK_TEXT__START, oldStart, start));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getEnd() {
return end;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setEnd(String newEnd) {
String oldEnd = end;
end = newEnd;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ProtocolPackage.CLICK_TEXT__END, oldEnd, end));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getButton() {
return button;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setButton(String newButton) {
String oldButton = button;
button = newButton;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ProtocolPackage.CLICK_TEXT__BUTTON, oldButton, button));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case ProtocolPackage.CLICK_TEXT__ELEMENT:
return basicSetElement(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 ProtocolPackage.CLICK_TEXT__ID:
return getId();
case ProtocolPackage.CLICK_TEXT__ELEMENT:
return getElement();
case ProtocolPackage.CLICK_TEXT__START:
return getStart();
case ProtocolPackage.CLICK_TEXT__END:
return getEnd();
case ProtocolPackage.CLICK_TEXT__BUTTON:
return getButton();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ProtocolPackage.CLICK_TEXT__ID:
setId((Integer)newValue);
return;
case ProtocolPackage.CLICK_TEXT__ELEMENT:
setElement((Element)newValue);
return;
case ProtocolPackage.CLICK_TEXT__START:
setStart((String)newValue);
return;
case ProtocolPackage.CLICK_TEXT__END:
setEnd((String)newValue);
return;
case ProtocolPackage.CLICK_TEXT__BUTTON:
setButton((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ProtocolPackage.CLICK_TEXT__ID:
setId(ID_EDEFAULT);
return;
case ProtocolPackage.CLICK_TEXT__ELEMENT:
setElement((Element)null);
return;
case ProtocolPackage.CLICK_TEXT__START:
setStart(START_EDEFAULT);
return;
case ProtocolPackage.CLICK_TEXT__END:
setEnd(END_EDEFAULT);
return;
case ProtocolPackage.CLICK_TEXT__BUTTON:
setButton(BUTTON_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ProtocolPackage.CLICK_TEXT__ID:
return id != ID_EDEFAULT;
case ProtocolPackage.CLICK_TEXT__ELEMENT:
return element != null;
case ProtocolPackage.CLICK_TEXT__START:
return START_EDEFAULT == null ? start != null : !START_EDEFAULT.equals(start);
case ProtocolPackage.CLICK_TEXT__END:
return END_EDEFAULT == null ? end != null : !END_EDEFAULT.equals(end);
case ProtocolPackage.CLICK_TEXT__BUTTON:
return BUTTON_EDEFAULT == null ? button != null : !BUTTON_EDEFAULT.equals(button);
}
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(" (id: ");
result.append(id);
result.append(", start: ");
result.append(start);
result.append(", end: ");
result.append(end);
result.append(", button: ");
result.append(button);
result.append(')');
return result.toString();
}
} //ClickTextImpl