blob: 005262438e6666b16454d6a4d40e9badf0e448d9 [file] [log] [blame]
/**
* Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
* 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
*
* Based on ideas from Xtext, Xtend, Xcore
*
* Contributors:
* Christophe Loetz (Loetz GmbH&Co.KG) - Initial implementation
*
*/
package org.eclipse.osbp.xtext.reportdsl.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.osbp.xtext.reportdsl.ReportDSLPackage;
import org.eclipse.osbp.xtext.reportdsl.Text;
import org.eclipse.osbp.xtext.reportdsl.TextContentTypeEnum;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Text</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.osbp.xtext.reportdsl.impl.TextImpl#getTextContentType <em>Text Content Type</em>}</li>
* </ul>
*
* @generated
*/
public class TextImpl extends TextElementImpl implements Text {
/**
* The default value of the '{@link #getTextContentType() <em>Text Content Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTextContentType()
* @generated
* @ordered
*/
protected static final TextContentTypeEnum TEXT_CONTENT_TYPE_EDEFAULT = TextContentTypeEnum.AUTO;
/**
* The cached value of the '{@link #getTextContentType() <em>Text Content Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTextContentType()
* @generated
* @ordered
*/
protected TextContentTypeEnum textContentType = TEXT_CONTENT_TYPE_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected TextImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ReportDSLPackage.Literals.TEXT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public TextContentTypeEnum getTextContentType() {
return textContentType;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setTextContentType(TextContentTypeEnum newTextContentType) {
TextContentTypeEnum oldTextContentType = textContentType;
textContentType = newTextContentType == null ? TEXT_CONTENT_TYPE_EDEFAULT : newTextContentType;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ReportDSLPackage.TEXT__TEXT_CONTENT_TYPE, oldTextContentType, textContentType));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ReportDSLPackage.TEXT__TEXT_CONTENT_TYPE:
return getTextContentType();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ReportDSLPackage.TEXT__TEXT_CONTENT_TYPE:
setTextContentType((TextContentTypeEnum)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ReportDSLPackage.TEXT__TEXT_CONTENT_TYPE:
setTextContentType(TEXT_CONTENT_TYPE_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ReportDSLPackage.TEXT__TEXT_CONTENT_TYPE:
return textContentType != TEXT_CONTENT_TYPE_EDEFAULT;
}
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(" (textContentType: ");
result.append(textContentType);
result.append(')');
return result.toString();
}
} //TextImpl