| /** |
| * |
| * 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 v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation |
| */ |
| package org.eclipse.osbp.infogrid.model.gridsource.impl; |
| |
| import java.util.Collection; |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.common.notify.NotificationChain; |
| import org.eclipse.emf.common.util.EList; |
| 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.emf.ecore.util.EDataTypeUniqueEList; |
| import org.eclipse.emf.ecore.util.EObjectContainmentEList; |
| import org.eclipse.emf.ecore.util.InternalEList; |
| import org.eclipse.xtext.common.types.JvmTypeReference; |
| import org.eclipse.osbp.infogrid.model.gridsource.CxGridProperty; |
| import org.eclipse.osbp.infogrid.model.gridsource.CxGridSource; |
| import org.eclipse.osbp.infogrid.model.gridsource.CxGridSourceInput; |
| import org.eclipse.osbp.infogrid.model.gridsource.CxGridSourcePackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Cx Grid Source</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.osbp.infogrid.model.gridsource.impl.CxGridSourceImpl#getId <em>Id</em>}</li> |
| * <li>{@link org.eclipse.osbp.infogrid.model.gridsource.impl.CxGridSourceImpl#getTags <em>Tags</em>}</li> |
| * <li>{@link org.eclipse.osbp.infogrid.model.gridsource.impl.CxGridSourceImpl#getKind <em>Kind</em>}</li> |
| * <li>{@link org.eclipse.osbp.infogrid.model.gridsource.impl.CxGridSourceImpl#getRootType <em>Root Type</em>}</li> |
| * <li>{@link org.eclipse.osbp.infogrid.model.gridsource.impl.CxGridSourceImpl#getRootTypeFQN <em>Root Type FQN</em>}</li> |
| * <li>{@link org.eclipse.osbp.infogrid.model.gridsource.impl.CxGridSourceImpl#getProperties <em>Properties</em>}</li> |
| * <li>{@link org.eclipse.osbp.infogrid.model.gridsource.impl.CxGridSourceImpl#getInputs <em>Inputs</em>}</li> |
| * <li>{@link org.eclipse.osbp.infogrid.model.gridsource.impl.CxGridSourceImpl#getSelectionEventTopic <em>Selection Event Topic</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class CxGridSourceImpl extends MinimalEObjectImpl.Container implements CxGridSource { |
| /** |
| * 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 #getTags() <em>Tags</em>}' attribute list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getTags() |
| * @generated |
| * @ordered |
| */ |
| protected EList<String> tags; |
| |
| /** |
| * The default value of the '{@link #getKind() <em>Kind</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getKind() |
| * @generated |
| * @ordered |
| */ |
| protected static final String KIND_EDEFAULT = "ecview"; |
| |
| /** |
| * The cached value of the '{@link #getKind() <em>Kind</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getKind() |
| * @generated |
| * @ordered |
| */ |
| protected String kind = KIND_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getRootType() <em>Root Type</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getRootType() |
| * @generated |
| * @ordered |
| */ |
| protected JvmTypeReference rootType; |
| |
| /** |
| * The default value of the '{@link #getRootTypeFQN() <em>Root Type FQN</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getRootTypeFQN() |
| * @generated |
| * @ordered |
| */ |
| protected static final String ROOT_TYPE_FQN_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getRootTypeFQN() <em>Root Type FQN</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getRootTypeFQN() |
| * @generated |
| * @ordered |
| */ |
| protected String rootTypeFQN = ROOT_TYPE_FQN_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getProperties() |
| * @generated |
| * @ordered |
| */ |
| protected EList<CxGridProperty> properties; |
| |
| /** |
| * The cached value of the '{@link #getInputs() <em>Inputs</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getInputs() |
| * @generated |
| * @ordered |
| */ |
| protected EList<CxGridSourceInput> inputs; |
| |
| /** |
| * The default value of the '{@link #getSelectionEventTopic() <em>Selection Event Topic</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getSelectionEventTopic() |
| * @generated |
| * @ordered |
| */ |
| protected static final String SELECTION_EVENT_TOPIC_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getSelectionEventTopic() <em>Selection Event Topic</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getSelectionEventTopic() |
| * @generated |
| * @ordered |
| */ |
| protected String selectionEventTopic = SELECTION_EVENT_TOPIC_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected CxGridSourceImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return CxGridSourcePackage.Literals.CX_GRID_SOURCE; |
| } |
| |
| /** |
| * <!-- 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, CxGridSourcePackage.CX_GRID_SOURCE__ID, oldId, id)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<String> getTags() { |
| if (tags == null) { |
| tags = new EDataTypeUniqueEList<String>(String.class, this, CxGridSourcePackage.CX_GRID_SOURCE__TAGS); |
| } |
| return tags; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getKind() { |
| return kind; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setKind(String newKind) { |
| String oldKind = kind; |
| kind = newKind; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, CxGridSourcePackage.CX_GRID_SOURCE__KIND, oldKind, kind)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public JvmTypeReference getRootType() { |
| return rootType; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetRootType(JvmTypeReference newRootType, NotificationChain msgs) { |
| JvmTypeReference oldRootType = rootType; |
| rootType = newRootType; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, CxGridSourcePackage.CX_GRID_SOURCE__ROOT_TYPE, oldRootType, newRootType); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setRootType(JvmTypeReference newRootType) { |
| if (newRootType != rootType) { |
| NotificationChain msgs = null; |
| if (rootType != null) |
| msgs = ((InternalEObject)rootType).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - CxGridSourcePackage.CX_GRID_SOURCE__ROOT_TYPE, null, msgs); |
| if (newRootType != null) |
| msgs = ((InternalEObject)newRootType).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CxGridSourcePackage.CX_GRID_SOURCE__ROOT_TYPE, null, msgs); |
| msgs = basicSetRootType(newRootType, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, CxGridSourcePackage.CX_GRID_SOURCE__ROOT_TYPE, newRootType, newRootType)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getRootTypeFQN() { |
| return rootTypeFQN; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setRootTypeFQN(String newRootTypeFQN) { |
| String oldRootTypeFQN = rootTypeFQN; |
| rootTypeFQN = newRootTypeFQN; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, CxGridSourcePackage.CX_GRID_SOURCE__ROOT_TYPE_FQN, oldRootTypeFQN, rootTypeFQN)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<CxGridProperty> getProperties() { |
| if (properties == null) { |
| properties = new EObjectContainmentEList<CxGridProperty>(CxGridProperty.class, this, CxGridSourcePackage.CX_GRID_SOURCE__PROPERTIES); |
| } |
| return properties; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<CxGridSourceInput> getInputs() { |
| if (inputs == null) { |
| inputs = new EObjectContainmentEList<CxGridSourceInput>(CxGridSourceInput.class, this, CxGridSourcePackage.CX_GRID_SOURCE__INPUTS); |
| } |
| return inputs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getSelectionEventTopic() { |
| return selectionEventTopic; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setSelectionEventTopic(String newSelectionEventTopic) { |
| String oldSelectionEventTopic = selectionEventTopic; |
| selectionEventTopic = newSelectionEventTopic; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, CxGridSourcePackage.CX_GRID_SOURCE__SELECTION_EVENT_TOPIC, oldSelectionEventTopic, selectionEventTopic)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case CxGridSourcePackage.CX_GRID_SOURCE__ROOT_TYPE: |
| return basicSetRootType(null, msgs); |
| case CxGridSourcePackage.CX_GRID_SOURCE__PROPERTIES: |
| return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs); |
| case CxGridSourcePackage.CX_GRID_SOURCE__INPUTS: |
| return ((InternalEList<?>)getInputs()).basicRemove(otherEnd, 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 CxGridSourcePackage.CX_GRID_SOURCE__ID: |
| return getId(); |
| case CxGridSourcePackage.CX_GRID_SOURCE__TAGS: |
| return getTags(); |
| case CxGridSourcePackage.CX_GRID_SOURCE__KIND: |
| return getKind(); |
| case CxGridSourcePackage.CX_GRID_SOURCE__ROOT_TYPE: |
| return getRootType(); |
| case CxGridSourcePackage.CX_GRID_SOURCE__ROOT_TYPE_FQN: |
| return getRootTypeFQN(); |
| case CxGridSourcePackage.CX_GRID_SOURCE__PROPERTIES: |
| return getProperties(); |
| case CxGridSourcePackage.CX_GRID_SOURCE__INPUTS: |
| return getInputs(); |
| case CxGridSourcePackage.CX_GRID_SOURCE__SELECTION_EVENT_TOPIC: |
| return getSelectionEventTopic(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @SuppressWarnings("unchecked") |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case CxGridSourcePackage.CX_GRID_SOURCE__ID: |
| setId((String)newValue); |
| return; |
| case CxGridSourcePackage.CX_GRID_SOURCE__TAGS: |
| getTags().clear(); |
| getTags().addAll((Collection<? extends String>)newValue); |
| return; |
| case CxGridSourcePackage.CX_GRID_SOURCE__KIND: |
| setKind((String)newValue); |
| return; |
| case CxGridSourcePackage.CX_GRID_SOURCE__ROOT_TYPE: |
| setRootType((JvmTypeReference)newValue); |
| return; |
| case CxGridSourcePackage.CX_GRID_SOURCE__ROOT_TYPE_FQN: |
| setRootTypeFQN((String)newValue); |
| return; |
| case CxGridSourcePackage.CX_GRID_SOURCE__PROPERTIES: |
| getProperties().clear(); |
| getProperties().addAll((Collection<? extends CxGridProperty>)newValue); |
| return; |
| case CxGridSourcePackage.CX_GRID_SOURCE__INPUTS: |
| getInputs().clear(); |
| getInputs().addAll((Collection<? extends CxGridSourceInput>)newValue); |
| return; |
| case CxGridSourcePackage.CX_GRID_SOURCE__SELECTION_EVENT_TOPIC: |
| setSelectionEventTopic((String)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case CxGridSourcePackage.CX_GRID_SOURCE__ID: |
| setId(ID_EDEFAULT); |
| return; |
| case CxGridSourcePackage.CX_GRID_SOURCE__TAGS: |
| getTags().clear(); |
| return; |
| case CxGridSourcePackage.CX_GRID_SOURCE__KIND: |
| setKind(KIND_EDEFAULT); |
| return; |
| case CxGridSourcePackage.CX_GRID_SOURCE__ROOT_TYPE: |
| setRootType((JvmTypeReference)null); |
| return; |
| case CxGridSourcePackage.CX_GRID_SOURCE__ROOT_TYPE_FQN: |
| setRootTypeFQN(ROOT_TYPE_FQN_EDEFAULT); |
| return; |
| case CxGridSourcePackage.CX_GRID_SOURCE__PROPERTIES: |
| getProperties().clear(); |
| return; |
| case CxGridSourcePackage.CX_GRID_SOURCE__INPUTS: |
| getInputs().clear(); |
| return; |
| case CxGridSourcePackage.CX_GRID_SOURCE__SELECTION_EVENT_TOPIC: |
| setSelectionEventTopic(SELECTION_EVENT_TOPIC_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case CxGridSourcePackage.CX_GRID_SOURCE__ID: |
| return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id); |
| case CxGridSourcePackage.CX_GRID_SOURCE__TAGS: |
| return tags != null && !tags.isEmpty(); |
| case CxGridSourcePackage.CX_GRID_SOURCE__KIND: |
| return KIND_EDEFAULT == null ? kind != null : !KIND_EDEFAULT.equals(kind); |
| case CxGridSourcePackage.CX_GRID_SOURCE__ROOT_TYPE: |
| return rootType != null; |
| case CxGridSourcePackage.CX_GRID_SOURCE__ROOT_TYPE_FQN: |
| return ROOT_TYPE_FQN_EDEFAULT == null ? rootTypeFQN != null : !ROOT_TYPE_FQN_EDEFAULT.equals(rootTypeFQN); |
| case CxGridSourcePackage.CX_GRID_SOURCE__PROPERTIES: |
| return properties != null && !properties.isEmpty(); |
| case CxGridSourcePackage.CX_GRID_SOURCE__INPUTS: |
| return inputs != null && !inputs.isEmpty(); |
| case CxGridSourcePackage.CX_GRID_SOURCE__SELECTION_EVENT_TOPIC: |
| return SELECTION_EVENT_TOPIC_EDEFAULT == null ? selectionEventTopic != null : !SELECTION_EVENT_TOPIC_EDEFAULT.equals(selectionEventTopic); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuffer result = new StringBuffer(super.toString()); |
| result.append(" (id: "); |
| result.append(id); |
| result.append(", tags: "); |
| result.append(tags); |
| result.append(", kind: "); |
| result.append(kind); |
| result.append(", rootTypeFQN: "); |
| result.append(rootTypeFQN); |
| result.append(", selectionEventTopic: "); |
| result.append(selectionEventTopic); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //CxGridSourceImpl |