| /** |
| * |
| * 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.grid.renderer.impl; |
| |
| import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridNumberRenderer; |
| import org.eclipse.osbp.ecview.extension.grid.renderer.CxGridRendererPackage; |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Cx Grid Number Renderer</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.ecview.extension.grid.renderer.impl.CxGridNumberRendererImpl#getNumberFormat <em>Number Format</em>}</li> |
| * <li>{@link org.eclipse.osbp.ecview.extension.grid.renderer.impl.CxGridNumberRendererImpl#getNullRepresentation <em>Null Representation</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class CxGridNumberRendererImpl extends CxGridRendererImpl implements CxGridNumberRenderer { |
| |
| /** |
| * The default value of the '{@link #getNumberFormat() <em>Number Format</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getNumberFormat() |
| * @generated |
| * @ordered |
| */ |
| protected static final String NUMBER_FORMAT_EDEFAULT = "#,##0.00"; |
| |
| /** |
| * The cached value of the '{@link #getNumberFormat() <em>Number Format</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getNumberFormat() |
| * @generated |
| * @ordered |
| */ |
| protected String numberFormat = NUMBER_FORMAT_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getNullRepresentation() <em>Null Representation</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getNullRepresentation() |
| * @generated |
| * @ordered |
| */ |
| protected static final String NULL_REPRESENTATION_EDEFAULT = ""; |
| |
| /** |
| * The cached value of the '{@link #getNullRepresentation() <em>Null Representation</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getNullRepresentation() |
| * @generated |
| * @ordered |
| */ |
| protected String nullRepresentation = NULL_REPRESENTATION_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @generated |
| */ |
| protected CxGridNumberRendererImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @return the e class |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return CxGridRendererPackage.Literals.CX_GRID_NUMBER_RENDERER; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @return the cached value of the '{@link #getNumberFormat() |
| * <em>Number Format</em>}' attribute |
| * @generated |
| */ |
| public String getNumberFormat() { |
| return numberFormat; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param newNumberFormat |
| * the new cached value of the '{@link #getNumberFormat() |
| * <em>Number Format</em>}' attribute |
| * @generated |
| */ |
| public void setNumberFormat(String newNumberFormat) { |
| String oldNumberFormat = numberFormat; |
| numberFormat = newNumberFormat; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, CxGridRendererPackage.CX_GRID_NUMBER_RENDERER__NUMBER_FORMAT, oldNumberFormat, numberFormat)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @return the cached value of the '{@link #getNullRepresentation() |
| * <em>Null Representation</em>}' attribute |
| * @generated |
| */ |
| public String getNullRepresentation() { |
| return nullRepresentation; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param newNullRepresentation |
| * the new cached value of the '{@link #getNullRepresentation() |
| * <em>Null Representation</em>}' attribute |
| * @generated |
| */ |
| public void setNullRepresentation(String newNullRepresentation) { |
| String oldNullRepresentation = nullRepresentation; |
| nullRepresentation = newNullRepresentation; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, CxGridRendererPackage.CX_GRID_NUMBER_RENDERER__NULL_REPRESENTATION, oldNullRepresentation, nullRepresentation)); |
| } |
| |
| /** |
| * <!-- 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 CxGridRendererPackage.CX_GRID_NUMBER_RENDERER__NUMBER_FORMAT: |
| return getNumberFormat(); |
| case CxGridRendererPackage.CX_GRID_NUMBER_RENDERER__NULL_REPRESENTATION: |
| return getNullRepresentation(); |
| } |
| 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 CxGridRendererPackage.CX_GRID_NUMBER_RENDERER__NUMBER_FORMAT: |
| setNumberFormat((String)newValue); |
| return; |
| case CxGridRendererPackage.CX_GRID_NUMBER_RENDERER__NULL_REPRESENTATION: |
| setNullRepresentation((String)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 CxGridRendererPackage.CX_GRID_NUMBER_RENDERER__NUMBER_FORMAT: |
| setNumberFormat(NUMBER_FORMAT_EDEFAULT); |
| return; |
| case CxGridRendererPackage.CX_GRID_NUMBER_RENDERER__NULL_REPRESENTATION: |
| setNullRepresentation(NULL_REPRESENTATION_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 CxGridRendererPackage.CX_GRID_NUMBER_RENDERER__NUMBER_FORMAT: |
| return NUMBER_FORMAT_EDEFAULT == null ? numberFormat != null : !NUMBER_FORMAT_EDEFAULT.equals(numberFormat); |
| case CxGridRendererPackage.CX_GRID_NUMBER_RENDERER__NULL_REPRESENTATION: |
| return NULL_REPRESENTATION_EDEFAULT == null ? nullRepresentation != null : !NULL_REPRESENTATION_EDEFAULT.equals(nullRepresentation); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- 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(" (numberFormat: "); |
| result.append(numberFormat); |
| result.append(", nullRepresentation: "); |
| result.append(nullRepresentation); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } |