org.eclipse.bpmn2.impl.TextAnnotationImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kie-wb-common-stunner-bpmn-emf Show documentation
Show all versions of kie-wb-common-stunner-bpmn-emf Show documentation
Kie Workbench - Common - Stunner - BPMN Definition Set - GWT Support for Eclipse EMF/XMI
/**
*
*
* Copyright (c) 2010 SAP AG.
* 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:
* Reiner Hille-Doering (SAP AG) - initial API and implementation and/or initial documentation
*
*
*/
package org.eclipse.bpmn2.impl;
import com.google.gwt.user.client.rpc.GwtTransient;
import org.eclipse.bpmn2.Bpmn2Package;
import org.eclipse.bpmn2.TextAnnotation;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
/**
*
* An implementation of the model object 'Text Annotation'.
*
*
* The following features are implemented:
*
*
* - {@link org.eclipse.bpmn2.impl.TextAnnotationImpl#getText Text}
* - {@link org.eclipse.bpmn2.impl.TextAnnotationImpl#getTextFormat Text Format}
*
*
* @generated
*/
public class TextAnnotationImpl extends FlowNodeImpl implements TextAnnotation {
/**
* The default value of the '{@link #getText() Text}' attribute.
*
*
* @see #getText()
* @generated
* @ordered
*/
protected static final String TEXT_EDEFAULT = null;
/**
* The cached value of the '{@link #getText() Text}' attribute.
*
*
* @see #getText()
* @generated
* @ordered
*/
@GwtTransient
protected String text = TEXT_EDEFAULT;
/**
* The default value of the '{@link #getTextFormat() Text Format}' attribute.
*
*
* @see #getTextFormat()
* @generated
* @ordered
*/
protected static final String TEXT_FORMAT_EDEFAULT = "text/plain";
/**
* The cached value of the '{@link #getTextFormat() Text Format}' attribute.
*
*
* @see #getTextFormat()
* @generated
* @ordered
*/
@GwtTransient
protected String textFormat = TEXT_FORMAT_EDEFAULT;
/**
*
*
* @generated
*/
protected TextAnnotationImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return Bpmn2Package.Literals.TEXT_ANNOTATION;
}
/**
*
*
* @generated
*/
@Override
public String getText() {
return text;
}
/**
*
*
* @generated
*/
@Override
public void setText(String newText) {
String oldText = text;
text = newText;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.TEXT_ANNOTATION__TEXT, oldText, text));
}
/**
*
*
* @generated
*/
@Override
public String getTextFormat() {
return textFormat;
}
/**
*
*
* @generated
*/
@Override
public void setTextFormat(String newTextFormat) {
String oldTextFormat = textFormat;
textFormat = newTextFormat;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Bpmn2Package.TEXT_ANNOTATION__TEXT_FORMAT,
oldTextFormat, textFormat));
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case Bpmn2Package.TEXT_ANNOTATION__TEXT:
return getText();
case Bpmn2Package.TEXT_ANNOTATION__TEXT_FORMAT:
return getTextFormat();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case Bpmn2Package.TEXT_ANNOTATION__TEXT:
setText((String) newValue);
return;
case Bpmn2Package.TEXT_ANNOTATION__TEXT_FORMAT:
setTextFormat((String) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case Bpmn2Package.TEXT_ANNOTATION__TEXT:
setText(TEXT_EDEFAULT);
return;
case Bpmn2Package.TEXT_ANNOTATION__TEXT_FORMAT:
setTextFormat(TEXT_FORMAT_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case Bpmn2Package.TEXT_ANNOTATION__TEXT:
return TEXT_EDEFAULT == null ? text != null : !TEXT_EDEFAULT.equals(text);
case Bpmn2Package.TEXT_ANNOTATION__TEXT_FORMAT:
return TEXT_FORMAT_EDEFAULT == null ? textFormat != null : !TEXT_FORMAT_EDEFAULT.equals(textFormat);
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy())
return super.toString();
StringBuilder result = new StringBuilder(super.toString());
result.append(" (text: ");
result.append(text);
result.append(", textFormat: ");
result.append(textFormat);
result.append(')');
return result.toString();
}
} //TextAnnotationImpl
© 2015 - 2025 Weber Informatics LLC | Privacy Policy