blob: 0ae6168b34b02d94733d9530014c604f784e85b2 [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.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.osbp.xtext.reportdsl.ReportDSLPackage;
import org.eclipse.osbp.xtext.reportdsl.Style;
import org.eclipse.osbp.xtext.reportdsl.WithStyle;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>With Style</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.osbp.xtext.reportdsl.impl.WithStyleImpl#getStyle <em>Style</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class WithStyleImpl extends ReportLazyResolverImpl implements WithStyle {
/**
* The cached value of the '{@link #getStyle() <em>Style</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getStyle()
* @generated
* @ordered
*/
protected Style style;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected WithStyleImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ReportDSLPackage.Literals.WITH_STYLE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Style getStyle() {
if (style != null && style.eIsProxy()) {
InternalEObject oldStyle = (InternalEObject)style;
style = (Style)eResolveProxy(oldStyle);
if (style != oldStyle) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, ReportDSLPackage.WITH_STYLE__STYLE, oldStyle, style));
}
}
return style;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Style basicGetStyle() {
return style;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setStyle(Style newStyle) {
Style oldStyle = style;
style = newStyle;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ReportDSLPackage.WITH_STYLE__STYLE, oldStyle, style));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ReportDSLPackage.WITH_STYLE__STYLE:
if (resolve) return getStyle();
return basicGetStyle();
}
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.WITH_STYLE__STYLE:
setStyle((Style)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ReportDSLPackage.WITH_STYLE__STYLE:
setStyle((Style)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ReportDSLPackage.WITH_STYLE__STYLE:
return style != null;
}
return super.eIsSet(featureID);
}
} //WithStyleImpl