| /** |
| * |
| * 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.style.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.util.EObjectContainmentEList; |
| import org.eclipse.emf.ecore.util.InternalEList; |
| import org.eclipse.osbp.infogrid.model.gridsource.style.CxGridEventTopicAble; |
| import org.eclipse.osbp.infogrid.model.gridsource.style.CxGridPropImageStyle; |
| import org.eclipse.osbp.infogrid.model.gridsource.style.CxGridStyleConfig; |
| import org.eclipse.osbp.infogrid.model.gridsource.style.CxGridStylePackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Cx Grid Prop Image Style</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.infogrid.model.gridsource.style.impl.CxGridPropImageStyleImpl#getEventTopic <em>Event Topic</em>}</li> |
| * <li>{@link org.eclipse.osbp.infogrid.model.gridsource.style.impl.CxGridPropImageStyleImpl#getConfigs <em>Configs</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class CxGridPropImageStyleImpl extends CxGridPropStyleImpl implements CxGridPropImageStyle { |
| /** |
| * The default value of the '{@link #getEventTopic() <em>Event Topic</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getEventTopic() |
| * @generated |
| * @ordered |
| */ |
| protected static final String EVENT_TOPIC_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getEventTopic() <em>Event Topic</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getEventTopic() |
| * @generated |
| * @ordered |
| */ |
| protected String eventTopic = EVENT_TOPIC_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getConfigs() <em>Configs</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getConfigs() |
| * @generated |
| * @ordered |
| */ |
| protected EList<CxGridStyleConfig> configs; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected CxGridPropImageStyleImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return CxGridStylePackage.Literals.CX_GRID_PROP_IMAGE_STYLE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getEventTopic() { |
| return eventTopic; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setEventTopic(String newEventTopic) { |
| String oldEventTopic = eventTopic; |
| eventTopic = newEventTopic; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, CxGridStylePackage.CX_GRID_PROP_IMAGE_STYLE__EVENT_TOPIC, oldEventTopic, eventTopic)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<CxGridStyleConfig> getConfigs() { |
| if (configs == null) { |
| configs = new EObjectContainmentEList<CxGridStyleConfig>(CxGridStyleConfig.class, this, CxGridStylePackage.CX_GRID_PROP_IMAGE_STYLE__CONFIGS); |
| } |
| return configs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case CxGridStylePackage.CX_GRID_PROP_IMAGE_STYLE__CONFIGS: |
| return ((InternalEList<?>)getConfigs()).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 CxGridStylePackage.CX_GRID_PROP_IMAGE_STYLE__EVENT_TOPIC: |
| return getEventTopic(); |
| case CxGridStylePackage.CX_GRID_PROP_IMAGE_STYLE__CONFIGS: |
| return getConfigs(); |
| } |
| 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 CxGridStylePackage.CX_GRID_PROP_IMAGE_STYLE__EVENT_TOPIC: |
| setEventTopic((String)newValue); |
| return; |
| case CxGridStylePackage.CX_GRID_PROP_IMAGE_STYLE__CONFIGS: |
| getConfigs().clear(); |
| getConfigs().addAll((Collection<? extends CxGridStyleConfig>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case CxGridStylePackage.CX_GRID_PROP_IMAGE_STYLE__EVENT_TOPIC: |
| setEventTopic(EVENT_TOPIC_EDEFAULT); |
| return; |
| case CxGridStylePackage.CX_GRID_PROP_IMAGE_STYLE__CONFIGS: |
| getConfigs().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case CxGridStylePackage.CX_GRID_PROP_IMAGE_STYLE__EVENT_TOPIC: |
| return EVENT_TOPIC_EDEFAULT == null ? eventTopic != null : !EVENT_TOPIC_EDEFAULT.equals(eventTopic); |
| case CxGridStylePackage.CX_GRID_PROP_IMAGE_STYLE__CONFIGS: |
| return configs != null && !configs.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) { |
| if (baseClass == CxGridEventTopicAble.class) { |
| switch (derivedFeatureID) { |
| case CxGridStylePackage.CX_GRID_PROP_IMAGE_STYLE__EVENT_TOPIC: return CxGridStylePackage.CX_GRID_EVENT_TOPIC_ABLE__EVENT_TOPIC; |
| default: return -1; |
| } |
| } |
| return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) { |
| if (baseClass == CxGridEventTopicAble.class) { |
| switch (baseFeatureID) { |
| case CxGridStylePackage.CX_GRID_EVENT_TOPIC_ABLE__EVENT_TOPIC: return CxGridStylePackage.CX_GRID_PROP_IMAGE_STYLE__EVENT_TOPIC; |
| default: return -1; |
| } |
| } |
| return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuffer result = new StringBuffer(super.toString()); |
| result.append(" (eventTopic: "); |
| result.append(eventTopic); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //CxGridPropImageStyleImpl |