blob: 50f5090e8822153e9a5c162f1f1689ee1fe673e2 [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.Media;
import org.eclipse.osbp.xtext.reportdsl.MediaStyle;
import org.eclipse.osbp.xtext.reportdsl.ReportDSLPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Media Style</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.osbp.xtext.reportdsl.impl.MediaStyleImpl#getMedia <em>Media</em>}</li>
* </ul>
*
* @generated
*/
public class MediaStyleImpl extends BaseStyleImpl implements MediaStyle {
/**
* The cached value of the '{@link #getMedia() <em>Media</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMedia()
* @generated
* @ordered
*/
protected Media media;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected MediaStyleImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ReportDSLPackage.Literals.MEDIA_STYLE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Media getMedia() {
if (media != null && media.eIsProxy()) {
InternalEObject oldMedia = (InternalEObject)media;
media = (Media)eResolveProxy(oldMedia);
if (media != oldMedia) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, ReportDSLPackage.MEDIA_STYLE__MEDIA, oldMedia, media));
}
}
return media;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Media basicGetMedia() {
return media;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setMedia(Media newMedia) {
Media oldMedia = media;
media = newMedia;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ReportDSLPackage.MEDIA_STYLE__MEDIA, oldMedia, media));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ReportDSLPackage.MEDIA_STYLE__MEDIA:
if (resolve) return getMedia();
return basicGetMedia();
}
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.MEDIA_STYLE__MEDIA:
setMedia((Media)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ReportDSLPackage.MEDIA_STYLE__MEDIA:
setMedia((Media)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ReportDSLPackage.MEDIA_STYLE__MEDIA:
return media != null;
}
return super.eIsSet(featureID);
}
} //MediaStyleImpl