| /** |
| * 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 java.util.Collection; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.common.notify.NotificationChain; |
| |
| import org.eclipse.emf.common.util.EList; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.eclipse.emf.ecore.util.EObjectContainmentEList; |
| import org.eclipse.emf.ecore.util.InternalEList; |
| |
| import org.eclipse.osbp.xtext.reportdsl.DatamartTableFooter; |
| import org.eclipse.osbp.xtext.reportdsl.GridRow; |
| import org.eclipse.osbp.xtext.reportdsl.PageBreak; |
| import org.eclipse.osbp.xtext.reportdsl.ReportDSLPackage; |
| import org.eclipse.osbp.xtext.reportdsl.SomeGrid; |
| import org.eclipse.osbp.xtext.reportdsl.Style; |
| import org.eclipse.osbp.xtext.reportdsl.WithStyle; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Datamart Table Footer</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.xtext.reportdsl.impl.DatamartTableFooterImpl#getRows <em>Rows</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.reportdsl.impl.DatamartTableFooterImpl#getStyle <em>Style</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.reportdsl.impl.DatamartTableFooterImpl#getPageBreak <em>Page Break</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class DatamartTableFooterImpl extends ReportLazyResolverImpl implements DatamartTableFooter { |
| /** |
| * The cached value of the '{@link #getRows() <em>Rows</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getRows() |
| * @generated |
| * @ordered |
| */ |
| protected EList<GridRow> rows; |
| |
| /** |
| * The cached value of the '{@link #getStyle() <em>Style</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getStyle() |
| * @generated |
| * @ordered |
| */ |
| protected Style style; |
| |
| /** |
| * The cached value of the '{@link #getPageBreak() <em>Page Break</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getPageBreak() |
| * @generated |
| * @ordered |
| */ |
| protected PageBreak pageBreak; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected DatamartTableFooterImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return ReportDSLPackage.Literals.DATAMART_TABLE_FOOTER; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<GridRow> getRows() { |
| if (rows == null) { |
| rows = new EObjectContainmentEList<GridRow>(GridRow.class, this, ReportDSLPackage.DATAMART_TABLE_FOOTER__ROWS); |
| } |
| return rows; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Style getStyle() { |
| if (style != null && style.eIsProxy()) { |
| InternalEObject oldStyle = (InternalEObject)style; |
| style = (Style)eResolveProxy(oldStyle); |
| if (style != oldStyle) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, ReportDSLPackage.DATAMART_TABLE_FOOTER__STYLE, oldStyle, style)); |
| } |
| } |
| return style; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Style basicGetStyle() { |
| return style; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setStyle(Style newStyle) { |
| Style oldStyle = style; |
| style = newStyle; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ReportDSLPackage.DATAMART_TABLE_FOOTER__STYLE, oldStyle, style)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public PageBreak getPageBreak() { |
| return pageBreak; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetPageBreak(PageBreak newPageBreak, NotificationChain msgs) { |
| PageBreak oldPageBreak = pageBreak; |
| pageBreak = newPageBreak; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ReportDSLPackage.DATAMART_TABLE_FOOTER__PAGE_BREAK, oldPageBreak, newPageBreak); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setPageBreak(PageBreak newPageBreak) { |
| if (newPageBreak != pageBreak) { |
| NotificationChain msgs = null; |
| if (pageBreak != null) |
| msgs = ((InternalEObject)pageBreak).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ReportDSLPackage.DATAMART_TABLE_FOOTER__PAGE_BREAK, null, msgs); |
| if (newPageBreak != null) |
| msgs = ((InternalEObject)newPageBreak).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ReportDSLPackage.DATAMART_TABLE_FOOTER__PAGE_BREAK, null, msgs); |
| msgs = basicSetPageBreak(newPageBreak, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ReportDSLPackage.DATAMART_TABLE_FOOTER__PAGE_BREAK, newPageBreak, newPageBreak)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case ReportDSLPackage.DATAMART_TABLE_FOOTER__ROWS: |
| return ((InternalEList<?>)getRows()).basicRemove(otherEnd, msgs); |
| case ReportDSLPackage.DATAMART_TABLE_FOOTER__PAGE_BREAK: |
| return basicSetPageBreak(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.DATAMART_TABLE_FOOTER__ROWS: |
| return getRows(); |
| case ReportDSLPackage.DATAMART_TABLE_FOOTER__STYLE: |
| if (resolve) return getStyle(); |
| return basicGetStyle(); |
| case ReportDSLPackage.DATAMART_TABLE_FOOTER__PAGE_BREAK: |
| return getPageBreak(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @SuppressWarnings("unchecked") |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case ReportDSLPackage.DATAMART_TABLE_FOOTER__ROWS: |
| getRows().clear(); |
| getRows().addAll((Collection<? extends GridRow>)newValue); |
| return; |
| case ReportDSLPackage.DATAMART_TABLE_FOOTER__STYLE: |
| setStyle((Style)newValue); |
| return; |
| case ReportDSLPackage.DATAMART_TABLE_FOOTER__PAGE_BREAK: |
| setPageBreak((PageBreak)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case ReportDSLPackage.DATAMART_TABLE_FOOTER__ROWS: |
| getRows().clear(); |
| return; |
| case ReportDSLPackage.DATAMART_TABLE_FOOTER__STYLE: |
| setStyle((Style)null); |
| return; |
| case ReportDSLPackage.DATAMART_TABLE_FOOTER__PAGE_BREAK: |
| setPageBreak((PageBreak)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case ReportDSLPackage.DATAMART_TABLE_FOOTER__ROWS: |
| return rows != null && !rows.isEmpty(); |
| case ReportDSLPackage.DATAMART_TABLE_FOOTER__STYLE: |
| return style != null; |
| case ReportDSLPackage.DATAMART_TABLE_FOOTER__PAGE_BREAK: |
| return pageBreak != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) { |
| if (baseClass == SomeGrid.class) { |
| switch (derivedFeatureID) { |
| case ReportDSLPackage.DATAMART_TABLE_FOOTER__ROWS: return ReportDSLPackage.SOME_GRID__ROWS; |
| default: return -1; |
| } |
| } |
| if (baseClass == WithStyle.class) { |
| switch (derivedFeatureID) { |
| case ReportDSLPackage.DATAMART_TABLE_FOOTER__STYLE: return ReportDSLPackage.WITH_STYLE__STYLE; |
| default: return -1; |
| } |
| } |
| return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) { |
| if (baseClass == SomeGrid.class) { |
| switch (baseFeatureID) { |
| case ReportDSLPackage.SOME_GRID__ROWS: return ReportDSLPackage.DATAMART_TABLE_FOOTER__ROWS; |
| default: return -1; |
| } |
| } |
| if (baseClass == WithStyle.class) { |
| switch (baseFeatureID) { |
| case ReportDSLPackage.WITH_STYLE__STYLE: return ReportDSLPackage.DATAMART_TABLE_FOOTER__STYLE; |
| default: return -1; |
| } |
| } |
| return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); |
| } |
| |
| } //DatamartTableFooterImpl |