blob: ed14d83c4b931ce26731e0cc48a6761b2c2c04c3 [file] [log] [blame]
/**
* Copyright (c) 2000-2009, Intalio Inc.
* 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:
* Intalio Inc. - initial API and implementation
*
*/
package org.eclipse.bpmn.impl;
import org.eclipse.bpmn.BpmnPackage;
import org.eclipse.bpmn.Text;
import org.eclipse.bpmn.TextAnnotation;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Text Annotation</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.bpmn.impl.TextAnnotationImpl#getText <em>Text</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class TextAnnotationImpl extends ArtifactImpl implements TextAnnotation {
/**
* The cached value of the '{@link #getText() <em>Text</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getText()
* @generated
* @ordered
*/
protected Text text;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected TextAnnotationImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return BpmnPackage.eINSTANCE.getTextAnnotation();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Text getText() {
return text;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetText(Text newText, NotificationChain msgs) {
Text oldText = text;
text = newText;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this,
Notification.SET, BpmnPackage.TEXT_ANNOTATION__TEXT,
oldText, newText);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setText(Text newText) {
if (newText != text) {
NotificationChain msgs = null;
if (text != null)
msgs = ((InternalEObject) text)
.eInverseRemove(this, EOPPOSITE_FEATURE_BASE
- BpmnPackage.TEXT_ANNOTATION__TEXT, null, msgs);
if (newText != null)
msgs = ((InternalEObject) newText)
.eInverseAdd(this, EOPPOSITE_FEATURE_BASE
- BpmnPackage.TEXT_ANNOTATION__TEXT, null, msgs);
msgs = basicSetText(newText, msgs);
if (msgs != null)
msgs.dispatch();
} else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
BpmnPackage.TEXT_ANNOTATION__TEXT, newText, newText));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd,
int featureID, NotificationChain msgs) {
switch (featureID) {
case BpmnPackage.TEXT_ANNOTATION__TEXT:
return basicSetText(null, 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 BpmnPackage.TEXT_ANNOTATION__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 BpmnPackage.TEXT_ANNOTATION__TEXT:
setText((Text) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case BpmnPackage.TEXT_ANNOTATION__TEXT:
setText((Text) null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case BpmnPackage.TEXT_ANNOTATION__TEXT:
return text != null;
}
return super.eIsSet(featureID);
}
} //TextAnnotationImpl