blob: fc56345d0d1c3f7bf9f8f86587f121cf0befc697 [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.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.xtext.reportdsl.PageDetail;
import org.eclipse.osbp.xtext.reportdsl.PageFooter;
import org.eclipse.osbp.xtext.reportdsl.PageHeader;
import org.eclipse.osbp.xtext.reportdsl.ReportDSLPackage;
import org.eclipse.osbp.xtext.reportdsl.ReportDesignTemplate;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Report Design Template</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.osbp.xtext.reportdsl.impl.ReportDesignTemplateImpl#getDescription <em>Description</em>}</li>
* <li>{@link org.eclipse.osbp.xtext.reportdsl.impl.ReportDesignTemplateImpl#getHeader <em>Header</em>}</li>
* <li>{@link org.eclipse.osbp.xtext.reportdsl.impl.ReportDesignTemplateImpl#getDetail <em>Detail</em>}</li>
* <li>{@link org.eclipse.osbp.xtext.reportdsl.impl.ReportDesignTemplateImpl#getFooter <em>Footer</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class ReportDesignTemplateImpl extends ReportLazyResolverImpl implements ReportDesignTemplate {
/**
* The default value of the '{@link #getDescription() <em>Description</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDescription()
* @generated
* @ordered
*/
protected static final String DESCRIPTION_EDEFAULT = null;
/**
* The cached value of the '{@link #getDescription() <em>Description</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDescription()
* @generated
* @ordered
*/
protected String description = DESCRIPTION_EDEFAULT;
/**
* The cached value of the '{@link #getHeader() <em>Header</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getHeader()
* @generated
* @ordered
*/
protected PageHeader header;
/**
* The cached value of the '{@link #getDetail() <em>Detail</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDetail()
* @generated
* @ordered
*/
protected PageDetail detail;
/**
* The cached value of the '{@link #getFooter() <em>Footer</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getFooter()
* @generated
* @ordered
*/
protected PageFooter footer;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ReportDesignTemplateImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ReportDSLPackage.Literals.REPORT_DESIGN_TEMPLATE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getDescription() {
return description;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDescription(String newDescription) {
String oldDescription = description;
description = newDescription;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ReportDSLPackage.REPORT_DESIGN_TEMPLATE__DESCRIPTION, oldDescription, description));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public PageHeader getHeader() {
return header;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetHeader(PageHeader newHeader, NotificationChain msgs) {
PageHeader oldHeader = header;
header = newHeader;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ReportDSLPackage.REPORT_DESIGN_TEMPLATE__HEADER, oldHeader, newHeader);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setHeader(PageHeader newHeader) {
if (newHeader != header) {
NotificationChain msgs = null;
if (header != null)
msgs = ((InternalEObject)header).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ReportDSLPackage.REPORT_DESIGN_TEMPLATE__HEADER, null, msgs);
if (newHeader != null)
msgs = ((InternalEObject)newHeader).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ReportDSLPackage.REPORT_DESIGN_TEMPLATE__HEADER, null, msgs);
msgs = basicSetHeader(newHeader, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ReportDSLPackage.REPORT_DESIGN_TEMPLATE__HEADER, newHeader, newHeader));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public PageDetail getDetail() {
return detail;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetDetail(PageDetail newDetail, NotificationChain msgs) {
PageDetail oldDetail = detail;
detail = newDetail;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ReportDSLPackage.REPORT_DESIGN_TEMPLATE__DETAIL, oldDetail, newDetail);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDetail(PageDetail newDetail) {
if (newDetail != detail) {
NotificationChain msgs = null;
if (detail != null)
msgs = ((InternalEObject)detail).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ReportDSLPackage.REPORT_DESIGN_TEMPLATE__DETAIL, null, msgs);
if (newDetail != null)
msgs = ((InternalEObject)newDetail).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ReportDSLPackage.REPORT_DESIGN_TEMPLATE__DETAIL, null, msgs);
msgs = basicSetDetail(newDetail, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ReportDSLPackage.REPORT_DESIGN_TEMPLATE__DETAIL, newDetail, newDetail));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public PageFooter getFooter() {
return footer;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetFooter(PageFooter newFooter, NotificationChain msgs) {
PageFooter oldFooter = footer;
footer = newFooter;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ReportDSLPackage.REPORT_DESIGN_TEMPLATE__FOOTER, oldFooter, newFooter);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setFooter(PageFooter newFooter) {
if (newFooter != footer) {
NotificationChain msgs = null;
if (footer != null)
msgs = ((InternalEObject)footer).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ReportDSLPackage.REPORT_DESIGN_TEMPLATE__FOOTER, null, msgs);
if (newFooter != null)
msgs = ((InternalEObject)newFooter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ReportDSLPackage.REPORT_DESIGN_TEMPLATE__FOOTER, null, msgs);
msgs = basicSetFooter(newFooter, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ReportDSLPackage.REPORT_DESIGN_TEMPLATE__FOOTER, newFooter, newFooter));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case ReportDSLPackage.REPORT_DESIGN_TEMPLATE__HEADER:
return basicSetHeader(null, msgs);
case ReportDSLPackage.REPORT_DESIGN_TEMPLATE__DETAIL:
return basicSetDetail(null, msgs);
case ReportDSLPackage.REPORT_DESIGN_TEMPLATE__FOOTER:
return basicSetFooter(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 ReportDSLPackage.REPORT_DESIGN_TEMPLATE__DESCRIPTION:
return getDescription();
case ReportDSLPackage.REPORT_DESIGN_TEMPLATE__HEADER:
return getHeader();
case ReportDSLPackage.REPORT_DESIGN_TEMPLATE__DETAIL:
return getDetail();
case ReportDSLPackage.REPORT_DESIGN_TEMPLATE__FOOTER:
return getFooter();
}
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.REPORT_DESIGN_TEMPLATE__DESCRIPTION:
setDescription((String)newValue);
return;
case ReportDSLPackage.REPORT_DESIGN_TEMPLATE__HEADER:
setHeader((PageHeader)newValue);
return;
case ReportDSLPackage.REPORT_DESIGN_TEMPLATE__DETAIL:
setDetail((PageDetail)newValue);
return;
case ReportDSLPackage.REPORT_DESIGN_TEMPLATE__FOOTER:
setFooter((PageFooter)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ReportDSLPackage.REPORT_DESIGN_TEMPLATE__DESCRIPTION:
setDescription(DESCRIPTION_EDEFAULT);
return;
case ReportDSLPackage.REPORT_DESIGN_TEMPLATE__HEADER:
setHeader((PageHeader)null);
return;
case ReportDSLPackage.REPORT_DESIGN_TEMPLATE__DETAIL:
setDetail((PageDetail)null);
return;
case ReportDSLPackage.REPORT_DESIGN_TEMPLATE__FOOTER:
setFooter((PageFooter)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ReportDSLPackage.REPORT_DESIGN_TEMPLATE__DESCRIPTION:
return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description);
case ReportDSLPackage.REPORT_DESIGN_TEMPLATE__HEADER:
return header != null;
case ReportDSLPackage.REPORT_DESIGN_TEMPLATE__DETAIL:
return detail != null;
case ReportDSLPackage.REPORT_DESIGN_TEMPLATE__FOOTER:
return footer != null;
}
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(" (description: ");
result.append(description);
result.append(')');
return result.toString();
}
} //ReportDesignTemplateImpl