| /******************************************************************************* |
| * Copyright (c) 2009, 2015 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 |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * Xored Software Inc - initial API and implementation and/or initial documentation |
| *******************************************************************************/ |
| package org.eclipse.rcptt.tesla.ecl.model.impl; |
| |
| import org.eclipse.rcptt.tesla.ecl.model.ActivateCellEdit; |
| import org.eclipse.rcptt.tesla.ecl.model.ActivationEventType; |
| import org.eclipse.rcptt.tesla.ecl.model.TeslaPackage; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Activate Cell Edit</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.rcptt.tesla.ecl.model.impl.ActivateCellEditImpl#getColumn <em>Column</em>}</li> |
| * <li>{@link org.eclipse.rcptt.tesla.ecl.model.impl.ActivateCellEditImpl#getType <em>Type</em>}</li> |
| * <li>{@link org.eclipse.rcptt.tesla.ecl.model.impl.ActivateCellEditImpl#getButton <em>Button</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class ActivateCellEditImpl extends CellEditImpl implements ActivateCellEdit { |
| /** |
| * The default value of the '{@link #getColumn() <em>Column</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getColumn() |
| * @generated |
| * @ordered |
| */ |
| protected static final int COLUMN_EDEFAULT = 0; |
| /** |
| * The cached value of the '{@link #getColumn() <em>Column</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getColumn() |
| * @generated |
| * @ordered |
| */ |
| protected int column = COLUMN_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getType() <em>Type</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getType() |
| * @generated |
| * @ordered |
| */ |
| protected static final ActivationEventType TYPE_EDEFAULT = ActivationEventType.PROGRAMMATIC; |
| /** |
| * The cached value of the '{@link #getType() <em>Type</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getType() |
| * @generated |
| * @ordered |
| */ |
| protected ActivationEventType type = TYPE_EDEFAULT; |
| /** |
| * The default value of the '{@link #getButton() <em>Button</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getButton() |
| * @generated |
| * @ordered |
| */ |
| protected static final int BUTTON_EDEFAULT = 1; |
| /** |
| * The cached value of the '{@link #getButton() <em>Button</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getButton() |
| * @generated |
| * @ordered |
| */ |
| protected int button = BUTTON_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ActivateCellEditImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return TeslaPackage.Literals.ACTIVATE_CELL_EDIT; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public int getColumn() { |
| return column; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setColumn(int newColumn) { |
| int oldColumn = column; |
| column = newColumn; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, TeslaPackage.ACTIVATE_CELL_EDIT__COLUMN, oldColumn, column)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ActivationEventType getType() { |
| return type; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setType(ActivationEventType newType) { |
| ActivationEventType oldType = type; |
| type = newType == null ? TYPE_EDEFAULT : newType; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, TeslaPackage.ACTIVATE_CELL_EDIT__TYPE, oldType, type)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public int getButton() { |
| return button; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setButton(int newButton) { |
| int oldButton = button; |
| button = newButton; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, TeslaPackage.ACTIVATE_CELL_EDIT__BUTTON, oldButton, button)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case TeslaPackage.ACTIVATE_CELL_EDIT__COLUMN: |
| return getColumn(); |
| case TeslaPackage.ACTIVATE_CELL_EDIT__TYPE: |
| return getType(); |
| case TeslaPackage.ACTIVATE_CELL_EDIT__BUTTON: |
| return getButton(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case TeslaPackage.ACTIVATE_CELL_EDIT__COLUMN: |
| setColumn((Integer)newValue); |
| return; |
| case TeslaPackage.ACTIVATE_CELL_EDIT__TYPE: |
| setType((ActivationEventType)newValue); |
| return; |
| case TeslaPackage.ACTIVATE_CELL_EDIT__BUTTON: |
| setButton((Integer)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case TeslaPackage.ACTIVATE_CELL_EDIT__COLUMN: |
| setColumn(COLUMN_EDEFAULT); |
| return; |
| case TeslaPackage.ACTIVATE_CELL_EDIT__TYPE: |
| setType(TYPE_EDEFAULT); |
| return; |
| case TeslaPackage.ACTIVATE_CELL_EDIT__BUTTON: |
| setButton(BUTTON_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case TeslaPackage.ACTIVATE_CELL_EDIT__COLUMN: |
| return column != COLUMN_EDEFAULT; |
| case TeslaPackage.ACTIVATE_CELL_EDIT__TYPE: |
| return type != TYPE_EDEFAULT; |
| case TeslaPackage.ACTIVATE_CELL_EDIT__BUTTON: |
| return button != BUTTON_EDEFAULT; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuilder result = new StringBuilder(super.toString()); |
| result.append(" (column: "); |
| result.append(column); |
| result.append(", type: "); |
| result.append(type); |
| result.append(", button: "); |
| result.append(button); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //ActivateCellEditImpl |