| /** |
| * Copyright (c) 2011, 2015 - Lunifera GmbH (Gross Enzersdorf, Austria), 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 v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * Florian Pirchner - Initial implementation |
| */ |
| package org.eclipse.osbp.ecview.semantic.uimodel.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.emf.ecore.impl.MinimalEObjectImpl; |
| import org.eclipse.osbp.ecview.semantic.uimodel.UiBindingEndpointAlias; |
| import org.eclipse.osbp.ecview.semantic.uimodel.UiBindingExpression; |
| import org.eclipse.osbp.ecview.semantic.uimodel.UiModelPackage; |
| |
| // TODO: Auto-generated Javadoc |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Ui Binding Endpoint Alias</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.ecview.semantic.uimodel.impl.UiBindingEndpointAliasImpl#getId <em>Id</em>}</li> |
| * <li>{@link org.eclipse.osbp.ecview.semantic.uimodel.impl.UiBindingEndpointAliasImpl#getName <em>Name</em>}</li> |
| * <li>{@link org.eclipse.osbp.ecview.semantic.uimodel.impl.UiBindingEndpointAliasImpl#getAlias <em>Alias</em>}</li> |
| * <li>{@link org.eclipse.osbp.ecview.semantic.uimodel.impl.UiBindingEndpointAliasImpl#getEndpoint <em>Endpoint</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class UiBindingEndpointAliasImpl extends MinimalEObjectImpl.Container implements UiBindingEndpointAlias { |
| /** |
| * 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 default value of the '{@link #getName() <em>Name</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getName() |
| * @generated |
| * @ordered |
| */ |
| protected static final String NAME_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getName() <em>Name</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getName() |
| * @generated |
| * @ordered |
| */ |
| protected String name = NAME_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getAlias() <em>Alias</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getAlias() |
| * @generated |
| * @ordered |
| */ |
| protected static final String ALIAS_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getAlias() <em>Alias</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getAlias() |
| * @generated |
| * @ordered |
| */ |
| protected String alias = ALIAS_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getEndpoint() <em>Endpoint</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getEndpoint() |
| * @generated |
| * @ordered |
| */ |
| protected UiBindingExpression endpoint; |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @generated |
| */ |
| protected UiBindingEndpointAliasImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @return the e class |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return UiModelPackage.Literals.UI_BINDING_ENDPOINT_ALIAS; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @return the cached value of the '{@link #getId() <em>Id</em>}' attribute |
| * @generated |
| */ |
| public String getId() { |
| return id; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param newId |
| * the new cached value of the '{@link #getId() <em>Id</em>}' |
| * attribute |
| * @generated |
| */ |
| public void setId(String newId) { |
| String oldId = id; |
| id = newId; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, UiModelPackage.UI_BINDING_ENDPOINT_ALIAS__ID, oldId, id)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @return the cached value of the '{@link #getName() <em>Name</em>}' |
| * attribute |
| * @generated |
| */ |
| public String getName() { |
| return name; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param newName |
| * the new cached value of the '{@link #getName() <em>Name</em>}' |
| * attribute |
| * @generated |
| */ |
| public void setName(String newName) { |
| String oldName = name; |
| name = newName; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, UiModelPackage.UI_BINDING_ENDPOINT_ALIAS__NAME, oldName, name)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @return the cached value of the '{@link #getAlias() <em>Alias</em>}' |
| * attribute |
| * @generated |
| */ |
| public String getAlias() { |
| return alias; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param newAlias |
| * the new cached value of the '{@link #getAlias() |
| * <em>Alias</em>}' attribute |
| * @generated |
| */ |
| public void setAlias(String newAlias) { |
| String oldAlias = alias; |
| alias = newAlias; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, UiModelPackage.UI_BINDING_ENDPOINT_ALIAS__ALIAS, oldAlias, alias)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @return the cached value of the '{@link #getEndpoint() <em>Endpoint</em>} |
| * ' containment reference |
| * @generated |
| */ |
| public UiBindingExpression getEndpoint() { |
| if (endpoint != null && endpoint.eIsProxy()) { |
| InternalEObject oldEndpoint = (InternalEObject)endpoint; |
| endpoint = (UiBindingExpression)eResolveProxy(oldEndpoint); |
| if (endpoint != oldEndpoint) { |
| InternalEObject newEndpoint = (InternalEObject)endpoint; |
| NotificationChain msgs = oldEndpoint.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - UiModelPackage.UI_BINDING_ENDPOINT_ALIAS__ENDPOINT, null, null); |
| if (newEndpoint.eInternalContainer() == null) { |
| msgs = newEndpoint.eInverseAdd(this, EOPPOSITE_FEATURE_BASE - UiModelPackage.UI_BINDING_ENDPOINT_ALIAS__ENDPOINT, null, msgs); |
| } |
| if (msgs != null) msgs.dispatch(); |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, UiModelPackage.UI_BINDING_ENDPOINT_ALIAS__ENDPOINT, oldEndpoint, endpoint)); |
| } |
| } |
| return endpoint; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @return the ui binding expression |
| * @generated |
| */ |
| public UiBindingExpression basicGetEndpoint() { |
| return endpoint; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param newEndpoint |
| * the new endpoint |
| * @param msgs |
| * the msgs |
| * @return the notification chain |
| * @generated |
| */ |
| public NotificationChain basicSetEndpoint(UiBindingExpression newEndpoint, NotificationChain msgs) { |
| UiBindingExpression oldEndpoint = endpoint; |
| endpoint = newEndpoint; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, UiModelPackage.UI_BINDING_ENDPOINT_ALIAS__ENDPOINT, oldEndpoint, newEndpoint); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param newEndpoint |
| * the new cached value of the '{@link #getEndpoint() |
| * <em>Endpoint</em>}' containment reference |
| * @generated |
| */ |
| public void setEndpoint(UiBindingExpression newEndpoint) { |
| if (newEndpoint != endpoint) { |
| NotificationChain msgs = null; |
| if (endpoint != null) |
| msgs = ((InternalEObject)endpoint).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - UiModelPackage.UI_BINDING_ENDPOINT_ALIAS__ENDPOINT, null, msgs); |
| if (newEndpoint != null) |
| msgs = ((InternalEObject)newEndpoint).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - UiModelPackage.UI_BINDING_ENDPOINT_ALIAS__ENDPOINT, null, msgs); |
| msgs = basicSetEndpoint(newEndpoint, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, UiModelPackage.UI_BINDING_ENDPOINT_ALIAS__ENDPOINT, newEndpoint, newEndpoint)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param otherEnd |
| * the other end |
| * @param featureID |
| * the feature id |
| * @param msgs |
| * the msgs |
| * @return the notification chain |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case UiModelPackage.UI_BINDING_ENDPOINT_ALIAS__ENDPOINT: |
| return basicSetEndpoint(null, msgs); |
| } |
| return super.eInverseRemove(otherEnd, featureID, msgs); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param featureID |
| * the feature id |
| * @param resolve |
| * the resolve |
| * @param coreType |
| * the core type |
| * @return the object |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case UiModelPackage.UI_BINDING_ENDPOINT_ALIAS__ID: |
| return getId(); |
| case UiModelPackage.UI_BINDING_ENDPOINT_ALIAS__NAME: |
| return getName(); |
| case UiModelPackage.UI_BINDING_ENDPOINT_ALIAS__ALIAS: |
| return getAlias(); |
| case UiModelPackage.UI_BINDING_ENDPOINT_ALIAS__ENDPOINT: |
| if (resolve) return getEndpoint(); |
| return basicGetEndpoint(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param featureID |
| * the feature id |
| * @param newValue |
| * the new value |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case UiModelPackage.UI_BINDING_ENDPOINT_ALIAS__ID: |
| setId((String)newValue); |
| return; |
| case UiModelPackage.UI_BINDING_ENDPOINT_ALIAS__NAME: |
| setName((String)newValue); |
| return; |
| case UiModelPackage.UI_BINDING_ENDPOINT_ALIAS__ALIAS: |
| setAlias((String)newValue); |
| return; |
| case UiModelPackage.UI_BINDING_ENDPOINT_ALIAS__ENDPOINT: |
| setEndpoint((UiBindingExpression)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param featureID |
| * the feature id |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case UiModelPackage.UI_BINDING_ENDPOINT_ALIAS__ID: |
| setId(ID_EDEFAULT); |
| return; |
| case UiModelPackage.UI_BINDING_ENDPOINT_ALIAS__NAME: |
| setName(NAME_EDEFAULT); |
| return; |
| case UiModelPackage.UI_BINDING_ENDPOINT_ALIAS__ALIAS: |
| setAlias(ALIAS_EDEFAULT); |
| return; |
| case UiModelPackage.UI_BINDING_ENDPOINT_ALIAS__ENDPOINT: |
| setEndpoint((UiBindingExpression)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param featureID |
| * the feature id |
| * @return true, if successful |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case UiModelPackage.UI_BINDING_ENDPOINT_ALIAS__ID: |
| return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id); |
| case UiModelPackage.UI_BINDING_ENDPOINT_ALIAS__NAME: |
| return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); |
| case UiModelPackage.UI_BINDING_ENDPOINT_ALIAS__ALIAS: |
| return ALIAS_EDEFAULT == null ? alias != null : !ALIAS_EDEFAULT.equals(alias); |
| case UiModelPackage.UI_BINDING_ENDPOINT_ALIAS__ENDPOINT: |
| return endpoint != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @return the string |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuffer result = new StringBuffer(super.toString()); |
| result.append(" (id: "); |
| result.append(id); |
| result.append(", name: "); |
| result.append(name); |
| result.append(", alias: "); |
| result.append(alias); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //UiBindingEndpointAliasImpl |