| /******************************************************************************* |
| * 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.tesla.core.protocol.impl; |
| |
| import org.eclipse.rcptt.tesla.core.protocol.ActivateCellEditor; |
| import org.eclipse.rcptt.tesla.core.protocol.ActivationEventType; |
| import org.eclipse.rcptt.tesla.core.protocol.ProtocolPackage; |
| |
| import org.eclipse.rcptt.tesla.core.protocol.raw.Element; |
| |
| import java.util.Collection; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.common.notify.NotificationChain; |
| |
| import org.eclipse.emf.common.util.EList; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.emf.ecore.impl.EObjectImpl; |
| |
| import org.eclipse.emf.ecore.util.EDataTypeEList; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Activate Cell Editor</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.rcptt.tesla.core.protocol.impl.ActivateCellEditorImpl#getId <em>Id</em>}</li> |
| * <li>{@link org.eclipse.rcptt.tesla.core.protocol.impl.ActivateCellEditorImpl#getElement <em>Element</em>}</li> |
| * <li>{@link org.eclipse.rcptt.tesla.core.protocol.impl.ActivateCellEditorImpl#getPath <em>Path</em>}</li> |
| * <li>{@link org.eclipse.rcptt.tesla.core.protocol.impl.ActivateCellEditorImpl#getPattern <em>Pattern</em>}</li> |
| * <li>{@link org.eclipse.rcptt.tesla.core.protocol.impl.ActivateCellEditorImpl#getIndex <em>Index</em>}</li> |
| * <li>{@link org.eclipse.rcptt.tesla.core.protocol.impl.ActivateCellEditorImpl#getColumn <em>Column</em>}</li> |
| * <li>{@link org.eclipse.rcptt.tesla.core.protocol.impl.ActivateCellEditorImpl#getType <em>Type</em>}</li> |
| * <li>{@link org.eclipse.rcptt.tesla.core.protocol.impl.ActivateCellEditorImpl#getButton <em>Button</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class ActivateCellEditorImpl extends EObjectImpl implements ActivateCellEditor { |
| /** |
| * The default value of the '{@link #getId() <em>Id</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getId() |
| * @generated |
| * @ordered |
| */ |
| protected static final int ID_EDEFAULT = 0; |
| |
| /** |
| * The cached value of the '{@link #getId() <em>Id</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getId() |
| * @generated |
| * @ordered |
| */ |
| protected int id = ID_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getElement() <em>Element</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getElement() |
| * @generated |
| * @ordered |
| */ |
| protected Element element; |
| |
| /** |
| * The cached value of the '{@link #getPath() <em>Path</em>}' attribute list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getPath() |
| * @generated |
| * @ordered |
| */ |
| protected EList<String> path; |
| |
| /** |
| * The default value of the '{@link #getPattern() <em>Pattern</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getPattern() |
| * @generated |
| * @ordered |
| */ |
| protected static final String PATTERN_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getPattern() <em>Pattern</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getPattern() |
| * @generated |
| * @ordered |
| */ |
| protected String pattern = PATTERN_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getIndex() <em>Index</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getIndex() |
| * @generated |
| * @ordered |
| */ |
| protected static final Integer INDEX_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getIndex() <em>Index</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getIndex() |
| * @generated |
| * @ordered |
| */ |
| protected Integer index = INDEX_EDEFAULT; |
| |
| /** |
| * 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 ActivateCellEditorImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return ProtocolPackage.Literals.ACTIVATE_CELL_EDITOR; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public int getId() { |
| return id; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setId(int newId) { |
| int oldId = id; |
| id = newId; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ProtocolPackage.ACTIVATE_CELL_EDITOR__ID, oldId, id)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Element getElement() { |
| return element; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetElement(Element newElement, NotificationChain msgs) { |
| Element oldElement = element; |
| element = newElement; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ProtocolPackage.ACTIVATE_CELL_EDITOR__ELEMENT, oldElement, newElement); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setElement(Element newElement) { |
| if (newElement != element) { |
| NotificationChain msgs = null; |
| if (element != null) |
| msgs = ((InternalEObject)element).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ProtocolPackage.ACTIVATE_CELL_EDITOR__ELEMENT, null, msgs); |
| if (newElement != null) |
| msgs = ((InternalEObject)newElement).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ProtocolPackage.ACTIVATE_CELL_EDITOR__ELEMENT, null, msgs); |
| msgs = basicSetElement(newElement, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ProtocolPackage.ACTIVATE_CELL_EDITOR__ELEMENT, newElement, newElement)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<String> getPath() { |
| if (path == null) { |
| path = new EDataTypeEList<String>(String.class, this, ProtocolPackage.ACTIVATE_CELL_EDITOR__PATH); |
| } |
| return path; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getPattern() { |
| return pattern; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setPattern(String newPattern) { |
| String oldPattern = pattern; |
| pattern = newPattern; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ProtocolPackage.ACTIVATE_CELL_EDITOR__PATTERN, oldPattern, pattern)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Integer getIndex() { |
| return index; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setIndex(Integer newIndex) { |
| Integer oldIndex = index; |
| index = newIndex; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ProtocolPackage.ACTIVATE_CELL_EDITOR__INDEX, oldIndex, index)); |
| } |
| |
| /** |
| * <!-- 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, ProtocolPackage.ACTIVATE_CELL_EDITOR__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, ProtocolPackage.ACTIVATE_CELL_EDITOR__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, ProtocolPackage.ACTIVATE_CELL_EDITOR__BUTTON, oldButton, button)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case ProtocolPackage.ACTIVATE_CELL_EDITOR__ELEMENT: |
| return basicSetElement(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 ProtocolPackage.ACTIVATE_CELL_EDITOR__ID: |
| return getId(); |
| case ProtocolPackage.ACTIVATE_CELL_EDITOR__ELEMENT: |
| return getElement(); |
| case ProtocolPackage.ACTIVATE_CELL_EDITOR__PATH: |
| return getPath(); |
| case ProtocolPackage.ACTIVATE_CELL_EDITOR__PATTERN: |
| return getPattern(); |
| case ProtocolPackage.ACTIVATE_CELL_EDITOR__INDEX: |
| return getIndex(); |
| case ProtocolPackage.ACTIVATE_CELL_EDITOR__COLUMN: |
| return getColumn(); |
| case ProtocolPackage.ACTIVATE_CELL_EDITOR__TYPE: |
| return getType(); |
| case ProtocolPackage.ACTIVATE_CELL_EDITOR__BUTTON: |
| return getButton(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @SuppressWarnings("unchecked") |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case ProtocolPackage.ACTIVATE_CELL_EDITOR__ID: |
| setId((Integer)newValue); |
| return; |
| case ProtocolPackage.ACTIVATE_CELL_EDITOR__ELEMENT: |
| setElement((Element)newValue); |
| return; |
| case ProtocolPackage.ACTIVATE_CELL_EDITOR__PATH: |
| getPath().clear(); |
| getPath().addAll((Collection<? extends String>)newValue); |
| return; |
| case ProtocolPackage.ACTIVATE_CELL_EDITOR__PATTERN: |
| setPattern((String)newValue); |
| return; |
| case ProtocolPackage.ACTIVATE_CELL_EDITOR__INDEX: |
| setIndex((Integer)newValue); |
| return; |
| case ProtocolPackage.ACTIVATE_CELL_EDITOR__COLUMN: |
| setColumn((Integer)newValue); |
| return; |
| case ProtocolPackage.ACTIVATE_CELL_EDITOR__TYPE: |
| setType((ActivationEventType)newValue); |
| return; |
| case ProtocolPackage.ACTIVATE_CELL_EDITOR__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 ProtocolPackage.ACTIVATE_CELL_EDITOR__ID: |
| setId(ID_EDEFAULT); |
| return; |
| case ProtocolPackage.ACTIVATE_CELL_EDITOR__ELEMENT: |
| setElement((Element)null); |
| return; |
| case ProtocolPackage.ACTIVATE_CELL_EDITOR__PATH: |
| getPath().clear(); |
| return; |
| case ProtocolPackage.ACTIVATE_CELL_EDITOR__PATTERN: |
| setPattern(PATTERN_EDEFAULT); |
| return; |
| case ProtocolPackage.ACTIVATE_CELL_EDITOR__INDEX: |
| setIndex(INDEX_EDEFAULT); |
| return; |
| case ProtocolPackage.ACTIVATE_CELL_EDITOR__COLUMN: |
| setColumn(COLUMN_EDEFAULT); |
| return; |
| case ProtocolPackage.ACTIVATE_CELL_EDITOR__TYPE: |
| setType(TYPE_EDEFAULT); |
| return; |
| case ProtocolPackage.ACTIVATE_CELL_EDITOR__BUTTON: |
| setButton(BUTTON_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case ProtocolPackage.ACTIVATE_CELL_EDITOR__ID: |
| return id != ID_EDEFAULT; |
| case ProtocolPackage.ACTIVATE_CELL_EDITOR__ELEMENT: |
| return element != null; |
| case ProtocolPackage.ACTIVATE_CELL_EDITOR__PATH: |
| return path != null && !path.isEmpty(); |
| case ProtocolPackage.ACTIVATE_CELL_EDITOR__PATTERN: |
| return PATTERN_EDEFAULT == null ? pattern != null : !PATTERN_EDEFAULT.equals(pattern); |
| case ProtocolPackage.ACTIVATE_CELL_EDITOR__INDEX: |
| return INDEX_EDEFAULT == null ? index != null : !INDEX_EDEFAULT.equals(index); |
| case ProtocolPackage.ACTIVATE_CELL_EDITOR__COLUMN: |
| return column != COLUMN_EDEFAULT; |
| case ProtocolPackage.ACTIVATE_CELL_EDITOR__TYPE: |
| return type != TYPE_EDEFAULT; |
| case ProtocolPackage.ACTIVATE_CELL_EDITOR__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(" (id: "); |
| result.append(id); |
| result.append(", path: "); |
| result.append(path); |
| result.append(", pattern: "); |
| result.append(pattern); |
| result.append(", index: "); |
| result.append(index); |
| result.append(", column: "); |
| result.append(column); |
| result.append(", type: "); |
| result.append(type); |
| result.append(", button: "); |
| result.append(button); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //ActivateCellEditorImpl |