| /******************************************************************************* |
| * Copyright (c) 2009, 2016 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.core.protocol.impl; |
| |
| import org.eclipse.rcptt.tesla.core.protocol.ProtocolPackage; |
| import org.eclipse.rcptt.tesla.core.protocol.TextSelectionResponse; |
| |
| import org.eclipse.rcptt.tesla.core.protocol.raw.impl.ResponseImpl; |
| |
| 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>Text Selection Response</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.rcptt.tesla.core.protocol.impl.TextSelectionResponseImpl#getX <em>X</em>}</li> |
| * <li>{@link org.eclipse.rcptt.tesla.core.protocol.impl.TextSelectionResponseImpl#getY <em>Y</em>}</li> |
| * <li>{@link org.eclipse.rcptt.tesla.core.protocol.impl.TextSelectionResponseImpl#getText <em>Text</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class TextSelectionResponseImpl extends ResponseImpl implements TextSelectionResponse { |
| /** |
| * The default value of the '{@link #getX() <em>X</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getX() |
| * @generated |
| * @ordered |
| */ |
| protected static final Integer X_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getX() <em>X</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getX() |
| * @generated |
| * @ordered |
| */ |
| protected Integer x = X_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getY() <em>Y</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getY() |
| * @generated |
| * @ordered |
| */ |
| protected static final Integer Y_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getY() <em>Y</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getY() |
| * @generated |
| * @ordered |
| */ |
| protected Integer y = Y_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getText() <em>Text</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getText() |
| * @generated |
| * @ordered |
| */ |
| protected static final String TEXT_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getText() <em>Text</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getText() |
| * @generated |
| * @ordered |
| */ |
| protected String text = TEXT_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected TextSelectionResponseImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return ProtocolPackage.Literals.TEXT_SELECTION_RESPONSE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Integer getX() { |
| return x; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setX(Integer newX) { |
| Integer oldX = x; |
| x = newX; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ProtocolPackage.TEXT_SELECTION_RESPONSE__X, oldX, x)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Integer getY() { |
| return y; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setY(Integer newY) { |
| Integer oldY = y; |
| y = newY; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ProtocolPackage.TEXT_SELECTION_RESPONSE__Y, oldY, y)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getText() { |
| return text; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setText(String newText) { |
| String oldText = text; |
| text = newText; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ProtocolPackage.TEXT_SELECTION_RESPONSE__TEXT, oldText, text)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case ProtocolPackage.TEXT_SELECTION_RESPONSE__X: |
| return getX(); |
| case ProtocolPackage.TEXT_SELECTION_RESPONSE__Y: |
| return getY(); |
| case ProtocolPackage.TEXT_SELECTION_RESPONSE__TEXT: |
| return getText(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case ProtocolPackage.TEXT_SELECTION_RESPONSE__X: |
| setX((Integer)newValue); |
| return; |
| case ProtocolPackage.TEXT_SELECTION_RESPONSE__Y: |
| setY((Integer)newValue); |
| return; |
| case ProtocolPackage.TEXT_SELECTION_RESPONSE__TEXT: |
| setText((String)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case ProtocolPackage.TEXT_SELECTION_RESPONSE__X: |
| setX(X_EDEFAULT); |
| return; |
| case ProtocolPackage.TEXT_SELECTION_RESPONSE__Y: |
| setY(Y_EDEFAULT); |
| return; |
| case ProtocolPackage.TEXT_SELECTION_RESPONSE__TEXT: |
| setText(TEXT_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case ProtocolPackage.TEXT_SELECTION_RESPONSE__X: |
| return X_EDEFAULT == null ? x != null : !X_EDEFAULT.equals(x); |
| case ProtocolPackage.TEXT_SELECTION_RESPONSE__Y: |
| return Y_EDEFAULT == null ? y != null : !Y_EDEFAULT.equals(y); |
| case ProtocolPackage.TEXT_SELECTION_RESPONSE__TEXT: |
| return TEXT_EDEFAULT == null ? text != null : !TEXT_EDEFAULT.equals(text); |
| } |
| 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(" (x: "); |
| result.append(x); |
| result.append(", y: "); |
| result.append(y); |
| result.append(", text: "); |
| result.append(text); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //TextSelectionResponseImpl |