blob: b2efcd0c2ef33549c65931a7d50707ed07f463c5 [file] [log] [blame]
/**
* Copyright (c) 2011-2018 EclipseSource Muenchen GmbH and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Johannes Faltermeier - initial API and implementation
*/
package org.eclipse.emf.ecp.view.template.style.keybinding.model.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.emf.ecp.view.template.style.keybinding.model.VTKeyBinding;
import org.eclipse.emf.ecp.view.template.style.keybinding.model.VTKeybindingPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Key Binding</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.emf.ecp.view.template.style.keybinding.model.impl.VTKeyBindingImpl#getId <em>Id</em>}</li>
* <li>{@link org.eclipse.emf.ecp.view.template.style.keybinding.model.impl.VTKeyBindingImpl#getKeySequence <em>Key
* Sequence</em>}</li>
* </ul>
*
* @generated
*/
public class VTKeyBindingImpl extends MinimalEObjectImpl.Container implements VTKeyBinding {
/**
* The default value of the '{@link #getId() <em>Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @see #getId()
* @generated
* @ordered
*/
protected static final String ID_EDEFAULT = null;
/**
* The cached value of the '{@link #getId() <em>Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @see #getId()
* @generated
* @ordered
*/
protected String id = ID_EDEFAULT;
/**
* The default value of the '{@link #getKeySequence() <em>Key Sequence</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @see #getKeySequence()
* @generated
* @ordered
*/
protected static final String KEY_SEQUENCE_EDEFAULT = null;
/**
* The cached value of the '{@link #getKeySequence() <em>Key Sequence</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @see #getKeySequence()
* @generated
* @ordered
*/
protected String keySequence = KEY_SEQUENCE_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
protected VTKeyBindingImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return VTKeybindingPackage.Literals.KEY_BINDING;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public String getId() {
return id;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public void setId(String newId) {
final String oldId = id;
id = newId;
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, VTKeybindingPackage.KEY_BINDING__ID, oldId, id));
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public String getKeySequence() {
return keySequence;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public void setKeySequence(String newKeySequence) {
final String oldKeySequence = keySequence;
keySequence = newKeySequence;
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, VTKeybindingPackage.KEY_BINDING__KEY_SEQUENCE,
oldKeySequence, keySequence));
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case VTKeybindingPackage.KEY_BINDING__ID:
return getId();
case VTKeybindingPackage.KEY_BINDING__KEY_SEQUENCE:
return getKeySequence();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case VTKeybindingPackage.KEY_BINDING__ID:
setId((String) newValue);
return;
case VTKeybindingPackage.KEY_BINDING__KEY_SEQUENCE:
setKeySequence((String) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case VTKeybindingPackage.KEY_BINDING__ID:
setId(ID_EDEFAULT);
return;
case VTKeybindingPackage.KEY_BINDING__KEY_SEQUENCE:
setKeySequence(KEY_SEQUENCE_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case VTKeybindingPackage.KEY_BINDING__ID:
return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
case VTKeybindingPackage.KEY_BINDING__KEY_SEQUENCE:
return KEY_SEQUENCE_EDEFAULT == null ? keySequence != null : !KEY_SEQUENCE_EDEFAULT.equals(keySequence);
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) {
return super.toString();
}
final StringBuffer result = new StringBuffer(super.toString());
result.append(" (id: "); //$NON-NLS-1$
result.append(id);
result.append(", keySequence: "); //$NON-NLS-1$
result.append(keySequence);
result.append(')');
return result.toString();
}
} // VTKeyBindingImpl