| /******************************************************************************* |
| * Copyright (c) 2009, 2019 Xored Software Inc and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-v20.html |
| * |
| * Contributors: |
| * Xored Software Inc - initial API and implementation and/or initial documentation |
| *******************************************************************************/ |
| package org.eclipse.rcptt.ecl.data.apache.poi.commands.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.rcptt.ecl.core.EclMap; |
| import org.eclipse.rcptt.ecl.core.impl.CommandImpl; |
| import org.eclipse.rcptt.ecl.data.apache.poi.commands.CommandsPackage; |
| import org.eclipse.rcptt.ecl.data.apache.poi.commands.SetTableCells; |
| import org.eclipse.rcptt.ecl.data.objects.Table; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Set Table Cells</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.rcptt.ecl.data.apache.poi.commands.impl.SetTableCellsImpl#getTable <em>Table</em>}</li> |
| * <li>{@link org.eclipse.rcptt.ecl.data.apache.poi.commands.impl.SetTableCellsImpl#getCells <em>Cells</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class SetTableCellsImpl extends CommandImpl implements SetTableCells { |
| /** |
| * The cached value of the '{@link #getTable() <em>Table</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getTable() |
| * @generated |
| * @ordered |
| */ |
| protected Table table; |
| |
| /** |
| * The cached value of the '{@link #getCells() <em>Cells</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getCells() |
| * @generated |
| * @ordered |
| */ |
| protected EclMap cells; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected SetTableCellsImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return CommandsPackage.Literals.SET_TABLE_CELLS; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Table getTable() { |
| if (table != null && table.eIsProxy()) { |
| InternalEObject oldTable = (InternalEObject)table; |
| table = (Table)eResolveProxy(oldTable); |
| if (table != oldTable) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, CommandsPackage.SET_TABLE_CELLS__TABLE, oldTable, table)); |
| } |
| } |
| return table; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Table basicGetTable() { |
| return table; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setTable(Table newTable) { |
| Table oldTable = table; |
| table = newTable; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, CommandsPackage.SET_TABLE_CELLS__TABLE, oldTable, table)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EclMap getCells() { |
| if (cells != null && cells.eIsProxy()) { |
| InternalEObject oldCells = (InternalEObject)cells; |
| cells = (EclMap)eResolveProxy(oldCells); |
| if (cells != oldCells) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, CommandsPackage.SET_TABLE_CELLS__CELLS, oldCells, cells)); |
| } |
| } |
| return cells; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EclMap basicGetCells() { |
| return cells; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setCells(EclMap newCells) { |
| EclMap oldCells = cells; |
| cells = newCells; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, CommandsPackage.SET_TABLE_CELLS__CELLS, oldCells, cells)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case CommandsPackage.SET_TABLE_CELLS__TABLE: |
| if (resolve) return getTable(); |
| return basicGetTable(); |
| case CommandsPackage.SET_TABLE_CELLS__CELLS: |
| if (resolve) return getCells(); |
| return basicGetCells(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case CommandsPackage.SET_TABLE_CELLS__TABLE: |
| setTable((Table)newValue); |
| return; |
| case CommandsPackage.SET_TABLE_CELLS__CELLS: |
| setCells((EclMap)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case CommandsPackage.SET_TABLE_CELLS__TABLE: |
| setTable((Table)null); |
| return; |
| case CommandsPackage.SET_TABLE_CELLS__CELLS: |
| setCells((EclMap)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case CommandsPackage.SET_TABLE_CELLS__TABLE: |
| return table != null; |
| case CommandsPackage.SET_TABLE_CELLS__CELLS: |
| return cells != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //SetTableCellsImpl |