| /** |
| * 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.datamartdsl.DatamartAttribute; |
| |
| import org.eclipse.osbp.xtext.reportdsl.DatamartTableFooter; |
| import org.eclipse.osbp.xtext.reportdsl.DatamartTableGroup; |
| import org.eclipse.osbp.xtext.reportdsl.DatamartTableHeader; |
| import org.eclipse.osbp.xtext.reportdsl.PageBreak; |
| import org.eclipse.osbp.xtext.reportdsl.ReportDSLPackage; |
| import org.eclipse.osbp.xtext.reportdsl.Visibility; |
| import org.eclipse.osbp.xtext.reportdsl.WithHeaderFooter; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Datamart Table Group</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.xtext.reportdsl.impl.DatamartTableGroupImpl#getHeader <em>Header</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.reportdsl.impl.DatamartTableGroupImpl#getFooter <em>Footer</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.reportdsl.impl.DatamartTableGroupImpl#getVisibilityItem <em>Visibility Item</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.reportdsl.impl.DatamartTableGroupImpl#getPageBreak <em>Page Break</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.reportdsl.impl.DatamartTableGroupImpl#getGroupingRef <em>Grouping Ref</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class DatamartTableGroupImpl extends ReportBaseImpl implements DatamartTableGroup { |
| /** |
| * The cached value of the '{@link #getHeader() <em>Header</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getHeader() |
| * @generated |
| * @ordered |
| */ |
| protected DatamartTableHeader header; |
| |
| /** |
| * The cached value of the '{@link #getFooter() <em>Footer</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getFooter() |
| * @generated |
| * @ordered |
| */ |
| protected DatamartTableFooter footer; |
| |
| /** |
| * The cached value of the '{@link #getVisibilityItem() <em>Visibility Item</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getVisibilityItem() |
| * @generated |
| * @ordered |
| */ |
| protected Visibility visibilityItem; |
| |
| /** |
| * 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; |
| |
| /** |
| * The cached value of the '{@link #getGroupingRef() <em>Grouping Ref</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getGroupingRef() |
| * @generated |
| * @ordered |
| */ |
| protected DatamartAttribute groupingRef; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected DatamartTableGroupImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return ReportDSLPackage.Literals.DATAMART_TABLE_GROUP; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public DatamartTableHeader getHeader() { |
| return header; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetHeader(DatamartTableHeader newHeader, NotificationChain msgs) { |
| DatamartTableHeader oldHeader = header; |
| header = newHeader; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ReportDSLPackage.DATAMART_TABLE_GROUP__HEADER, oldHeader, newHeader); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setHeader(DatamartTableHeader newHeader) { |
| if (newHeader != header) { |
| NotificationChain msgs = null; |
| if (header != null) |
| msgs = ((InternalEObject)header).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ReportDSLPackage.DATAMART_TABLE_GROUP__HEADER, null, msgs); |
| if (newHeader != null) |
| msgs = ((InternalEObject)newHeader).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ReportDSLPackage.DATAMART_TABLE_GROUP__HEADER, null, msgs); |
| msgs = basicSetHeader(newHeader, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ReportDSLPackage.DATAMART_TABLE_GROUP__HEADER, newHeader, newHeader)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public DatamartTableFooter getFooter() { |
| return footer; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetFooter(DatamartTableFooter newFooter, NotificationChain msgs) { |
| DatamartTableFooter oldFooter = footer; |
| footer = newFooter; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ReportDSLPackage.DATAMART_TABLE_GROUP__FOOTER, oldFooter, newFooter); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setFooter(DatamartTableFooter newFooter) { |
| if (newFooter != footer) { |
| NotificationChain msgs = null; |
| if (footer != null) |
| msgs = ((InternalEObject)footer).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ReportDSLPackage.DATAMART_TABLE_GROUP__FOOTER, null, msgs); |
| if (newFooter != null) |
| msgs = ((InternalEObject)newFooter).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ReportDSLPackage.DATAMART_TABLE_GROUP__FOOTER, null, msgs); |
| msgs = basicSetFooter(newFooter, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ReportDSLPackage.DATAMART_TABLE_GROUP__FOOTER, newFooter, newFooter)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Visibility getVisibilityItem() { |
| return visibilityItem; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetVisibilityItem(Visibility newVisibilityItem, NotificationChain msgs) { |
| Visibility oldVisibilityItem = visibilityItem; |
| visibilityItem = newVisibilityItem; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ReportDSLPackage.DATAMART_TABLE_GROUP__VISIBILITY_ITEM, oldVisibilityItem, newVisibilityItem); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setVisibilityItem(Visibility newVisibilityItem) { |
| if (newVisibilityItem != visibilityItem) { |
| NotificationChain msgs = null; |
| if (visibilityItem != null) |
| msgs = ((InternalEObject)visibilityItem).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ReportDSLPackage.DATAMART_TABLE_GROUP__VISIBILITY_ITEM, null, msgs); |
| if (newVisibilityItem != null) |
| msgs = ((InternalEObject)newVisibilityItem).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ReportDSLPackage.DATAMART_TABLE_GROUP__VISIBILITY_ITEM, null, msgs); |
| msgs = basicSetVisibilityItem(newVisibilityItem, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ReportDSLPackage.DATAMART_TABLE_GROUP__VISIBILITY_ITEM, newVisibilityItem, newVisibilityItem)); |
| } |
| |
| /** |
| * <!-- 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_GROUP__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_GROUP__PAGE_BREAK, null, msgs); |
| if (newPageBreak != null) |
| msgs = ((InternalEObject)newPageBreak).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ReportDSLPackage.DATAMART_TABLE_GROUP__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_GROUP__PAGE_BREAK, newPageBreak, newPageBreak)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public DatamartAttribute getGroupingRef() { |
| if (groupingRef != null && groupingRef.eIsProxy()) { |
| InternalEObject oldGroupingRef = (InternalEObject)groupingRef; |
| groupingRef = (DatamartAttribute)eResolveProxy(oldGroupingRef); |
| if (groupingRef != oldGroupingRef) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, ReportDSLPackage.DATAMART_TABLE_GROUP__GROUPING_REF, oldGroupingRef, groupingRef)); |
| } |
| } |
| return groupingRef; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public DatamartAttribute basicGetGroupingRef() { |
| return groupingRef; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setGroupingRef(DatamartAttribute newGroupingRef) { |
| DatamartAttribute oldGroupingRef = groupingRef; |
| groupingRef = newGroupingRef; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ReportDSLPackage.DATAMART_TABLE_GROUP__GROUPING_REF, oldGroupingRef, groupingRef)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case ReportDSLPackage.DATAMART_TABLE_GROUP__HEADER: |
| return basicSetHeader(null, msgs); |
| case ReportDSLPackage.DATAMART_TABLE_GROUP__FOOTER: |
| return basicSetFooter(null, msgs); |
| case ReportDSLPackage.DATAMART_TABLE_GROUP__VISIBILITY_ITEM: |
| return basicSetVisibilityItem(null, msgs); |
| case ReportDSLPackage.DATAMART_TABLE_GROUP__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_GROUP__HEADER: |
| return getHeader(); |
| case ReportDSLPackage.DATAMART_TABLE_GROUP__FOOTER: |
| return getFooter(); |
| case ReportDSLPackage.DATAMART_TABLE_GROUP__VISIBILITY_ITEM: |
| return getVisibilityItem(); |
| case ReportDSLPackage.DATAMART_TABLE_GROUP__PAGE_BREAK: |
| return getPageBreak(); |
| case ReportDSLPackage.DATAMART_TABLE_GROUP__GROUPING_REF: |
| if (resolve) return getGroupingRef(); |
| return basicGetGroupingRef(); |
| } |
| 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.DATAMART_TABLE_GROUP__HEADER: |
| setHeader((DatamartTableHeader)newValue); |
| return; |
| case ReportDSLPackage.DATAMART_TABLE_GROUP__FOOTER: |
| setFooter((DatamartTableFooter)newValue); |
| return; |
| case ReportDSLPackage.DATAMART_TABLE_GROUP__VISIBILITY_ITEM: |
| setVisibilityItem((Visibility)newValue); |
| return; |
| case ReportDSLPackage.DATAMART_TABLE_GROUP__PAGE_BREAK: |
| setPageBreak((PageBreak)newValue); |
| return; |
| case ReportDSLPackage.DATAMART_TABLE_GROUP__GROUPING_REF: |
| setGroupingRef((DatamartAttribute)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_GROUP__HEADER: |
| setHeader((DatamartTableHeader)null); |
| return; |
| case ReportDSLPackage.DATAMART_TABLE_GROUP__FOOTER: |
| setFooter((DatamartTableFooter)null); |
| return; |
| case ReportDSLPackage.DATAMART_TABLE_GROUP__VISIBILITY_ITEM: |
| setVisibilityItem((Visibility)null); |
| return; |
| case ReportDSLPackage.DATAMART_TABLE_GROUP__PAGE_BREAK: |
| setPageBreak((PageBreak)null); |
| return; |
| case ReportDSLPackage.DATAMART_TABLE_GROUP__GROUPING_REF: |
| setGroupingRef((DatamartAttribute)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case ReportDSLPackage.DATAMART_TABLE_GROUP__HEADER: |
| return header != null; |
| case ReportDSLPackage.DATAMART_TABLE_GROUP__FOOTER: |
| return footer != null; |
| case ReportDSLPackage.DATAMART_TABLE_GROUP__VISIBILITY_ITEM: |
| return visibilityItem != null; |
| case ReportDSLPackage.DATAMART_TABLE_GROUP__PAGE_BREAK: |
| return pageBreak != null; |
| case ReportDSLPackage.DATAMART_TABLE_GROUP__GROUPING_REF: |
| return groupingRef != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) { |
| if (baseClass == WithHeaderFooter.class) { |
| switch (derivedFeatureID) { |
| case ReportDSLPackage.DATAMART_TABLE_GROUP__HEADER: return ReportDSLPackage.WITH_HEADER_FOOTER__HEADER; |
| case ReportDSLPackage.DATAMART_TABLE_GROUP__FOOTER: return ReportDSLPackage.WITH_HEADER_FOOTER__FOOTER; |
| case ReportDSLPackage.DATAMART_TABLE_GROUP__VISIBILITY_ITEM: return ReportDSLPackage.WITH_HEADER_FOOTER__VISIBILITY_ITEM; |
| case ReportDSLPackage.DATAMART_TABLE_GROUP__PAGE_BREAK: return ReportDSLPackage.WITH_HEADER_FOOTER__PAGE_BREAK; |
| 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 == WithHeaderFooter.class) { |
| switch (baseFeatureID) { |
| case ReportDSLPackage.WITH_HEADER_FOOTER__HEADER: return ReportDSLPackage.DATAMART_TABLE_GROUP__HEADER; |
| case ReportDSLPackage.WITH_HEADER_FOOTER__FOOTER: return ReportDSLPackage.DATAMART_TABLE_GROUP__FOOTER; |
| case ReportDSLPackage.WITH_HEADER_FOOTER__VISIBILITY_ITEM: return ReportDSLPackage.DATAMART_TABLE_GROUP__VISIBILITY_ITEM; |
| case ReportDSLPackage.WITH_HEADER_FOOTER__PAGE_BREAK: return ReportDSLPackage.DATAMART_TABLE_GROUP__PAGE_BREAK; |
| default: return -1; |
| } |
| } |
| return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); |
| } |
| |
| } //DatamartTableGroupImpl |