| /** |
| * |
| * 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 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: |
| * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation |
| * |
| */ |
| package org.eclipse.osbp.ecview.core.common.model.core.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.osbp.ecview.core.common.model.core.CoreModelPackage; |
| import org.eclipse.osbp.ecview.core.common.model.core.YAction; |
| import org.eclipse.osbp.ecview.core.common.model.core.YEnable; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>YAction</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.ecview.core.common.model.core.impl.YActionImpl#isInitialEnabled <em>Initial Enabled</em>}</li> |
| * <li>{@link org.eclipse.osbp.ecview.core.common.model.core.impl.YActionImpl#isEnabled <em>Enabled</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class YActionImpl extends YEmbeddableImpl implements YAction { |
| /** |
| * The default value of the '{@link #isInitialEnabled() <em>Initial Enabled</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isInitialEnabled() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean INITIAL_ENABLED_EDEFAULT = true; |
| |
| /** |
| * The cached value of the '{@link #isInitialEnabled() <em>Initial Enabled</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isInitialEnabled() |
| * @generated |
| * @ordered |
| */ |
| protected boolean initialEnabled = INITIAL_ENABLED_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #isEnabled() <em>Enabled</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isEnabled() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean ENABLED_EDEFAULT = true; |
| |
| /** |
| * The cached value of the '{@link #isEnabled() <em>Enabled</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isEnabled() |
| * @generated |
| * @ordered |
| */ |
| protected boolean enabled = ENABLED_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected YActionImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return CoreModelPackage.Literals.YACTION; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean isInitialEnabled() { |
| return initialEnabled; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setInitialEnabled(boolean newInitialEnabled) { |
| boolean oldInitialEnabled = initialEnabled; |
| initialEnabled = newInitialEnabled; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, CoreModelPackage.YACTION__INITIAL_ENABLED, oldInitialEnabled, initialEnabled)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean isEnabled() { |
| return enabled; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setEnabled(boolean newEnabled) { |
| boolean oldEnabled = enabled; |
| enabled = newEnabled; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, CoreModelPackage.YACTION__ENABLED, oldEnabled, enabled)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case CoreModelPackage.YACTION__INITIAL_ENABLED: |
| return isInitialEnabled(); |
| case CoreModelPackage.YACTION__ENABLED: |
| return isEnabled(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case CoreModelPackage.YACTION__INITIAL_ENABLED: |
| setInitialEnabled((Boolean)newValue); |
| return; |
| case CoreModelPackage.YACTION__ENABLED: |
| setEnabled((Boolean)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case CoreModelPackage.YACTION__INITIAL_ENABLED: |
| setInitialEnabled(INITIAL_ENABLED_EDEFAULT); |
| return; |
| case CoreModelPackage.YACTION__ENABLED: |
| setEnabled(ENABLED_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case CoreModelPackage.YACTION__INITIAL_ENABLED: |
| return initialEnabled != INITIAL_ENABLED_EDEFAULT; |
| case CoreModelPackage.YACTION__ENABLED: |
| return enabled != ENABLED_EDEFAULT; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) { |
| if (baseClass == YEnable.class) { |
| switch (derivedFeatureID) { |
| case CoreModelPackage.YACTION__INITIAL_ENABLED: return CoreModelPackage.YENABLE__INITIAL_ENABLED; |
| case CoreModelPackage.YACTION__ENABLED: return CoreModelPackage.YENABLE__ENABLED; |
| default: return -1; |
| } |
| } |
| return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) { |
| if (baseClass == YEnable.class) { |
| switch (baseFeatureID) { |
| case CoreModelPackage.YENABLE__INITIAL_ENABLED: return CoreModelPackage.YACTION__INITIAL_ENABLED; |
| case CoreModelPackage.YENABLE__ENABLED: return CoreModelPackage.YACTION__ENABLED; |
| default: return -1; |
| } |
| } |
| return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuffer result = new StringBuffer(super.toString()); |
| result.append(" (initialEnabled: "); |
| result.append(initialEnabled); |
| result.append(", enabled: "); |
| result.append(enabled); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| @Override |
| public void setLabel(String label) { |
| // nothing to do |
| |
| } |
| |
| @Override |
| public void setLabelI18nKey(String i18nKey) { |
| // nothing to do |
| |
| } |
| |
| @Override |
| public String getLabel() { |
| return ""; |
| } |
| |
| @Override |
| public String getLabelI18nKey() { |
| return ""; |
| } |
| |
| } //YActionImpl |