blob: e0d5bf7c3f1d3777f5de84b4d3eae30c16f3a2a6 [file] [log] [blame]
/*******************************************************************************
* 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 v1.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.impl.CommandImpl;
import org.eclipse.rcptt.ecl.data.apache.poi.commands.CommandsPackage;
import org.eclipse.rcptt.ecl.data.apache.poi.commands.GetTableRange;
import org.eclipse.rcptt.ecl.data.objects.Table;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Get Table Range</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.rcptt.ecl.data.apache.poi.commands.impl.GetTableRangeImpl#getTable <em>Table</em>}</li>
* <li>{@link org.eclipse.rcptt.ecl.data.apache.poi.commands.impl.GetTableRangeImpl#getRange <em>Range</em>}</li>
* </ul>
*
* @generated
*/
public class GetTableRangeImpl extends CommandImpl implements GetTableRange {
/**
* 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 default value of the '{@link #getRange() <em>Range</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getRange()
* @generated
* @ordered
*/
protected static final String RANGE_EDEFAULT = null;
/**
* The cached value of the '{@link #getRange() <em>Range</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getRange()
* @generated
* @ordered
*/
protected String range = RANGE_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected GetTableRangeImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return CommandsPackage.Literals.GET_TABLE_RANGE;
}
/**
* <!-- 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.GET_TABLE_RANGE__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.GET_TABLE_RANGE__TABLE, oldTable, table));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getRange() {
return range;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setRange(String newRange) {
String oldRange = range;
range = newRange;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CommandsPackage.GET_TABLE_RANGE__RANGE, oldRange, range));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case CommandsPackage.GET_TABLE_RANGE__TABLE:
if (resolve) return getTable();
return basicGetTable();
case CommandsPackage.GET_TABLE_RANGE__RANGE:
return getRange();
}
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.GET_TABLE_RANGE__TABLE:
setTable((Table)newValue);
return;
case CommandsPackage.GET_TABLE_RANGE__RANGE:
setRange((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case CommandsPackage.GET_TABLE_RANGE__TABLE:
setTable((Table)null);
return;
case CommandsPackage.GET_TABLE_RANGE__RANGE:
setRange(RANGE_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case CommandsPackage.GET_TABLE_RANGE__TABLE:
return table != null;
case CommandsPackage.GET_TABLE_RANGE__RANGE:
return RANGE_EDEFAULT == null ? range != null : !RANGE_EDEFAULT.equals(range);
}
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(" (range: ");
result.append(range);
result.append(')');
return result.toString();
}
} //GetTableRangeImpl