blob: 5b876cfd4c06a1f48e8d9c4afd182eda84e5146c [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
*
* Based on ideas from Xtext, Xtend, Xcore
*
* Contributors:
* Christophe Loetz (Loetz GmbH&Co.KG) - Initial implementation
*
*/
package org.eclipse.osbp.xtext.reportdsl.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.xtext.reportdsl.PageFooter;
import org.eclipse.osbp.xtext.reportdsl.ReportDSLPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Page Footer</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.osbp.xtext.reportdsl.impl.PageFooterImpl#isShowOnLast <em>Show On Last</em>}</li>
* <li>{@link org.eclipse.osbp.xtext.reportdsl.impl.PageFooterImpl#getHeightValue <em>Height Value</em>}</li>
* </ul>
*
* @generated
*/
public class PageFooterImpl extends ContainerImpl implements PageFooter {
/**
* The default value of the '{@link #isShowOnLast() <em>Show On Last</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isShowOnLast()
* @generated
* @ordered
*/
protected static final boolean SHOW_ON_LAST_EDEFAULT = false;
/**
* The cached value of the '{@link #isShowOnLast() <em>Show On Last</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isShowOnLast()
* @generated
* @ordered
*/
protected boolean showOnLast = SHOW_ON_LAST_EDEFAULT;
/**
* The default value of the '{@link #getHeightValue() <em>Height Value</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getHeightValue()
* @generated
* @ordered
*/
protected static final double HEIGHT_VALUE_EDEFAULT = 0.0;
/**
* The cached value of the '{@link #getHeightValue() <em>Height Value</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getHeightValue()
* @generated
* @ordered
*/
protected double heightValue = HEIGHT_VALUE_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected PageFooterImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ReportDSLPackage.Literals.PAGE_FOOTER;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isShowOnLast() {
return showOnLast;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setShowOnLast(boolean newShowOnLast) {
boolean oldShowOnLast = showOnLast;
showOnLast = newShowOnLast;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ReportDSLPackage.PAGE_FOOTER__SHOW_ON_LAST, oldShowOnLast, showOnLast));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public double getHeightValue() {
return heightValue;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setHeightValue(double newHeightValue) {
double oldHeightValue = heightValue;
heightValue = newHeightValue;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ReportDSLPackage.PAGE_FOOTER__HEIGHT_VALUE, oldHeightValue, heightValue));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ReportDSLPackage.PAGE_FOOTER__SHOW_ON_LAST:
return isShowOnLast();
case ReportDSLPackage.PAGE_FOOTER__HEIGHT_VALUE:
return getHeightValue();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ReportDSLPackage.PAGE_FOOTER__SHOW_ON_LAST:
setShowOnLast((Boolean)newValue);
return;
case ReportDSLPackage.PAGE_FOOTER__HEIGHT_VALUE:
setHeightValue((Double)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ReportDSLPackage.PAGE_FOOTER__SHOW_ON_LAST:
setShowOnLast(SHOW_ON_LAST_EDEFAULT);
return;
case ReportDSLPackage.PAGE_FOOTER__HEIGHT_VALUE:
setHeightValue(HEIGHT_VALUE_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ReportDSLPackage.PAGE_FOOTER__SHOW_ON_LAST:
return showOnLast != SHOW_ON_LAST_EDEFAULT;
case ReportDSLPackage.PAGE_FOOTER__HEIGHT_VALUE:
return heightValue != HEIGHT_VALUE_EDEFAULT;
}
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(" (showOnLast: ");
result.append(showOnLast);
result.append(", heightValue: ");
result.append(heightValue);
result.append(')');
return result.toString();
}
} //PageFooterImpl