| /** |
| */ |
| package org.eclipse.papyrus.bpmn.BPMNProfile.impl; |
| |
| import java.lang.reflect.InvocationTargetException; |
| import java.util.Collection; |
| import java.util.Map; |
| |
| 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.plugin.EcorePlugin; |
| import org.eclipse.emf.ecore.util.EDataTypeEList; |
| import org.eclipse.emf.ecore.util.EObjectResolvingEList; |
| import org.eclipse.emf.ecore.util.EObjectValidator; |
| import org.eclipse.papyrus.bpmn.BPMNProfile.BPMNProfilePackage; |
| import org.eclipse.papyrus.bpmn.BPMNProfile.GlobalUserTask; |
| import org.eclipse.papyrus.bpmn.BPMNProfile.Rendering; |
| import org.eclipse.papyrus.bpmn.BPMNProfile.util.BPMNProfileValidator; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Global User Task</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.papyrus.bpmn.BPMNProfile.impl.GlobalUserTaskImpl#getImplementation <em>Implementation</em>}</li> |
| * <li>{@link org.eclipse.papyrus.bpmn.BPMNProfile.impl.GlobalUserTaskImpl#getRenderings <em>Renderings</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class GlobalUserTaskImpl extends GlobalTaskImpl implements GlobalUserTask { |
| /** |
| * The cached value of the '{@link #getImplementation() <em>Implementation</em>}' attribute list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getImplementation() |
| * @generated |
| * @ordered |
| */ |
| protected EList<String> implementation; |
| /** |
| * The cached value of the '{@link #getRenderings() <em>Renderings</em>}' reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getRenderings() |
| * @generated |
| * @ordered |
| */ |
| protected EList<Rendering> renderings; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected GlobalUserTaskImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return BPMNProfilePackage.eINSTANCE.getGlobalUserTask(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<String> getImplementation() { |
| if (implementation == null) { |
| implementation = new EDataTypeEList<String>(String.class, this, BPMNProfilePackage.GLOBAL_USER_TASK__IMPLEMENTATION); |
| } |
| return implementation; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<Rendering> getRenderings() { |
| if (renderings == null) { |
| renderings = new EObjectResolvingEList<Rendering>(Rendering.class, this, BPMNProfilePackage.GLOBAL_USER_TASK__RENDERINGS); |
| } |
| return renderings; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean GlobalUserTaskrenderings(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, |
| BPMNProfileValidator.DIAGNOSTIC_SOURCE, |
| BPMNProfileValidator.GLOBAL_USER_TASK__GLOBAL_USER_TASKRENDERINGS, |
| EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "GlobalUserTaskrenderings", EObjectValidator.getObjectLabel(this, context) }), |
| new Object [] { this })); |
| } |
| return false; |
| } |
| return true; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean GlobalUserTaskimplementation(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, |
| BPMNProfileValidator.DIAGNOSTIC_SOURCE, |
| BPMNProfileValidator.GLOBAL_USER_TASK__GLOBAL_USER_TASKIMPLEMENTATION, |
| EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "GlobalUserTaskimplementation", 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 BPMNProfilePackage.GLOBAL_USER_TASK__IMPLEMENTATION: |
| return getImplementation(); |
| case BPMNProfilePackage.GLOBAL_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 BPMNProfilePackage.GLOBAL_USER_TASK__IMPLEMENTATION: |
| getImplementation().clear(); |
| getImplementation().addAll((Collection<? extends String>)newValue); |
| return; |
| case BPMNProfilePackage.GLOBAL_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 BPMNProfilePackage.GLOBAL_USER_TASK__IMPLEMENTATION: |
| getImplementation().clear(); |
| return; |
| case BPMNProfilePackage.GLOBAL_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 BPMNProfilePackage.GLOBAL_USER_TASK__IMPLEMENTATION: |
| return implementation != null && !implementation.isEmpty(); |
| case BPMNProfilePackage.GLOBAL_USER_TASK__RENDERINGS: |
| return renderings != null && !renderings.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 BPMNProfilePackage.GLOBAL_USER_TASK___GLOBAL_USER_TASKRENDERINGS__DIAGNOSTICCHAIN_MAP: |
| return GlobalUserTaskrenderings((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1)); |
| case BPMNProfilePackage.GLOBAL_USER_TASK___GLOBAL_USER_TASKIMPLEMENTATION__DIAGNOSTICCHAIN_MAP: |
| return GlobalUserTaskimplementation((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1)); |
| } |
| return super.eInvoke(operationID, arguments); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuffer result = new StringBuffer(super.toString()); |
| result.append(" (implementation: "); |
| result.append(implementation); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //GlobalUserTaskImpl |