| /******************************************************************************* |
| * 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.DoubleClickText; |
| 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>Double Click Text</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.rcptt.tesla.ecl.model.impl.DoubleClickTextImpl#getPosition <em>Position</em>}</li> |
| * <li>{@link org.eclipse.rcptt.tesla.ecl.model.impl.DoubleClickTextImpl#getButton <em>Button</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class DoubleClickTextImpl extends ControlCommandImpl implements DoubleClickText { |
| /** |
| * The default value of the '{@link #getPosition() <em>Position</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getPosition() |
| * @generated |
| * @ordered |
| */ |
| protected static final String POSITION_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getPosition() <em>Position</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getPosition() |
| * @generated |
| * @ordered |
| */ |
| protected String position = POSITION_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 String BUTTON_EDEFAULT = "left"; |
| |
| /** |
| * The cached value of the '{@link #getButton() <em>Button</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getButton() |
| * @generated |
| * @ordered |
| */ |
| protected String button = BUTTON_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected DoubleClickTextImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return TeslaPackage.Literals.DOUBLE_CLICK_TEXT; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getPosition() { |
| return position; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setPosition(String newPosition) { |
| String oldPosition = position; |
| position = newPosition; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, TeslaPackage.DOUBLE_CLICK_TEXT__POSITION, oldPosition, position)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getButton() { |
| return button; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setButton(String newButton) { |
| String oldButton = button; |
| button = newButton; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, TeslaPackage.DOUBLE_CLICK_TEXT__BUTTON, oldButton, button)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case TeslaPackage.DOUBLE_CLICK_TEXT__POSITION: |
| return getPosition(); |
| case TeslaPackage.DOUBLE_CLICK_TEXT__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.DOUBLE_CLICK_TEXT__POSITION: |
| setPosition((String)newValue); |
| return; |
| case TeslaPackage.DOUBLE_CLICK_TEXT__BUTTON: |
| setButton((String)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case TeslaPackage.DOUBLE_CLICK_TEXT__POSITION: |
| setPosition(POSITION_EDEFAULT); |
| return; |
| case TeslaPackage.DOUBLE_CLICK_TEXT__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.DOUBLE_CLICK_TEXT__POSITION: |
| return POSITION_EDEFAULT == null ? position != null : !POSITION_EDEFAULT.equals(position); |
| case TeslaPackage.DOUBLE_CLICK_TEXT__BUTTON: |
| return BUTTON_EDEFAULT == null ? button != null : !BUTTON_EDEFAULT.equals(button); |
| } |
| 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(" (position: "); |
| result.append(position); |
| result.append(", button: "); |
| result.append(button); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //DoubleClickTextImpl |