| /** |
| * 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 org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.eclipse.uml2.uml.Comment; |
| |
| import org.eclipse.upr.bpmnprof.BpmnprofPackage; |
| import org.eclipse.upr.bpmnprof.Documentation; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Documentation</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.upr.bpmnprof.impl.DocumentationImpl#getBase_Comment <em>Base Comment</em>}</li> |
| * <li>{@link org.eclipse.upr.bpmnprof.impl.DocumentationImpl#getTextFormat <em>Text Format</em>}</li> |
| * <li>{@link org.eclipse.upr.bpmnprof.impl.DocumentationImpl#getText <em>Text</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class DocumentationImpl extends BaseElementImpl implements Documentation { |
| /** |
| * The cached value of the '{@link #getBase_Comment() <em>Base Comment</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getBase_Comment() |
| * @generated |
| * @ordered |
| */ |
| protected Comment base_Comment; |
| |
| /** |
| * The default value of the '{@link #getTextFormat() <em>Text Format</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getTextFormat() |
| * @generated |
| * @ordered |
| */ |
| protected static final String TEXT_FORMAT_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getTextFormat() <em>Text Format</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getTextFormat() |
| * @generated |
| * @ordered |
| */ |
| protected String textFormat = TEXT_FORMAT_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getText() <em>Text</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getText() |
| * @generated |
| * @ordered |
| */ |
| protected static final String TEXT_EDEFAULT = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected DocumentationImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return BpmnprofPackage.eINSTANCE.getDocumentation(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Comment getBase_Comment() { |
| if (base_Comment != null && base_Comment.eIsProxy()) { |
| InternalEObject oldBase_Comment = (InternalEObject)base_Comment; |
| base_Comment = (Comment)eResolveProxy(oldBase_Comment); |
| if (base_Comment != oldBase_Comment) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, BpmnprofPackage.DOCUMENTATION__BASE_COMMENT, oldBase_Comment, base_Comment)); |
| } |
| } |
| return base_Comment; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Comment basicGetBase_Comment() { |
| return base_Comment; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setBase_Comment(Comment newBase_Comment) { |
| Comment oldBase_Comment = base_Comment; |
| base_Comment = newBase_Comment; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, BpmnprofPackage.DOCUMENTATION__BASE_COMMENT, oldBase_Comment, base_Comment)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getTextFormat() { |
| return textFormat; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setTextFormat(String newTextFormat) { |
| String oldTextFormat = textFormat; |
| textFormat = newTextFormat; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, BpmnprofPackage.DOCUMENTATION__TEXT_FORMAT, oldTextFormat, textFormat)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getText() { |
| // TODO: implement this method to return the 'Text' attribute |
| // Ensure that you remove @generated or mark it @generated NOT |
| throw new UnsupportedOperationException(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setText(String newText) { |
| // TODO: implement this method to set the 'Text' attribute |
| // Ensure that you remove @generated or mark it @generated NOT |
| throw new UnsupportedOperationException(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case BpmnprofPackage.DOCUMENTATION__BASE_COMMENT: |
| if (resolve) return getBase_Comment(); |
| return basicGetBase_Comment(); |
| case BpmnprofPackage.DOCUMENTATION__TEXT_FORMAT: |
| return getTextFormat(); |
| case BpmnprofPackage.DOCUMENTATION__TEXT: |
| return getText(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case BpmnprofPackage.DOCUMENTATION__BASE_COMMENT: |
| setBase_Comment((Comment)newValue); |
| return; |
| case BpmnprofPackage.DOCUMENTATION__TEXT_FORMAT: |
| setTextFormat((String)newValue); |
| return; |
| case BpmnprofPackage.DOCUMENTATION__TEXT: |
| setText((String)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case BpmnprofPackage.DOCUMENTATION__BASE_COMMENT: |
| setBase_Comment((Comment)null); |
| return; |
| case BpmnprofPackage.DOCUMENTATION__TEXT_FORMAT: |
| setTextFormat(TEXT_FORMAT_EDEFAULT); |
| return; |
| case BpmnprofPackage.DOCUMENTATION__TEXT: |
| setText(TEXT_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case BpmnprofPackage.DOCUMENTATION__BASE_COMMENT: |
| return base_Comment != null; |
| case BpmnprofPackage.DOCUMENTATION__TEXT_FORMAT: |
| return TEXT_FORMAT_EDEFAULT == null ? textFormat != null : !TEXT_FORMAT_EDEFAULT.equals(textFormat); |
| case BpmnprofPackage.DOCUMENTATION__TEXT: |
| return TEXT_EDEFAULT == null ? getText() != null : !TEXT_EDEFAULT.equals(getText()); |
| } |
| 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(" (textFormat: "); |
| result.append(textFormat); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //DocumentationImpl |