| /** |
| * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) |
| * 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 |
| * |
| * Based on ideas from Xtext, Xtend, Xcore |
| * |
| * Contributors{ |
| * Jose C. Dominguez - Initial implementation |
| * |
| */ |
| package org.eclipse.osbp.xtext.strategy.impl; |
| |
| import java.util.Collection; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.common.util.EList; |
| |
| import org.eclipse.emf.ecore.EClass; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.eclipse.emf.ecore.util.EDataTypeEList; |
| |
| import org.eclipse.osbp.xtext.strategy.FocusingEnum; |
| import org.eclipse.osbp.xtext.strategy.FocusingStrategy; |
| import org.eclipse.osbp.xtext.strategy.StrategyDSLPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Focusing Strategy</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.xtext.strategy.impl.FocusingStrategyImpl#getEcviewFocusingId <em>Ecview Focusing Id</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.strategy.impl.FocusingStrategyImpl#getFocus <em>Focus</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.strategy.impl.FocusingStrategyImpl#getKeyCode <em>Key Code</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.strategy.impl.FocusingStrategyImpl#getModifierKeys <em>Modifier Keys</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class FocusingStrategyImpl extends StrategyBaseImpl implements FocusingStrategy { |
| /** |
| * The default value of the '{@link #getEcviewFocusingId() <em>Ecview Focusing Id</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getEcviewFocusingId() |
| * @generated |
| * @ordered |
| */ |
| protected static final String ECVIEW_FOCUSING_ID_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getEcviewFocusingId() <em>Ecview Focusing Id</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getEcviewFocusingId() |
| * @generated |
| * @ordered |
| */ |
| protected String ecviewFocusingId = ECVIEW_FOCUSING_ID_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getFocus() <em>Focus</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getFocus() |
| * @generated |
| * @ordered |
| */ |
| protected static final FocusingEnum FOCUS_EDEFAULT = FocusingEnum.FORWARD; |
| |
| /** |
| * The cached value of the '{@link #getFocus() <em>Focus</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getFocus() |
| * @generated |
| * @ordered |
| */ |
| protected FocusingEnum focus = FOCUS_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getKeyCode() <em>Key Code</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getKeyCode() |
| * @generated |
| * @ordered |
| */ |
| protected static final String KEY_CODE_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getKeyCode() <em>Key Code</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getKeyCode() |
| * @generated |
| * @ordered |
| */ |
| protected String keyCode = KEY_CODE_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getModifierKeys() <em>Modifier Keys</em>}' attribute list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getModifierKeys() |
| * @generated |
| * @ordered |
| */ |
| protected EList<String> modifierKeys; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected FocusingStrategyImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return StrategyDSLPackage.Literals.FOCUSING_STRATEGY; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getEcviewFocusingId() { |
| return ecviewFocusingId; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setEcviewFocusingId(String newEcviewFocusingId) { |
| String oldEcviewFocusingId = ecviewFocusingId; |
| ecviewFocusingId = newEcviewFocusingId; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, StrategyDSLPackage.FOCUSING_STRATEGY__ECVIEW_FOCUSING_ID, oldEcviewFocusingId, ecviewFocusingId)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public FocusingEnum getFocus() { |
| return focus; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setFocus(FocusingEnum newFocus) { |
| FocusingEnum oldFocus = focus; |
| focus = newFocus == null ? FOCUS_EDEFAULT : newFocus; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, StrategyDSLPackage.FOCUSING_STRATEGY__FOCUS, oldFocus, focus)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getKeyCode() { |
| return keyCode; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setKeyCode(String newKeyCode) { |
| String oldKeyCode = keyCode; |
| keyCode = newKeyCode; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, StrategyDSLPackage.FOCUSING_STRATEGY__KEY_CODE, oldKeyCode, keyCode)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<String> getModifierKeys() { |
| if (modifierKeys == null) { |
| modifierKeys = new EDataTypeEList<String>(String.class, this, StrategyDSLPackage.FOCUSING_STRATEGY__MODIFIER_KEYS); |
| } |
| return modifierKeys; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case StrategyDSLPackage.FOCUSING_STRATEGY__ECVIEW_FOCUSING_ID: |
| return getEcviewFocusingId(); |
| case StrategyDSLPackage.FOCUSING_STRATEGY__FOCUS: |
| return getFocus(); |
| case StrategyDSLPackage.FOCUSING_STRATEGY__KEY_CODE: |
| return getKeyCode(); |
| case StrategyDSLPackage.FOCUSING_STRATEGY__MODIFIER_KEYS: |
| return getModifierKeys(); |
| } |
| 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 StrategyDSLPackage.FOCUSING_STRATEGY__ECVIEW_FOCUSING_ID: |
| setEcviewFocusingId((String)newValue); |
| return; |
| case StrategyDSLPackage.FOCUSING_STRATEGY__FOCUS: |
| setFocus((FocusingEnum)newValue); |
| return; |
| case StrategyDSLPackage.FOCUSING_STRATEGY__KEY_CODE: |
| setKeyCode((String)newValue); |
| return; |
| case StrategyDSLPackage.FOCUSING_STRATEGY__MODIFIER_KEYS: |
| getModifierKeys().clear(); |
| getModifierKeys().addAll((Collection<? extends String>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case StrategyDSLPackage.FOCUSING_STRATEGY__ECVIEW_FOCUSING_ID: |
| setEcviewFocusingId(ECVIEW_FOCUSING_ID_EDEFAULT); |
| return; |
| case StrategyDSLPackage.FOCUSING_STRATEGY__FOCUS: |
| setFocus(FOCUS_EDEFAULT); |
| return; |
| case StrategyDSLPackage.FOCUSING_STRATEGY__KEY_CODE: |
| setKeyCode(KEY_CODE_EDEFAULT); |
| return; |
| case StrategyDSLPackage.FOCUSING_STRATEGY__MODIFIER_KEYS: |
| getModifierKeys().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case StrategyDSLPackage.FOCUSING_STRATEGY__ECVIEW_FOCUSING_ID: |
| return ECVIEW_FOCUSING_ID_EDEFAULT == null ? ecviewFocusingId != null : !ECVIEW_FOCUSING_ID_EDEFAULT.equals(ecviewFocusingId); |
| case StrategyDSLPackage.FOCUSING_STRATEGY__FOCUS: |
| return focus != FOCUS_EDEFAULT; |
| case StrategyDSLPackage.FOCUSING_STRATEGY__KEY_CODE: |
| return KEY_CODE_EDEFAULT == null ? keyCode != null : !KEY_CODE_EDEFAULT.equals(keyCode); |
| case StrategyDSLPackage.FOCUSING_STRATEGY__MODIFIER_KEYS: |
| return modifierKeys != null && !modifierKeys.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuffer result = new StringBuffer(super.toString()); |
| result.append(" (ecviewFocusingId: "); |
| result.append(ecviewFocusingId); |
| result.append(", focus: "); |
| result.append(focus); |
| result.append(", keyCode: "); |
| result.append(keyCode); |
| result.append(", modifierKeys: "); |
| result.append(modifierKeys); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //FocusingStrategyImpl |