| /** |
| * 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 |
| * |
| * Based on ideas from Xtext, Xtend, Xcore |
| * |
| * Contributors: |
| * Joerg Riegel - Initial implementation |
| * |
| */ |
| package org.eclipse.osbp.xtext.table.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.table.TableDSLPackage; |
| import org.eclipse.osbp.xtext.table.TablePreorder; |
| import org.eclipse.osbp.xtext.table.TableValueElement; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Table Preorder</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.xtext.table.impl.TablePreorderImpl#getColumn <em>Column</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.table.impl.TablePreorderImpl#isAscending <em>Ascending</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class TablePreorderImpl extends TableLazyResolverImpl implements TablePreorder { |
| /** |
| * The cached value of the '{@link #getColumn() <em>Column</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getColumn() |
| * @generated |
| * @ordered |
| */ |
| protected TableValueElement column; |
| |
| /** |
| * The default value of the '{@link #isAscending() <em>Ascending</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isAscending() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean ASCENDING_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isAscending() <em>Ascending</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isAscending() |
| * @generated |
| * @ordered |
| */ |
| protected boolean ascending = ASCENDING_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected TablePreorderImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return TableDSLPackage.Literals.TABLE_PREORDER; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public TableValueElement getColumn() { |
| return column; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetColumn(TableValueElement newColumn, NotificationChain msgs) { |
| TableValueElement oldColumn = column; |
| column = newColumn; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, TableDSLPackage.TABLE_PREORDER__COLUMN, oldColumn, newColumn); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setColumn(TableValueElement newColumn) { |
| if (newColumn != column) { |
| NotificationChain msgs = null; |
| if (column != null) |
| msgs = ((InternalEObject)column).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - TableDSLPackage.TABLE_PREORDER__COLUMN, null, msgs); |
| if (newColumn != null) |
| msgs = ((InternalEObject)newColumn).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - TableDSLPackage.TABLE_PREORDER__COLUMN, null, msgs); |
| msgs = basicSetColumn(newColumn, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, TableDSLPackage.TABLE_PREORDER__COLUMN, newColumn, newColumn)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean isAscending() { |
| return ascending; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setAscending(boolean newAscending) { |
| boolean oldAscending = ascending; |
| ascending = newAscending; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, TableDSLPackage.TABLE_PREORDER__ASCENDING, oldAscending, ascending)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case TableDSLPackage.TABLE_PREORDER__COLUMN: |
| return basicSetColumn(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 TableDSLPackage.TABLE_PREORDER__COLUMN: |
| return getColumn(); |
| case TableDSLPackage.TABLE_PREORDER__ASCENDING: |
| return isAscending(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case TableDSLPackage.TABLE_PREORDER__COLUMN: |
| setColumn((TableValueElement)newValue); |
| return; |
| case TableDSLPackage.TABLE_PREORDER__ASCENDING: |
| setAscending((Boolean)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case TableDSLPackage.TABLE_PREORDER__COLUMN: |
| setColumn((TableValueElement)null); |
| return; |
| case TableDSLPackage.TABLE_PREORDER__ASCENDING: |
| setAscending(ASCENDING_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case TableDSLPackage.TABLE_PREORDER__COLUMN: |
| return column != null; |
| case TableDSLPackage.TABLE_PREORDER__ASCENDING: |
| return ascending != ASCENDING_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(" (ascending: "); |
| result.append(ascending); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //TablePreorderImpl |