| /** |
| * |
| * Copyright (c) 2011, 2016 - 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 |
| * |
| * Contributors: |
| * Florian Pirchner - Initial implementation |
| * |
| */ |
| package org.eclipse.osbp.ecview.extension.model.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.ecview.core.common.model.core.CoreModelFactory; |
| import org.eclipse.osbp.ecview.core.common.model.core.CoreModelPackage; |
| import org.eclipse.osbp.ecview.core.common.model.core.YBindable; |
| import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddableValueEndpoint; |
| import org.eclipse.osbp.ecview.core.common.model.core.YValueBindable; |
| import org.eclipse.osbp.ecview.core.extension.model.extension.impl.YInputImpl; |
| import org.eclipse.osbp.ecview.extension.model.YBlobUploadComponent; |
| import org.eclipse.osbp.ecview.extension.model.YECviewPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>YBlob Upload Component</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.ecview.extension.model.impl.YBlobUploadComponentImpl#getValueBindingEndpoint <em>Value Binding Endpoint</em>}</li> |
| * <li>{@link org.eclipse.osbp.ecview.extension.model.impl.YBlobUploadComponentImpl#getValue <em>Value</em>}</li> |
| * <li>{@link org.eclipse.osbp.ecview.extension.model.impl.YBlobUploadComponentImpl#getDisplayResolutionId <em>Display Resolution Id</em>}</li> |
| * <li>{@link org.eclipse.osbp.ecview.extension.model.impl.YBlobUploadComponentImpl#isFirmlyLinked <em>Firmly Linked</em>}</li> |
| * <li>{@link org.eclipse.osbp.ecview.extension.model.impl.YBlobUploadComponentImpl#isUniqueNameEnabled <em>Unique Name Enabled</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class YBlobUploadComponentImpl extends YInputImpl implements YBlobUploadComponent { |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @generated |
| */ |
| public static final String copyright = "All rights reserved by Loetz GmbH und CoKG Heidelberg 2015.\n\nContributors:\n Florian Pirchner - initial API and implementation"; |
| |
| /** |
| * The cached value of the '{@link #getValueBindingEndpoint() <em>Value Binding Endpoint</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getValueBindingEndpoint() |
| * @generated |
| * @ordered |
| */ |
| protected YEmbeddableValueEndpoint valueBindingEndpoint; |
| |
| /** |
| * The default value of the '{@link #getValue() <em>Value</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getValue() |
| * @generated |
| * @ordered |
| */ |
| protected static final String VALUE_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getValue() <em>Value</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getValue() |
| * @generated |
| * @ordered |
| */ |
| protected String value = VALUE_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getDisplayResolutionId() <em>Display Resolution Id</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDisplayResolutionId() |
| * @generated |
| * @ordered |
| */ |
| protected static final int DISPLAY_RESOLUTION_ID_EDEFAULT = 0; |
| |
| /** |
| * The cached value of the '{@link #getDisplayResolutionId() <em>Display Resolution Id</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDisplayResolutionId() |
| * @generated |
| * @ordered |
| */ |
| protected int displayResolutionId = DISPLAY_RESOLUTION_ID_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #isFirmlyLinked() <em>Firmly Linked</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isFirmlyLinked() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean FIRMLY_LINKED_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isFirmlyLinked() <em>Firmly Linked</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isFirmlyLinked() |
| * @generated |
| * @ordered |
| */ |
| protected boolean firmlyLinked = FIRMLY_LINKED_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #isUniqueNameEnabled() <em>Unique Name Enabled</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isUniqueNameEnabled() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean UNIQUE_NAME_ENABLED_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isUniqueNameEnabled() <em>Unique Name Enabled</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isUniqueNameEnabled() |
| * @generated |
| * @ordered |
| */ |
| protected boolean uniqueNameEnabled = UNIQUE_NAME_ENABLED_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @generated |
| */ |
| protected YBlobUploadComponentImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @return the e class |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return YECviewPackage.Literals.YBLOB_UPLOAD_COMPONENT; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @return the cached value of the '{@link #getValueBindingEndpoint() |
| * <em>Value Binding Endpoint</em>}' reference |
| * @generated |
| */ |
| public YEmbeddableValueEndpoint getValueBindingEndpoint() { |
| if (valueBindingEndpoint != null && valueBindingEndpoint.eIsProxy()) { |
| InternalEObject oldValueBindingEndpoint = (InternalEObject)valueBindingEndpoint; |
| valueBindingEndpoint = (YEmbeddableValueEndpoint)eResolveProxy(oldValueBindingEndpoint); |
| if (valueBindingEndpoint != oldValueBindingEndpoint) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, YECviewPackage.YBLOB_UPLOAD_COMPONENT__VALUE_BINDING_ENDPOINT, oldValueBindingEndpoint, valueBindingEndpoint)); |
| } |
| } |
| return valueBindingEndpoint; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @return the y embeddable value endpoint |
| * @generated |
| */ |
| public YEmbeddableValueEndpoint basicGetValueBindingEndpoint() { |
| return valueBindingEndpoint; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param newValueBindingEndpoint |
| * the new value binding endpoint |
| * @param msgs |
| * the msgs |
| * @return the notification chain |
| * @generated |
| */ |
| public NotificationChain basicSetValueBindingEndpoint(YEmbeddableValueEndpoint newValueBindingEndpoint, NotificationChain msgs) { |
| YEmbeddableValueEndpoint oldValueBindingEndpoint = valueBindingEndpoint; |
| valueBindingEndpoint = newValueBindingEndpoint; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, YECviewPackage.YBLOB_UPLOAD_COMPONENT__VALUE_BINDING_ENDPOINT, oldValueBindingEndpoint, newValueBindingEndpoint); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param newValueBindingEndpoint |
| * the new cached value of the ' |
| * {@link #getValueBindingEndpoint() |
| * <em>Value Binding Endpoint</em>}' reference |
| * @generated |
| */ |
| public void setValueBindingEndpoint(YEmbeddableValueEndpoint newValueBindingEndpoint) { |
| if (newValueBindingEndpoint != valueBindingEndpoint) { |
| NotificationChain msgs = null; |
| if (valueBindingEndpoint != null) |
| msgs = ((InternalEObject)valueBindingEndpoint).eInverseRemove(this, CoreModelPackage.YEMBEDDABLE_VALUE_ENDPOINT__ELEMENT, YEmbeddableValueEndpoint.class, msgs); |
| if (newValueBindingEndpoint != null) |
| msgs = ((InternalEObject)newValueBindingEndpoint).eInverseAdd(this, CoreModelPackage.YEMBEDDABLE_VALUE_ENDPOINT__ELEMENT, YEmbeddableValueEndpoint.class, msgs); |
| msgs = basicSetValueBindingEndpoint(newValueBindingEndpoint, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, YECviewPackage.YBLOB_UPLOAD_COMPONENT__VALUE_BINDING_ENDPOINT, newValueBindingEndpoint, newValueBindingEndpoint)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @return the cached value of the '{@link #getValue() <em>Value</em>}' |
| * attribute |
| * @generated |
| */ |
| public String getValue() { |
| return value; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param newValue |
| * the new cached value of the '{@link #getValue() |
| * <em>Value</em>}' attribute |
| * @generated |
| */ |
| public void setValue(String newValue) { |
| String oldValue = value; |
| value = newValue; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, YECviewPackage.YBLOB_UPLOAD_COMPONENT__VALUE, oldValue, value)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @return the cached value of the '{@link #getDisplayResolutionId() |
| * <em>Display Resolution Id</em>}' attribute |
| * @generated |
| */ |
| public int getDisplayResolutionId() { |
| return displayResolutionId; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param newDisplayResolutionId |
| * the new cached value of the '{@link #getDisplayResolutionId() |
| * <em>Display Resolution Id</em>}' attribute |
| * @generated |
| */ |
| public void setDisplayResolutionId(int newDisplayResolutionId) { |
| int oldDisplayResolutionId = displayResolutionId; |
| displayResolutionId = newDisplayResolutionId; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, YECviewPackage.YBLOB_UPLOAD_COMPONENT__DISPLAY_RESOLUTION_ID, oldDisplayResolutionId, displayResolutionId)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean isFirmlyLinked() { |
| return firmlyLinked; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setFirmlyLinked(boolean newFirmlyLinked) { |
| boolean oldFirmlyLinked = firmlyLinked; |
| firmlyLinked = newFirmlyLinked; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, YECviewPackage.YBLOB_UPLOAD_COMPONENT__FIRMLY_LINKED, oldFirmlyLinked, firmlyLinked)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean isUniqueNameEnabled() { |
| return uniqueNameEnabled; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setUniqueNameEnabled(boolean newUniqueNameEnabled) { |
| boolean oldUniqueNameEnabled = uniqueNameEnabled; |
| uniqueNameEnabled = newUniqueNameEnabled; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, YECviewPackage.YBLOB_UPLOAD_COMPONENT__UNIQUE_NAME_ENABLED, oldUniqueNameEnabled, uniqueNameEnabled)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @return the y embeddable value endpoint |
| * @generated |
| */ |
| public YEmbeddableValueEndpoint createValueEndpointGen() { |
| // TODO: implement this method |
| // Ensure that you remove @generated or mark it @generated NOT |
| throw new UnsupportedOperationException(); |
| } |
| |
| /** |
| * Creates a new instance of value endpoint with a reference to that |
| * embeddable. |
| * |
| * @return the y embeddable value endpoint |
| * @generated NOT |
| */ |
| public YEmbeddableValueEndpoint createValueEndpoint() { |
| YEmbeddableValueEndpoint ep = CoreModelFactory.eINSTANCE |
| .createYEmbeddableValueEndpoint(); |
| ep.setElement(this); |
| return ep; |
| } |
| |
| /** |
| * <!-- 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 eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case YECviewPackage.YBLOB_UPLOAD_COMPONENT__VALUE_BINDING_ENDPOINT: |
| if (valueBindingEndpoint != null) |
| msgs = ((InternalEObject)valueBindingEndpoint).eInverseRemove(this, CoreModelPackage.YEMBEDDABLE_VALUE_ENDPOINT__ELEMENT, YEmbeddableValueEndpoint.class, msgs); |
| return basicSetValueBindingEndpoint((YEmbeddableValueEndpoint)otherEnd, msgs); |
| } |
| return super.eInverseAdd(otherEnd, featureID, msgs); |
| } |
| |
| /** |
| * <!-- 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 YECviewPackage.YBLOB_UPLOAD_COMPONENT__VALUE_BINDING_ENDPOINT: |
| return basicSetValueBindingEndpoint(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 YECviewPackage.YBLOB_UPLOAD_COMPONENT__VALUE_BINDING_ENDPOINT: |
| if (resolve) return getValueBindingEndpoint(); |
| return basicGetValueBindingEndpoint(); |
| case YECviewPackage.YBLOB_UPLOAD_COMPONENT__VALUE: |
| return getValue(); |
| case YECviewPackage.YBLOB_UPLOAD_COMPONENT__DISPLAY_RESOLUTION_ID: |
| return getDisplayResolutionId(); |
| case YECviewPackage.YBLOB_UPLOAD_COMPONENT__FIRMLY_LINKED: |
| return isFirmlyLinked(); |
| case YECviewPackage.YBLOB_UPLOAD_COMPONENT__UNIQUE_NAME_ENABLED: |
| return isUniqueNameEnabled(); |
| } |
| 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 YECviewPackage.YBLOB_UPLOAD_COMPONENT__VALUE_BINDING_ENDPOINT: |
| setValueBindingEndpoint((YEmbeddableValueEndpoint)newValue); |
| return; |
| case YECviewPackage.YBLOB_UPLOAD_COMPONENT__VALUE: |
| setValue((String)newValue); |
| return; |
| case YECviewPackage.YBLOB_UPLOAD_COMPONENT__DISPLAY_RESOLUTION_ID: |
| setDisplayResolutionId((Integer)newValue); |
| return; |
| case YECviewPackage.YBLOB_UPLOAD_COMPONENT__FIRMLY_LINKED: |
| setFirmlyLinked((Boolean)newValue); |
| return; |
| case YECviewPackage.YBLOB_UPLOAD_COMPONENT__UNIQUE_NAME_ENABLED: |
| setUniqueNameEnabled((Boolean)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 YECviewPackage.YBLOB_UPLOAD_COMPONENT__VALUE_BINDING_ENDPOINT: |
| setValueBindingEndpoint((YEmbeddableValueEndpoint)null); |
| return; |
| case YECviewPackage.YBLOB_UPLOAD_COMPONENT__VALUE: |
| setValue(VALUE_EDEFAULT); |
| return; |
| case YECviewPackage.YBLOB_UPLOAD_COMPONENT__DISPLAY_RESOLUTION_ID: |
| setDisplayResolutionId(DISPLAY_RESOLUTION_ID_EDEFAULT); |
| return; |
| case YECviewPackage.YBLOB_UPLOAD_COMPONENT__FIRMLY_LINKED: |
| setFirmlyLinked(FIRMLY_LINKED_EDEFAULT); |
| return; |
| case YECviewPackage.YBLOB_UPLOAD_COMPONENT__UNIQUE_NAME_ENABLED: |
| setUniqueNameEnabled(UNIQUE_NAME_ENABLED_EDEFAULT); |
| 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 YECviewPackage.YBLOB_UPLOAD_COMPONENT__VALUE_BINDING_ENDPOINT: |
| return valueBindingEndpoint != null; |
| case YECviewPackage.YBLOB_UPLOAD_COMPONENT__VALUE: |
| return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value); |
| case YECviewPackage.YBLOB_UPLOAD_COMPONENT__DISPLAY_RESOLUTION_ID: |
| return displayResolutionId != DISPLAY_RESOLUTION_ID_EDEFAULT; |
| case YECviewPackage.YBLOB_UPLOAD_COMPONENT__FIRMLY_LINKED: |
| return firmlyLinked != FIRMLY_LINKED_EDEFAULT; |
| case YECviewPackage.YBLOB_UPLOAD_COMPONENT__UNIQUE_NAME_ENABLED: |
| return uniqueNameEnabled != UNIQUE_NAME_ENABLED_EDEFAULT; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param derivedFeatureID |
| * the derived feature id |
| * @param baseClass |
| * the base class |
| * @return the int |
| * @generated |
| */ |
| @Override |
| public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) { |
| if (baseClass == YBindable.class) { |
| switch (derivedFeatureID) { |
| default: return -1; |
| } |
| } |
| if (baseClass == YValueBindable.class) { |
| switch (derivedFeatureID) { |
| case YECviewPackage.YBLOB_UPLOAD_COMPONENT__VALUE_BINDING_ENDPOINT: return CoreModelPackage.YVALUE_BINDABLE__VALUE_BINDING_ENDPOINT; |
| default: return -1; |
| } |
| } |
| return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param baseFeatureID |
| * the base feature id |
| * @param baseClass |
| * the base class |
| * @return the int |
| * @generated |
| */ |
| @Override |
| public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) { |
| if (baseClass == YBindable.class) { |
| switch (baseFeatureID) { |
| default: return -1; |
| } |
| } |
| if (baseClass == YValueBindable.class) { |
| switch (baseFeatureID) { |
| case CoreModelPackage.YVALUE_BINDABLE__VALUE_BINDING_ENDPOINT: return YECviewPackage.YBLOB_UPLOAD_COMPONENT__VALUE_BINDING_ENDPOINT; |
| default: return -1; |
| } |
| } |
| return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); |
| } |
| |
| /** |
| * <!-- 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(" (value: "); |
| result.append(value); |
| result.append(", displayResolutionId: "); |
| result.append(displayResolutionId); |
| result.append(", firmlyLinked: "); |
| result.append(firmlyLinked); |
| result.append(", uniqueNameEnabled: "); |
| result.append(uniqueNameEnabled); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } |