| /**
|
| * *******************************************************************************
|
| * Copyright (c) 2008, 2019 Hatha Systems.
|
| * All rights reserved. This program and the accompanying materials
|
| * are made available under the terms of the Eclipse Public License v2.0
|
| * which accompanies this distribution, and is available at
|
| * http://www.eclipse.org/legal/epl-v20.html
|
| *
|
| * Contributors:
|
| * Nikolai Mansourov (Hatha Systems) - initial API and implementation
|
| * *******************************************************************************
|
| *
|
| * $Id$
|
| */ |
| package org.eclipse.modisco.omg.kdm.platform.impl;
|
|
|
| import java.util.Collection;
|
|
|
| import org.eclipse.emf.common.notify.Notification;
|
| import org.eclipse.emf.common.notify.NotificationChain;
|
| import org.eclipse.emf.common.util.EList;
|
| import org.eclipse.emf.ecore.EClass;
|
| import org.eclipse.emf.ecore.InternalEObject;
|
| import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
| import org.eclipse.emf.ecore.util.EObjectContainmentEList;
|
| import org.eclipse.emf.ecore.util.InternalEList;
|
| import org.eclipse.modisco.omg.kdm.platform.PlatformAction;
|
| import org.eclipse.modisco.omg.kdm.platform.PlatformEvent;
|
| import org.eclipse.modisco.omg.kdm.platform.PlatformPackage;
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * An implementation of the model object '<em><b>Action</b></em>'.
|
| * <!-- end-user-doc -->
|
| * <p>
|
| * The following features are implemented:
|
| * <ul>
|
| * <li>{@link org.eclipse.modisco.omg.kdm.platform.impl.PlatformActionImpl#getKind <em>Kind</em>}</li>
|
| * <li>{@link org.eclipse.modisco.omg.kdm.platform.impl.PlatformActionImpl#getPlatformElement <em>Platform Element</em>}</li>
|
| * </ul>
|
| * </p>
|
| *
|
| * @generated
|
| */
|
| public class PlatformActionImpl extends AbstractPlatformElementImpl implements PlatformAction {
|
| /**
|
| * The default value of the '{@link #getKind() <em>Kind</em>}' attribute.
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @see #getKind()
|
| * @generated
|
| * @ordered
|
| */
|
| protected static final String KIND_EDEFAULT = null;
|
|
|
| /**
|
| * The cached value of the '{@link #getKind() <em>Kind</em>}' attribute.
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @see #getKind()
|
| * @generated
|
| * @ordered
|
| */
|
| protected String kind = KIND_EDEFAULT;
|
|
|
| /**
|
| * The cached value of the '{@link #getPlatformElement() <em>Platform Element</em>}' containment reference list.
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @see #getPlatformElement()
|
| * @generated
|
| * @ordered
|
| */
|
| protected EList<PlatformEvent> platformElement;
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| protected PlatformActionImpl() {
|
| super();
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| protected EClass eStaticClass() {
|
| return PlatformPackage.Literals.PLATFORM_ACTION;
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| public String getKind() {
|
| return kind;
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| public void setKind(String newKind) {
|
| String oldKind = kind;
|
| kind = newKind;
|
| if (eNotificationRequired())
|
| eNotify(new ENotificationImpl(this, Notification.SET, PlatformPackage.PLATFORM_ACTION__KIND, oldKind, kind));
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| public EList<PlatformEvent> getPlatformElement() {
|
| if (platformElement == null) {
|
| platformElement = new EObjectContainmentEList<PlatformEvent>(PlatformEvent.class, this, PlatformPackage.PLATFORM_ACTION__PLATFORM_ELEMENT);
|
| }
|
| return platformElement;
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
|
| switch (featureID) {
|
| case PlatformPackage.PLATFORM_ACTION__PLATFORM_ELEMENT:
|
| return ((InternalEList<?>)getPlatformElement()).basicRemove(otherEnd, msgs);
|
| }
|
| return super.eInverseRemove(otherEnd, featureID, msgs);
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| public Object eGet(int featureID, boolean resolve, boolean coreType) {
|
| switch (featureID) {
|
| case PlatformPackage.PLATFORM_ACTION__KIND:
|
| return getKind();
|
| case PlatformPackage.PLATFORM_ACTION__PLATFORM_ELEMENT:
|
| return getPlatformElement();
|
| }
|
| 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 PlatformPackage.PLATFORM_ACTION__KIND:
|
| setKind((String)newValue);
|
| return;
|
| case PlatformPackage.PLATFORM_ACTION__PLATFORM_ELEMENT:
|
| getPlatformElement().clear();
|
| getPlatformElement().addAll((Collection<? extends PlatformEvent>)newValue);
|
| return;
|
| }
|
| super.eSet(featureID, newValue);
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| public void eUnset(int featureID) {
|
| switch (featureID) {
|
| case PlatformPackage.PLATFORM_ACTION__KIND:
|
| setKind(KIND_EDEFAULT);
|
| return;
|
| case PlatformPackage.PLATFORM_ACTION__PLATFORM_ELEMENT:
|
| getPlatformElement().clear();
|
| return;
|
| }
|
| super.eUnset(featureID);
|
| }
|
|
|
| /**
|
| * <!-- begin-user-doc -->
|
| * <!-- end-user-doc -->
|
| * @generated
|
| */
|
| @Override
|
| public boolean eIsSet(int featureID) {
|
| switch (featureID) {
|
| case PlatformPackage.PLATFORM_ACTION__KIND:
|
| return KIND_EDEFAULT == null ? kind != null : !KIND_EDEFAULT.equals(kind);
|
| case PlatformPackage.PLATFORM_ACTION__PLATFORM_ELEMENT:
|
| return platformElement != null && !platformElement.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(" (kind: "); //$NON-NLS-1$
|
| result.append(kind);
|
| result.append(')');
|
| return result.toString();
|
| }
|
|
|
| } //PlatformActionImpl
|