| /******************************************************************************* |
| * 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.ecl.model.impl; |
| |
| import org.eclipse.rcptt.tesla.ecl.model.Button; |
| import org.eclipse.rcptt.tesla.ecl.model.ControlHandler; |
| import org.eclipse.rcptt.tesla.ecl.model.DragAction; |
| 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.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.rcptt.ecl.core.impl.CommandImpl; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Drag Action</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.rcptt.tesla.ecl.model.impl.DragActionImpl#getControl <em>Control</em>}</li> |
| * <li>{@link org.eclipse.rcptt.tesla.ecl.model.impl.DragActionImpl#getX <em>X</em>}</li> |
| * <li>{@link org.eclipse.rcptt.tesla.ecl.model.impl.DragActionImpl#getY <em>Y</em>}</li> |
| * <li>{@link org.eclipse.rcptt.tesla.ecl.model.impl.DragActionImpl#getButton <em>Button</em>}</li> |
| * <li>{@link org.eclipse.rcptt.tesla.ecl.model.impl.DragActionImpl#getMask <em>Mask</em>}</li> |
| * <li>{@link org.eclipse.rcptt.tesla.ecl.model.impl.DragActionImpl#getDetail <em>Detail</em>}</li> |
| * <li>{@link org.eclipse.rcptt.tesla.ecl.model.impl.DragActionImpl#getOperation <em>Operation</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class DragActionImpl extends CommandImpl implements DragAction { |
| /** |
| * The cached value of the '{@link #getControl() <em>Control</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getControl() |
| * @generated |
| * @ordered |
| */ |
| protected ControlHandler control; |
| |
| /** |
| * 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 #getButton() <em>Button</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getButton() |
| * @generated |
| * @ordered |
| */ |
| protected static final Button BUTTON_EDEFAULT = Button.NONE; |
| |
| /** |
| * The cached value of the '{@link #getButton() <em>Button</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getButton() |
| * @generated |
| * @ordered |
| */ |
| protected Button button = BUTTON_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getMask() <em>Mask</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getMask() |
| * @generated |
| * @ordered |
| */ |
| protected static final String MASK_EDEFAULT = ""; |
| |
| /** |
| * The cached value of the '{@link #getMask() <em>Mask</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getMask() |
| * @generated |
| * @ordered |
| */ |
| protected String mask = MASK_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getDetail() <em>Detail</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDetail() |
| * @generated |
| * @ordered |
| */ |
| protected static final String DETAIL_EDEFAULT = "none"; |
| |
| /** |
| * The cached value of the '{@link #getDetail() <em>Detail</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDetail() |
| * @generated |
| * @ordered |
| */ |
| protected String detail = DETAIL_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getOperation() <em>Operation</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getOperation() |
| * @generated |
| * @ordered |
| */ |
| protected static final Integer OPERATION_EDEFAULT = new Integer(-1); |
| |
| /** |
| * The cached value of the '{@link #getOperation() <em>Operation</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getOperation() |
| * @generated |
| * @ordered |
| */ |
| protected Integer operation = OPERATION_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected DragActionImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return TeslaPackage.Literals.DRAG_ACTION; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ControlHandler getControl() { |
| if (control != null && control.eIsProxy()) { |
| InternalEObject oldControl = (InternalEObject)control; |
| control = (ControlHandler)eResolveProxy(oldControl); |
| if (control != oldControl) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, TeslaPackage.DRAG_ACTION__CONTROL, oldControl, control)); |
| } |
| } |
| return control; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ControlHandler basicGetControl() { |
| return control; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setControl(ControlHandler newControl) { |
| ControlHandler oldControl = control; |
| control = newControl; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, TeslaPackage.DRAG_ACTION__CONTROL, oldControl, control)); |
| } |
| |
| /** |
| * <!-- 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, TeslaPackage.DRAG_ACTION__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, TeslaPackage.DRAG_ACTION__Y, oldY, y)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getDetail() { |
| return detail; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setDetail(String newDetail) { |
| String oldDetail = detail; |
| detail = newDetail; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, TeslaPackage.DRAG_ACTION__DETAIL, oldDetail, detail)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Integer getOperation() { |
| return operation; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setOperation(Integer newOperation) { |
| Integer oldOperation = operation; |
| operation = newOperation; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, TeslaPackage.DRAG_ACTION__OPERATION, oldOperation, operation)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getMask() { |
| return mask; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setMask(String newMask) { |
| String oldMask = mask; |
| mask = newMask; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, TeslaPackage.DRAG_ACTION__MASK, oldMask, mask)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Button getButton() { |
| return button; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setButton(Button newButton) { |
| Button oldButton = button; |
| button = newButton == null ? BUTTON_EDEFAULT : newButton; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, TeslaPackage.DRAG_ACTION__BUTTON, oldButton, button)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case TeslaPackage.DRAG_ACTION__CONTROL: |
| if (resolve) return getControl(); |
| return basicGetControl(); |
| case TeslaPackage.DRAG_ACTION__X: |
| return getX(); |
| case TeslaPackage.DRAG_ACTION__Y: |
| return getY(); |
| case TeslaPackage.DRAG_ACTION__BUTTON: |
| return getButton(); |
| case TeslaPackage.DRAG_ACTION__MASK: |
| return getMask(); |
| case TeslaPackage.DRAG_ACTION__DETAIL: |
| return getDetail(); |
| case TeslaPackage.DRAG_ACTION__OPERATION: |
| return getOperation(); |
| } |
| 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.DRAG_ACTION__CONTROL: |
| setControl((ControlHandler)newValue); |
| return; |
| case TeslaPackage.DRAG_ACTION__X: |
| setX((Integer)newValue); |
| return; |
| case TeslaPackage.DRAG_ACTION__Y: |
| setY((Integer)newValue); |
| return; |
| case TeslaPackage.DRAG_ACTION__BUTTON: |
| setButton((Button)newValue); |
| return; |
| case TeslaPackage.DRAG_ACTION__MASK: |
| setMask((String)newValue); |
| return; |
| case TeslaPackage.DRAG_ACTION__DETAIL: |
| setDetail((String)newValue); |
| return; |
| case TeslaPackage.DRAG_ACTION__OPERATION: |
| setOperation((Integer)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case TeslaPackage.DRAG_ACTION__CONTROL: |
| setControl((ControlHandler)null); |
| return; |
| case TeslaPackage.DRAG_ACTION__X: |
| setX(X_EDEFAULT); |
| return; |
| case TeslaPackage.DRAG_ACTION__Y: |
| setY(Y_EDEFAULT); |
| return; |
| case TeslaPackage.DRAG_ACTION__BUTTON: |
| setButton(BUTTON_EDEFAULT); |
| return; |
| case TeslaPackage.DRAG_ACTION__MASK: |
| setMask(MASK_EDEFAULT); |
| return; |
| case TeslaPackage.DRAG_ACTION__DETAIL: |
| setDetail(DETAIL_EDEFAULT); |
| return; |
| case TeslaPackage.DRAG_ACTION__OPERATION: |
| setOperation(OPERATION_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case TeslaPackage.DRAG_ACTION__CONTROL: |
| return control != null; |
| case TeslaPackage.DRAG_ACTION__X: |
| return X_EDEFAULT == null ? x != null : !X_EDEFAULT.equals(x); |
| case TeslaPackage.DRAG_ACTION__Y: |
| return Y_EDEFAULT == null ? y != null : !Y_EDEFAULT.equals(y); |
| case TeslaPackage.DRAG_ACTION__BUTTON: |
| return button != BUTTON_EDEFAULT; |
| case TeslaPackage.DRAG_ACTION__MASK: |
| return MASK_EDEFAULT == null ? mask != null : !MASK_EDEFAULT.equals(mask); |
| case TeslaPackage.DRAG_ACTION__DETAIL: |
| return DETAIL_EDEFAULT == null ? detail != null : !DETAIL_EDEFAULT.equals(detail); |
| case TeslaPackage.DRAG_ACTION__OPERATION: |
| return OPERATION_EDEFAULT == null ? operation != null : !OPERATION_EDEFAULT.equals(operation); |
| } |
| 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(", button: "); |
| result.append(button); |
| result.append(", mask: "); |
| result.append(mask); |
| result.append(", detail: "); |
| result.append(detail); |
| result.append(", operation: "); |
| result.append(operation); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //DragActionImpl |