blob: 433680066e1a90baf4a93cb71612dff81caa6e33 [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 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.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.osbp.infogrid.model.gridsource.style.CxGridPropDateStyle;
import org.eclipse.osbp.infogrid.model.gridsource.style.CxGridStylePackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Cx Grid Prop Date Style</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.osbp.infogrid.model.gridsource.style.impl.CxGridPropDateStyleImpl#getDateFormat <em>Date Format</em>}</li>
* </ul>
*
* @generated
*/
public class CxGridPropDateStyleImpl extends CxGridPropStyleImpl implements CxGridPropDateStyle {
/**
* The default value of the '{@link #getDateFormat() <em>Date Format</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDateFormat()
* @generated
* @ordered
*/
protected static final String DATE_FORMAT_EDEFAULT = null;
/**
* The cached value of the '{@link #getDateFormat() <em>Date Format</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDateFormat()
* @generated
* @ordered
*/
protected String dateFormat = DATE_FORMAT_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected CxGridPropDateStyleImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return CxGridStylePackage.Literals.CX_GRID_PROP_DATE_STYLE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getDateFormat() {
return dateFormat;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDateFormat(String newDateFormat) {
String oldDateFormat = dateFormat;
dateFormat = newDateFormat;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CxGridStylePackage.CX_GRID_PROP_DATE_STYLE__DATE_FORMAT, oldDateFormat, dateFormat));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case CxGridStylePackage.CX_GRID_PROP_DATE_STYLE__DATE_FORMAT:
return getDateFormat();
}
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_DATE_STYLE__DATE_FORMAT:
setDateFormat((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_DATE_STYLE__DATE_FORMAT:
setDateFormat(DATE_FORMAT_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_DATE_STYLE__DATE_FORMAT:
return DATE_FORMAT_EDEFAULT == null ? dateFormat != null : !DATE_FORMAT_EDEFAULT.equals(dateFormat);
}
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(" (dateFormat: ");
result.append(dateFormat);
result.append(')');
return result.toString();
}
} //CxGridPropDateStyleImpl