blob: a48e0a898347c893ae8818007224220c721378a1 [file] [log] [blame]
/**
*
* 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 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.CxGridPropPriceStyle;
import org.eclipse.osbp.infogrid.model.gridsource.style.CxGridStylePackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Cx Grid Prop Price Style</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.osbp.infogrid.model.gridsource.style.impl.CxGridPropPriceStyleImpl#getValuePropertyPath <em>Value Property Path</em>}</li>
* <li>{@link org.eclipse.osbp.infogrid.model.gridsource.style.impl.CxGridPropPriceStyleImpl#getValuePropertyDotPath <em>Value Property Dot Path</em>}</li>
* <li>{@link org.eclipse.osbp.infogrid.model.gridsource.style.impl.CxGridPropPriceStyleImpl#getValueNumberFormat <em>Value Number Format</em>}</li>
* <li>{@link org.eclipse.osbp.infogrid.model.gridsource.style.impl.CxGridPropPriceStyleImpl#getCurrencyPropertyPath <em>Currency Property Path</em>}</li>
* <li>{@link org.eclipse.osbp.infogrid.model.gridsource.style.impl.CxGridPropPriceStyleImpl#getCurrencyPropertyDotPath <em>Currency Property Dot Path</em>}</li>
* <li>{@link org.eclipse.osbp.infogrid.model.gridsource.style.impl.CxGridPropPriceStyleImpl#getHtmlPattern <em>Html Pattern</em>}</li>
* </ul>
*
* @generated
*/
public class CxGridPropPriceStyleImpl extends CxGridPropStyleImpl implements CxGridPropPriceStyle {
/**
* 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 #getCurrencyPropertyPath() <em>Currency Property Path</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCurrencyPropertyPath()
* @generated
* @ordered
*/
protected CxGridNestedField currencyPropertyPath;
/**
* The default value of the '{@link #getCurrencyPropertyDotPath() <em>Currency Property Dot Path</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCurrencyPropertyDotPath()
* @generated
* @ordered
*/
protected static final String CURRENCY_PROPERTY_DOT_PATH_EDEFAULT = null;
/**
* The cached value of the '{@link #getCurrencyPropertyDotPath() <em>Currency Property Dot Path</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCurrencyPropertyDotPath()
* @generated
* @ordered
*/
protected String currencyPropertyDotPath = CURRENCY_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>{@currency}</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 CxGridPropPriceStyleImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return CxGridStylePackage.Literals.CX_GRID_PROP_PRICE_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_PRICE_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_PRICE_STYLE__VALUE_PROPERTY_PATH, null, msgs);
if (newValuePropertyPath != null)
msgs = ((InternalEObject)newValuePropertyPath).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CxGridStylePackage.CX_GRID_PROP_PRICE_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_PRICE_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_PRICE_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_PRICE_STYLE__VALUE_NUMBER_FORMAT, oldValueNumberFormat, valueNumberFormat));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public CxGridNestedField getCurrencyPropertyPath() {
return currencyPropertyPath;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetCurrencyPropertyPath(CxGridNestedField newCurrencyPropertyPath, NotificationChain msgs) {
CxGridNestedField oldCurrencyPropertyPath = currencyPropertyPath;
currencyPropertyPath = newCurrencyPropertyPath;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, CxGridStylePackage.CX_GRID_PROP_PRICE_STYLE__CURRENCY_PROPERTY_PATH, oldCurrencyPropertyPath, newCurrencyPropertyPath);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setCurrencyPropertyPath(CxGridNestedField newCurrencyPropertyPath) {
if (newCurrencyPropertyPath != currencyPropertyPath) {
NotificationChain msgs = null;
if (currencyPropertyPath != null)
msgs = ((InternalEObject)currencyPropertyPath).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - CxGridStylePackage.CX_GRID_PROP_PRICE_STYLE__CURRENCY_PROPERTY_PATH, null, msgs);
if (newCurrencyPropertyPath != null)
msgs = ((InternalEObject)newCurrencyPropertyPath).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CxGridStylePackage.CX_GRID_PROP_PRICE_STYLE__CURRENCY_PROPERTY_PATH, null, msgs);
msgs = basicSetCurrencyPropertyPath(newCurrencyPropertyPath, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CxGridStylePackage.CX_GRID_PROP_PRICE_STYLE__CURRENCY_PROPERTY_PATH, newCurrencyPropertyPath, newCurrencyPropertyPath));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getCurrencyPropertyDotPath() {
return currencyPropertyDotPath;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setCurrencyPropertyDotPath(String newCurrencyPropertyDotPath) {
String oldCurrencyPropertyDotPath = currencyPropertyDotPath;
currencyPropertyDotPath = newCurrencyPropertyDotPath;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CxGridStylePackage.CX_GRID_PROP_PRICE_STYLE__CURRENCY_PROPERTY_DOT_PATH, oldCurrencyPropertyDotPath, currencyPropertyDotPath));
}
/**
* <!-- 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_PRICE_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_PRICE_STYLE__VALUE_PROPERTY_PATH:
return basicSetValuePropertyPath(null, msgs);
case CxGridStylePackage.CX_GRID_PROP_PRICE_STYLE__CURRENCY_PROPERTY_PATH:
return basicSetCurrencyPropertyPath(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_PRICE_STYLE__VALUE_PROPERTY_PATH:
return getValuePropertyPath();
case CxGridStylePackage.CX_GRID_PROP_PRICE_STYLE__VALUE_PROPERTY_DOT_PATH:
return getValuePropertyDotPath();
case CxGridStylePackage.CX_GRID_PROP_PRICE_STYLE__VALUE_NUMBER_FORMAT:
return getValueNumberFormat();
case CxGridStylePackage.CX_GRID_PROP_PRICE_STYLE__CURRENCY_PROPERTY_PATH:
return getCurrencyPropertyPath();
case CxGridStylePackage.CX_GRID_PROP_PRICE_STYLE__CURRENCY_PROPERTY_DOT_PATH:
return getCurrencyPropertyDotPath();
case CxGridStylePackage.CX_GRID_PROP_PRICE_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_PRICE_STYLE__VALUE_PROPERTY_PATH:
setValuePropertyPath((CxGridNestedField)newValue);
return;
case CxGridStylePackage.CX_GRID_PROP_PRICE_STYLE__VALUE_PROPERTY_DOT_PATH:
setValuePropertyDotPath((String)newValue);
return;
case CxGridStylePackage.CX_GRID_PROP_PRICE_STYLE__VALUE_NUMBER_FORMAT:
setValueNumberFormat((String)newValue);
return;
case CxGridStylePackage.CX_GRID_PROP_PRICE_STYLE__CURRENCY_PROPERTY_PATH:
setCurrencyPropertyPath((CxGridNestedField)newValue);
return;
case CxGridStylePackage.CX_GRID_PROP_PRICE_STYLE__CURRENCY_PROPERTY_DOT_PATH:
setCurrencyPropertyDotPath((String)newValue);
return;
case CxGridStylePackage.CX_GRID_PROP_PRICE_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_PRICE_STYLE__VALUE_PROPERTY_PATH:
setValuePropertyPath((CxGridNestedField)null);
return;
case CxGridStylePackage.CX_GRID_PROP_PRICE_STYLE__VALUE_PROPERTY_DOT_PATH:
setValuePropertyDotPath(VALUE_PROPERTY_DOT_PATH_EDEFAULT);
return;
case CxGridStylePackage.CX_GRID_PROP_PRICE_STYLE__VALUE_NUMBER_FORMAT:
setValueNumberFormat(VALUE_NUMBER_FORMAT_EDEFAULT);
return;
case CxGridStylePackage.CX_GRID_PROP_PRICE_STYLE__CURRENCY_PROPERTY_PATH:
setCurrencyPropertyPath((CxGridNestedField)null);
return;
case CxGridStylePackage.CX_GRID_PROP_PRICE_STYLE__CURRENCY_PROPERTY_DOT_PATH:
setCurrencyPropertyDotPath(CURRENCY_PROPERTY_DOT_PATH_EDEFAULT);
return;
case CxGridStylePackage.CX_GRID_PROP_PRICE_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_PRICE_STYLE__VALUE_PROPERTY_PATH:
return valuePropertyPath != null;
case CxGridStylePackage.CX_GRID_PROP_PRICE_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_PRICE_STYLE__VALUE_NUMBER_FORMAT:
return VALUE_NUMBER_FORMAT_EDEFAULT == null ? valueNumberFormat != null : !VALUE_NUMBER_FORMAT_EDEFAULT.equals(valueNumberFormat);
case CxGridStylePackage.CX_GRID_PROP_PRICE_STYLE__CURRENCY_PROPERTY_PATH:
return currencyPropertyPath != null;
case CxGridStylePackage.CX_GRID_PROP_PRICE_STYLE__CURRENCY_PROPERTY_DOT_PATH:
return CURRENCY_PROPERTY_DOT_PATH_EDEFAULT == null ? currencyPropertyDotPath != null : !CURRENCY_PROPERTY_DOT_PATH_EDEFAULT.equals(currencyPropertyDotPath);
case CxGridStylePackage.CX_GRID_PROP_PRICE_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(", currencyPropertyDotPath: ");
result.append(currencyPropertyDotPath);
result.append(", htmlPattern: ");
result.append(htmlPattern);
result.append(')');
return result.toString();
}
} //CxGridPropPriceStyleImpl