| /******************************************************************************* |
| * 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.ControlHandler; |
| import org.eclipse.rcptt.tesla.ecl.model.HoverAtTextOffset; |
| 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>Hover At Text Offset</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.rcptt.tesla.ecl.model.impl.HoverAtTextOffsetImpl#getControl <em>Control</em>}</li> |
| * <li>{@link org.eclipse.rcptt.tesla.ecl.model.impl.HoverAtTextOffsetImpl#getOffset <em>Offset</em>}</li> |
| * <li>{@link org.eclipse.rcptt.tesla.ecl.model.impl.HoverAtTextOffsetImpl#getLine <em>Line</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class HoverAtTextOffsetImpl extends CommandImpl implements HoverAtTextOffset { |
| /** |
| * 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 #getOffset() <em>Offset</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getOffset() |
| * @generated |
| * @ordered |
| */ |
| protected static final Integer OFFSET_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getOffset() <em>Offset</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getOffset() |
| * @generated |
| * @ordered |
| */ |
| protected Integer offset = OFFSET_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getLine() <em>Line</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getLine() |
| * @generated |
| * @ordered |
| */ |
| protected static final Integer LINE_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getLine() <em>Line</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getLine() |
| * @generated |
| * @ordered |
| */ |
| protected Integer line = LINE_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected HoverAtTextOffsetImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return TeslaPackage.Literals.HOVER_AT_TEXT_OFFSET; |
| } |
| |
| /** |
| * <!-- 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.HOVER_AT_TEXT_OFFSET__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.HOVER_AT_TEXT_OFFSET__CONTROL, oldControl, control)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Integer getOffset() { |
| return offset; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setOffset(Integer newOffset) { |
| Integer oldOffset = offset; |
| offset = newOffset; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, TeslaPackage.HOVER_AT_TEXT_OFFSET__OFFSET, oldOffset, offset)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Integer getLine() { |
| return line; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setLine(Integer newLine) { |
| Integer oldLine = line; |
| line = newLine; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, TeslaPackage.HOVER_AT_TEXT_OFFSET__LINE, oldLine, line)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case TeslaPackage.HOVER_AT_TEXT_OFFSET__CONTROL: |
| if (resolve) return getControl(); |
| return basicGetControl(); |
| case TeslaPackage.HOVER_AT_TEXT_OFFSET__OFFSET: |
| return getOffset(); |
| case TeslaPackage.HOVER_AT_TEXT_OFFSET__LINE: |
| return getLine(); |
| } |
| 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.HOVER_AT_TEXT_OFFSET__CONTROL: |
| setControl((ControlHandler)newValue); |
| return; |
| case TeslaPackage.HOVER_AT_TEXT_OFFSET__OFFSET: |
| setOffset((Integer)newValue); |
| return; |
| case TeslaPackage.HOVER_AT_TEXT_OFFSET__LINE: |
| setLine((Integer)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case TeslaPackage.HOVER_AT_TEXT_OFFSET__CONTROL: |
| setControl((ControlHandler)null); |
| return; |
| case TeslaPackage.HOVER_AT_TEXT_OFFSET__OFFSET: |
| setOffset(OFFSET_EDEFAULT); |
| return; |
| case TeslaPackage.HOVER_AT_TEXT_OFFSET__LINE: |
| setLine(LINE_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case TeslaPackage.HOVER_AT_TEXT_OFFSET__CONTROL: |
| return control != null; |
| case TeslaPackage.HOVER_AT_TEXT_OFFSET__OFFSET: |
| return OFFSET_EDEFAULT == null ? offset != null : !OFFSET_EDEFAULT.equals(offset); |
| case TeslaPackage.HOVER_AT_TEXT_OFFSET__LINE: |
| return LINE_EDEFAULT == null ? line != null : !LINE_EDEFAULT.equals(line); |
| } |
| 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(" (offset: "); |
| result.append(offset); |
| result.append(", line: "); |
| result.append(line); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //HoverAtTextOffsetImpl |