| /** |
| * |
| * 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: |
| * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation |
| */ |
| package org.eclipse.osbp.infogrid.model.gridsource.style.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.infogrid.model.gridsource.CxGridNestedField; |
| import org.eclipse.osbp.infogrid.model.gridsource.style.CxGridPropQuantityStyle; |
| import org.eclipse.osbp.infogrid.model.gridsource.style.CxGridStylePackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Cx Grid Prop Quantity Style</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.infogrid.model.gridsource.style.impl.CxGridPropQuantityStyleImpl#getValuePropertyPath <em>Value Property Path</em>}</li> |
| * <li>{@link org.eclipse.osbp.infogrid.model.gridsource.style.impl.CxGridPropQuantityStyleImpl#getValuePropertyDotPath <em>Value Property Dot Path</em>}</li> |
| * <li>{@link org.eclipse.osbp.infogrid.model.gridsource.style.impl.CxGridPropQuantityStyleImpl#getValueNumberFormat <em>Value Number Format</em>}</li> |
| * <li>{@link org.eclipse.osbp.infogrid.model.gridsource.style.impl.CxGridPropQuantityStyleImpl#getUomPropertyPath <em>Uom Property Path</em>}</li> |
| * <li>{@link org.eclipse.osbp.infogrid.model.gridsource.style.impl.CxGridPropQuantityStyleImpl#getUomPropertyDotPath <em>Uom Property Dot Path</em>}</li> |
| * <li>{@link org.eclipse.osbp.infogrid.model.gridsource.style.impl.CxGridPropQuantityStyleImpl#getHtmlPattern <em>Html Pattern</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class CxGridPropQuantityStyleImpl extends CxGridPropStyleImpl implements CxGridPropQuantityStyle { |
| /** |
| * The cached value of the '{@link #getValuePropertyPath() <em>Value Property Path</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getValuePropertyPath() |
| * @generated |
| * @ordered |
| */ |
| protected CxGridNestedField valuePropertyPath; |
| |
| /** |
| * The default value of the '{@link #getValuePropertyDotPath() <em>Value Property Dot Path</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getValuePropertyDotPath() |
| * @generated |
| * @ordered |
| */ |
| protected static final String VALUE_PROPERTY_DOT_PATH_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getValuePropertyDotPath() <em>Value Property Dot Path</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getValuePropertyDotPath() |
| * @generated |
| * @ordered |
| */ |
| protected String valuePropertyDotPath = VALUE_PROPERTY_DOT_PATH_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getValueNumberFormat() <em>Value Number Format</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getValueNumberFormat() |
| * @generated |
| * @ordered |
| */ |
| protected static final String VALUE_NUMBER_FORMAT_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getValueNumberFormat() <em>Value Number Format</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getValueNumberFormat() |
| * @generated |
| * @ordered |
| */ |
| protected String valueNumberFormat = VALUE_NUMBER_FORMAT_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getUomPropertyPath() <em>Uom Property Path</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getUomPropertyPath() |
| * @generated |
| * @ordered |
| */ |
| protected CxGridNestedField uomPropertyPath; |
| |
| /** |
| * The default value of the '{@link #getUomPropertyDotPath() <em>Uom Property Dot Path</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getUomPropertyDotPath() |
| * @generated |
| * @ordered |
| */ |
| protected static final String UOM_PROPERTY_DOT_PATH_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getUomPropertyDotPath() <em>Uom Property Dot Path</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getUomPropertyDotPath() |
| * @generated |
| * @ordered |
| */ |
| protected String uomPropertyDotPath = UOM_PROPERTY_DOT_PATH_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getHtmlPattern() <em>Html Pattern</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getHtmlPattern() |
| * @generated |
| * @ordered |
| */ |
| protected static final String HTML_PATTERN_EDEFAULT = "<b>{@value}</b> - <i>{@uom}</i>"; |
| |
| /** |
| * The cached value of the '{@link #getHtmlPattern() <em>Html Pattern</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getHtmlPattern() |
| * @generated |
| * @ordered |
| */ |
| protected String htmlPattern = HTML_PATTERN_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected CxGridPropQuantityStyleImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return CxGridStylePackage.Literals.CX_GRID_PROP_QUANTITY_STYLE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public CxGridNestedField getValuePropertyPath() { |
| return valuePropertyPath; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetValuePropertyPath(CxGridNestedField newValuePropertyPath, NotificationChain msgs) { |
| CxGridNestedField oldValuePropertyPath = valuePropertyPath; |
| valuePropertyPath = newValuePropertyPath; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, CxGridStylePackage.CX_GRID_PROP_QUANTITY_STYLE__VALUE_PROPERTY_PATH, oldValuePropertyPath, newValuePropertyPath); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setValuePropertyPath(CxGridNestedField newValuePropertyPath) { |
| if (newValuePropertyPath != valuePropertyPath) { |
| NotificationChain msgs = null; |
| if (valuePropertyPath != null) |
| msgs = ((InternalEObject)valuePropertyPath).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - CxGridStylePackage.CX_GRID_PROP_QUANTITY_STYLE__VALUE_PROPERTY_PATH, null, msgs); |
| if (newValuePropertyPath != null) |
| msgs = ((InternalEObject)newValuePropertyPath).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CxGridStylePackage.CX_GRID_PROP_QUANTITY_STYLE__VALUE_PROPERTY_PATH, null, msgs); |
| msgs = basicSetValuePropertyPath(newValuePropertyPath, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, CxGridStylePackage.CX_GRID_PROP_QUANTITY_STYLE__VALUE_PROPERTY_PATH, newValuePropertyPath, newValuePropertyPath)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getValuePropertyDotPath() { |
| return valuePropertyDotPath; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setValuePropertyDotPath(String newValuePropertyDotPath) { |
| String oldValuePropertyDotPath = valuePropertyDotPath; |
| valuePropertyDotPath = newValuePropertyDotPath; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, CxGridStylePackage.CX_GRID_PROP_QUANTITY_STYLE__VALUE_PROPERTY_DOT_PATH, oldValuePropertyDotPath, valuePropertyDotPath)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getValueNumberFormat() { |
| return valueNumberFormat; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setValueNumberFormat(String newValueNumberFormat) { |
| String oldValueNumberFormat = valueNumberFormat; |
| valueNumberFormat = newValueNumberFormat; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, CxGridStylePackage.CX_GRID_PROP_QUANTITY_STYLE__VALUE_NUMBER_FORMAT, oldValueNumberFormat, valueNumberFormat)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public CxGridNestedField getUomPropertyPath() { |
| return uomPropertyPath; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetUomPropertyPath(CxGridNestedField newUomPropertyPath, NotificationChain msgs) { |
| CxGridNestedField oldUomPropertyPath = uomPropertyPath; |
| uomPropertyPath = newUomPropertyPath; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, CxGridStylePackage.CX_GRID_PROP_QUANTITY_STYLE__UOM_PROPERTY_PATH, oldUomPropertyPath, newUomPropertyPath); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setUomPropertyPath(CxGridNestedField newUomPropertyPath) { |
| if (newUomPropertyPath != uomPropertyPath) { |
| NotificationChain msgs = null; |
| if (uomPropertyPath != null) |
| msgs = ((InternalEObject)uomPropertyPath).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - CxGridStylePackage.CX_GRID_PROP_QUANTITY_STYLE__UOM_PROPERTY_PATH, null, msgs); |
| if (newUomPropertyPath != null) |
| msgs = ((InternalEObject)newUomPropertyPath).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CxGridStylePackage.CX_GRID_PROP_QUANTITY_STYLE__UOM_PROPERTY_PATH, null, msgs); |
| msgs = basicSetUomPropertyPath(newUomPropertyPath, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, CxGridStylePackage.CX_GRID_PROP_QUANTITY_STYLE__UOM_PROPERTY_PATH, newUomPropertyPath, newUomPropertyPath)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getUomPropertyDotPath() { |
| return uomPropertyDotPath; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setUomPropertyDotPath(String newUomPropertyDotPath) { |
| String oldUomPropertyDotPath = uomPropertyDotPath; |
| uomPropertyDotPath = newUomPropertyDotPath; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, CxGridStylePackage.CX_GRID_PROP_QUANTITY_STYLE__UOM_PROPERTY_DOT_PATH, oldUomPropertyDotPath, uomPropertyDotPath)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getHtmlPattern() { |
| return htmlPattern; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setHtmlPattern(String newHtmlPattern) { |
| String oldHtmlPattern = htmlPattern; |
| htmlPattern = newHtmlPattern; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, CxGridStylePackage.CX_GRID_PROP_QUANTITY_STYLE__HTML_PATTERN, oldHtmlPattern, htmlPattern)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case CxGridStylePackage.CX_GRID_PROP_QUANTITY_STYLE__VALUE_PROPERTY_PATH: |
| return basicSetValuePropertyPath(null, msgs); |
| case CxGridStylePackage.CX_GRID_PROP_QUANTITY_STYLE__UOM_PROPERTY_PATH: |
| return basicSetUomPropertyPath(null, 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_QUANTITY_STYLE__VALUE_PROPERTY_PATH: |
| return getValuePropertyPath(); |
| case CxGridStylePackage.CX_GRID_PROP_QUANTITY_STYLE__VALUE_PROPERTY_DOT_PATH: |
| return getValuePropertyDotPath(); |
| case CxGridStylePackage.CX_GRID_PROP_QUANTITY_STYLE__VALUE_NUMBER_FORMAT: |
| return getValueNumberFormat(); |
| case CxGridStylePackage.CX_GRID_PROP_QUANTITY_STYLE__UOM_PROPERTY_PATH: |
| return getUomPropertyPath(); |
| case CxGridStylePackage.CX_GRID_PROP_QUANTITY_STYLE__UOM_PROPERTY_DOT_PATH: |
| return getUomPropertyDotPath(); |
| case CxGridStylePackage.CX_GRID_PROP_QUANTITY_STYLE__HTML_PATTERN: |
| return getHtmlPattern(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case CxGridStylePackage.CX_GRID_PROP_QUANTITY_STYLE__VALUE_PROPERTY_PATH: |
| setValuePropertyPath((CxGridNestedField)newValue); |
| return; |
| case CxGridStylePackage.CX_GRID_PROP_QUANTITY_STYLE__VALUE_PROPERTY_DOT_PATH: |
| setValuePropertyDotPath((String)newValue); |
| return; |
| case CxGridStylePackage.CX_GRID_PROP_QUANTITY_STYLE__VALUE_NUMBER_FORMAT: |
| setValueNumberFormat((String)newValue); |
| return; |
| case CxGridStylePackage.CX_GRID_PROP_QUANTITY_STYLE__UOM_PROPERTY_PATH: |
| setUomPropertyPath((CxGridNestedField)newValue); |
| return; |
| case CxGridStylePackage.CX_GRID_PROP_QUANTITY_STYLE__UOM_PROPERTY_DOT_PATH: |
| setUomPropertyDotPath((String)newValue); |
| return; |
| case CxGridStylePackage.CX_GRID_PROP_QUANTITY_STYLE__HTML_PATTERN: |
| setHtmlPattern((String)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_QUANTITY_STYLE__VALUE_PROPERTY_PATH: |
| setValuePropertyPath((CxGridNestedField)null); |
| return; |
| case CxGridStylePackage.CX_GRID_PROP_QUANTITY_STYLE__VALUE_PROPERTY_DOT_PATH: |
| setValuePropertyDotPath(VALUE_PROPERTY_DOT_PATH_EDEFAULT); |
| return; |
| case CxGridStylePackage.CX_GRID_PROP_QUANTITY_STYLE__VALUE_NUMBER_FORMAT: |
| setValueNumberFormat(VALUE_NUMBER_FORMAT_EDEFAULT); |
| return; |
| case CxGridStylePackage.CX_GRID_PROP_QUANTITY_STYLE__UOM_PROPERTY_PATH: |
| setUomPropertyPath((CxGridNestedField)null); |
| return; |
| case CxGridStylePackage.CX_GRID_PROP_QUANTITY_STYLE__UOM_PROPERTY_DOT_PATH: |
| setUomPropertyDotPath(UOM_PROPERTY_DOT_PATH_EDEFAULT); |
| return; |
| case CxGridStylePackage.CX_GRID_PROP_QUANTITY_STYLE__HTML_PATTERN: |
| setHtmlPattern(HTML_PATTERN_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case CxGridStylePackage.CX_GRID_PROP_QUANTITY_STYLE__VALUE_PROPERTY_PATH: |
| return valuePropertyPath != null; |
| case CxGridStylePackage.CX_GRID_PROP_QUANTITY_STYLE__VALUE_PROPERTY_DOT_PATH: |
| return VALUE_PROPERTY_DOT_PATH_EDEFAULT == null ? valuePropertyDotPath != null : !VALUE_PROPERTY_DOT_PATH_EDEFAULT.equals(valuePropertyDotPath); |
| case CxGridStylePackage.CX_GRID_PROP_QUANTITY_STYLE__VALUE_NUMBER_FORMAT: |
| return VALUE_NUMBER_FORMAT_EDEFAULT == null ? valueNumberFormat != null : !VALUE_NUMBER_FORMAT_EDEFAULT.equals(valueNumberFormat); |
| case CxGridStylePackage.CX_GRID_PROP_QUANTITY_STYLE__UOM_PROPERTY_PATH: |
| return uomPropertyPath != null; |
| case CxGridStylePackage.CX_GRID_PROP_QUANTITY_STYLE__UOM_PROPERTY_DOT_PATH: |
| return UOM_PROPERTY_DOT_PATH_EDEFAULT == null ? uomPropertyDotPath != null : !UOM_PROPERTY_DOT_PATH_EDEFAULT.equals(uomPropertyDotPath); |
| case CxGridStylePackage.CX_GRID_PROP_QUANTITY_STYLE__HTML_PATTERN: |
| return HTML_PATTERN_EDEFAULT == null ? htmlPattern != null : !HTML_PATTERN_EDEFAULT.equals(htmlPattern); |
| } |
| 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(" (valuePropertyDotPath: "); |
| result.append(valuePropertyDotPath); |
| result.append(", valueNumberFormat: "); |
| result.append(valueNumberFormat); |
| result.append(", uomPropertyDotPath: "); |
| result.append(uomPropertyDotPath); |
| result.append(", htmlPattern: "); |
| result.append(htmlPattern); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //CxGridPropQuantityStyleImpl |