blob: fc2362ff34f27f481f72810b409bb6a4a1338a82 [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 v2.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.diagram.impl;
import org.eclipse.rcptt.tesla.ecl.model.ControlHandler;
import org.eclipse.rcptt.tesla.ecl.model.diagram.DiagramPackage;
import org.eclipse.rcptt.tesla.ecl.model.diagram.GetConnectionHandle;
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>Get Connection Handle</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.rcptt.tesla.ecl.model.diagram.impl.GetConnectionHandleImpl#getId <em>Id</em>}</li>
* <li>{@link org.eclipse.rcptt.tesla.ecl.model.diagram.impl.GetConnectionHandleImpl#getAfter <em>After</em>}</li>
* <li>{@link org.eclipse.rcptt.tesla.ecl.model.diagram.impl.GetConnectionHandleImpl#getType <em>Type</em>}</li>
* <li>{@link org.eclipse.rcptt.tesla.ecl.model.diagram.impl.GetConnectionHandleImpl#getIndex <em>Index</em>}</li>
* <li>{@link org.eclipse.rcptt.tesla.ecl.model.diagram.impl.GetConnectionHandleImpl#getParent <em>Parent</em>}</li>
* <li>{@link org.eclipse.rcptt.tesla.ecl.model.diagram.impl.GetConnectionHandleImpl#getPath <em>Path</em>}</li>
* </ul>
*
* @generated
*/
public class GetConnectionHandleImpl extends CommandImpl implements GetConnectionHandle {
/**
* The default value of the '{@link #getId() <em>Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getId()
* @generated
* @ordered
*/
protected static final String ID_EDEFAULT = null;
/**
* The cached value of the '{@link #getId() <em>Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getId()
* @generated
* @ordered
*/
protected String id = ID_EDEFAULT;
/**
* The cached value of the '{@link #getAfter() <em>After</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAfter()
* @generated
* @ordered
*/
protected ControlHandler after;
/**
* The default value of the '{@link #getType() <em>Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getType()
* @generated
* @ordered
*/
protected static final String TYPE_EDEFAULT = null;
/**
* The cached value of the '{@link #getType() <em>Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getType()
* @generated
* @ordered
*/
protected String type = TYPE_EDEFAULT;
/**
* The default value of the '{@link #getIndex() <em>Index</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getIndex()
* @generated
* @ordered
*/
protected static final Integer INDEX_EDEFAULT = null;
/**
* The cached value of the '{@link #getIndex() <em>Index</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getIndex()
* @generated
* @ordered
*/
protected Integer index = INDEX_EDEFAULT;
/**
* The cached value of the '{@link #getParent() <em>Parent</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getParent()
* @generated
* @ordered
*/
protected ControlHandler parent;
/**
* The default value of the '{@link #getPath() <em>Path</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPath()
* @generated
* @ordered
*/
protected static final String PATH_EDEFAULT = null;
/**
* The cached value of the '{@link #getPath() <em>Path</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPath()
* @generated
* @ordered
*/
protected String path = PATH_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected GetConnectionHandleImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return DiagramPackage.Literals.GET_CONNECTION_HANDLE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getId() {
return id;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setId(String newId) {
String oldId = id;
id = newId;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.GET_CONNECTION_HANDLE__ID, oldId, id));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ControlHandler getAfter() {
if (after != null && after.eIsProxy()) {
InternalEObject oldAfter = (InternalEObject)after;
after = (ControlHandler)eResolveProxy(oldAfter);
if (after != oldAfter) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, DiagramPackage.GET_CONNECTION_HANDLE__AFTER, oldAfter, after));
}
}
return after;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ControlHandler basicGetAfter() {
return after;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setAfter(ControlHandler newAfter) {
ControlHandler oldAfter = after;
after = newAfter;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.GET_CONNECTION_HANDLE__AFTER, oldAfter, after));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Integer getIndex() {
return index;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setIndex(Integer newIndex) {
Integer oldIndex = index;
index = newIndex;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.GET_CONNECTION_HANDLE__INDEX, oldIndex, index));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ControlHandler getParent() {
if (parent != null && parent.eIsProxy()) {
InternalEObject oldParent = (InternalEObject)parent;
parent = (ControlHandler)eResolveProxy(oldParent);
if (parent != oldParent) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, DiagramPackage.GET_CONNECTION_HANDLE__PARENT, oldParent, parent));
}
}
return parent;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ControlHandler basicGetParent() {
return parent;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setParent(ControlHandler newParent) {
ControlHandler oldParent = parent;
parent = newParent;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.GET_CONNECTION_HANDLE__PARENT, oldParent, parent));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getType() {
return type;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setType(String newType) {
String oldType = type;
type = newType;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.GET_CONNECTION_HANDLE__TYPE, oldType, type));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getPath() {
return path;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setPath(String newPath) {
String oldPath = path;
path = newPath;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DiagramPackage.GET_CONNECTION_HANDLE__PATH, oldPath, path));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case DiagramPackage.GET_CONNECTION_HANDLE__ID:
return getId();
case DiagramPackage.GET_CONNECTION_HANDLE__AFTER:
if (resolve) return getAfter();
return basicGetAfter();
case DiagramPackage.GET_CONNECTION_HANDLE__TYPE:
return getType();
case DiagramPackage.GET_CONNECTION_HANDLE__INDEX:
return getIndex();
case DiagramPackage.GET_CONNECTION_HANDLE__PARENT:
if (resolve) return getParent();
return basicGetParent();
case DiagramPackage.GET_CONNECTION_HANDLE__PATH:
return getPath();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case DiagramPackage.GET_CONNECTION_HANDLE__ID:
setId((String)newValue);
return;
case DiagramPackage.GET_CONNECTION_HANDLE__AFTER:
setAfter((ControlHandler)newValue);
return;
case DiagramPackage.GET_CONNECTION_HANDLE__TYPE:
setType((String)newValue);
return;
case DiagramPackage.GET_CONNECTION_HANDLE__INDEX:
setIndex((Integer)newValue);
return;
case DiagramPackage.GET_CONNECTION_HANDLE__PARENT:
setParent((ControlHandler)newValue);
return;
case DiagramPackage.GET_CONNECTION_HANDLE__PATH:
setPath((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case DiagramPackage.GET_CONNECTION_HANDLE__ID:
setId(ID_EDEFAULT);
return;
case DiagramPackage.GET_CONNECTION_HANDLE__AFTER:
setAfter((ControlHandler)null);
return;
case DiagramPackage.GET_CONNECTION_HANDLE__TYPE:
setType(TYPE_EDEFAULT);
return;
case DiagramPackage.GET_CONNECTION_HANDLE__INDEX:
setIndex(INDEX_EDEFAULT);
return;
case DiagramPackage.GET_CONNECTION_HANDLE__PARENT:
setParent((ControlHandler)null);
return;
case DiagramPackage.GET_CONNECTION_HANDLE__PATH:
setPath(PATH_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case DiagramPackage.GET_CONNECTION_HANDLE__ID:
return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
case DiagramPackage.GET_CONNECTION_HANDLE__AFTER:
return after != null;
case DiagramPackage.GET_CONNECTION_HANDLE__TYPE:
return TYPE_EDEFAULT == null ? type != null : !TYPE_EDEFAULT.equals(type);
case DiagramPackage.GET_CONNECTION_HANDLE__INDEX:
return INDEX_EDEFAULT == null ? index != null : !INDEX_EDEFAULT.equals(index);
case DiagramPackage.GET_CONNECTION_HANDLE__PARENT:
return parent != null;
case DiagramPackage.GET_CONNECTION_HANDLE__PATH:
return PATH_EDEFAULT == null ? path != null : !PATH_EDEFAULT.equals(path);
}
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(", type: ");
result.append(type);
result.append(", index: ");
result.append(index);
result.append(", path: ");
result.append(path);
result.append(')');
return result.toString();
}
} //GetConnectionHandleImpl