blob: 6b4544acbe9f52963631dd6887b552eaefe26f28 [file] [log] [blame]
/**
* Copyright (c) 2014 Fraunhofer FOKUS
* 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:
* Max Bureck
*/
package org.eclipse.upr.bpmnprof.impl;
import java.lang.reflect.InvocationTargetException;
import java.util.Collection;
import java.util.Map;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.BasicDiagnostic;
import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.common.util.DiagnosticChain;
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.plugin.EcorePlugin;
import org.eclipse.emf.ecore.util.EObjectValidator;
import org.eclipse.uml2.uml.OpaqueAction;
import org.eclipse.upr.bpmnprof.BpmnprofPackage;
import org.eclipse.upr.bpmnprof.Rendering;
import org.eclipse.upr.bpmnprof.UserTask;
import org.eclipse.upr.bpmnprof.util.BpmnprofValidator;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>User Task</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.upr.bpmnprof.impl.UserTaskImpl#getBase_OpaqueAction <em>Base Opaque Action</em>}</li>
* <li>{@link org.eclipse.upr.bpmnprof.impl.UserTaskImpl#getImplementation <em>Implementation</em>}</li>
* <li>{@link org.eclipse.upr.bpmnprof.impl.UserTaskImpl#getRenderings <em>Renderings</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class UserTaskImpl extends TaskImpl implements UserTask {
/**
* The cached value of the '{@link #getBase_OpaqueAction() <em>Base Opaque Action</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getBase_OpaqueAction()
* @generated
* @ordered
*/
protected OpaqueAction base_OpaqueAction;
/**
* The default value of the '{@link #getImplementation() <em>Implementation</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getImplementation()
* @generated
* @ordered
*/
protected static final String IMPLEMENTATION_EDEFAULT = "##unspecified";
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected UserTaskImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return BpmnprofPackage.eINSTANCE.getUserTask();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public OpaqueAction getBase_OpaqueAction() {
if (base_OpaqueAction != null && base_OpaqueAction.eIsProxy()) {
InternalEObject oldBase_OpaqueAction = (InternalEObject)base_OpaqueAction;
base_OpaqueAction = (OpaqueAction)eResolveProxy(oldBase_OpaqueAction);
if (base_OpaqueAction != oldBase_OpaqueAction) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, BpmnprofPackage.USER_TASK__BASE_OPAQUE_ACTION, oldBase_OpaqueAction, base_OpaqueAction));
}
}
return base_OpaqueAction;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public OpaqueAction basicGetBase_OpaqueAction() {
return base_OpaqueAction;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setBase_OpaqueAction(OpaqueAction newBase_OpaqueAction) {
OpaqueAction oldBase_OpaqueAction = base_OpaqueAction;
base_OpaqueAction = newBase_OpaqueAction;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BpmnprofPackage.USER_TASK__BASE_OPAQUE_ACTION, oldBase_OpaqueAction, base_OpaqueAction));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getImplementation() {
// TODO: implement this method to return the 'Implementation' attribute
// Ensure that you remove @generated or mark it @generated NOT
throw new UnsupportedOperationException();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setImplementation(String newImplementation) {
// TODO: implement this method to set the 'Implementation' attribute
// Ensure that you remove @generated or mark it @generated NOT
throw new UnsupportedOperationException();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<Rendering> getRenderings() {
// TODO: implement this method to return the 'Renderings' reference list
// Ensure that you remove @generated or mark it @generated NOT
throw new UnsupportedOperationException();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean UserTaskimplementation(DiagnosticChain diagnostics, Map<Object, Object> context) {
// TODO: implement this method
// -> specify the condition that violates the invariant
// -> verify the details of the diagnostic, including severity and message
// Ensure that you remove @generated or mark it @generated NOT
if (false) {
if (diagnostics != null) {
diagnostics.add
(new BasicDiagnostic
(Diagnostic.ERROR,
BpmnprofValidator.DIAGNOSTIC_SOURCE,
BpmnprofValidator.USER_TASK__USER_TASKIMPLEMENTATION,
EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "UserTaskimplementation", EObjectValidator.getObjectLabel(this, context) }),
new Object [] { this }));
}
return false;
}
return true;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean UserTaskrenderings(DiagnosticChain diagnostics, Map<Object, Object> context) {
// TODO: implement this method
// -> specify the condition that violates the invariant
// -> verify the details of the diagnostic, including severity and message
// Ensure that you remove @generated or mark it @generated NOT
if (false) {
if (diagnostics != null) {
diagnostics.add
(new BasicDiagnostic
(Diagnostic.ERROR,
BpmnprofValidator.DIAGNOSTIC_SOURCE,
BpmnprofValidator.USER_TASK__USER_TASKRENDERINGS,
EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "UserTaskrenderings", EObjectValidator.getObjectLabel(this, context) }),
new Object [] { this }));
}
return false;
}
return true;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case BpmnprofPackage.USER_TASK__BASE_OPAQUE_ACTION:
if (resolve) return getBase_OpaqueAction();
return basicGetBase_OpaqueAction();
case BpmnprofPackage.USER_TASK__IMPLEMENTATION:
return getImplementation();
case BpmnprofPackage.USER_TASK__RENDERINGS:
return getRenderings();
}
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 BpmnprofPackage.USER_TASK__BASE_OPAQUE_ACTION:
setBase_OpaqueAction((OpaqueAction)newValue);
return;
case BpmnprofPackage.USER_TASK__IMPLEMENTATION:
setImplementation((String)newValue);
return;
case BpmnprofPackage.USER_TASK__RENDERINGS:
getRenderings().clear();
getRenderings().addAll((Collection<? extends Rendering>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case BpmnprofPackage.USER_TASK__BASE_OPAQUE_ACTION:
setBase_OpaqueAction((OpaqueAction)null);
return;
case BpmnprofPackage.USER_TASK__IMPLEMENTATION:
setImplementation(IMPLEMENTATION_EDEFAULT);
return;
case BpmnprofPackage.USER_TASK__RENDERINGS:
getRenderings().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case BpmnprofPackage.USER_TASK__BASE_OPAQUE_ACTION:
return base_OpaqueAction != null;
case BpmnprofPackage.USER_TASK__IMPLEMENTATION:
return IMPLEMENTATION_EDEFAULT == null ? getImplementation() != null : !IMPLEMENTATION_EDEFAULT.equals(getImplementation());
case BpmnprofPackage.USER_TASK__RENDERINGS:
return !getRenderings().isEmpty();
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
@SuppressWarnings("unchecked")
public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException {
switch (operationID) {
case BpmnprofPackage.USER_TASK___USER_TASKIMPLEMENTATION__DIAGNOSTICCHAIN_MAP:
return UserTaskimplementation((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1));
case BpmnprofPackage.USER_TASK___USER_TASKRENDERINGS__DIAGNOSTICCHAIN_MAP:
return UserTaskrenderings((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1));
}
return super.eInvoke(operationID, arguments);
}
} //UserTaskImpl