| /******************************************************************************* |
| * Copyright (c) 2009, 2014 Xored Software Inc and others. |
| * 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: |
| * Xored Software Inc - initial API and implementation and/or initial documentation |
| *******************************************************************************/ |
| package org.eclipse.rcptt.sherlock.core.model.sherlock.report.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.emf.ecore.impl.EObjectImpl; |
| |
| import org.eclipse.rcptt.sherlock.core.model.sherlock.report.LoggingCategory; |
| import org.eclipse.rcptt.sherlock.core.model.sherlock.report.LoggingData; |
| import org.eclipse.rcptt.sherlock.core.model.sherlock.report.ReportPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Logging Data</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.rcptt.sherlock.core.model.sherlock.report.impl.LoggingDataImpl#getText <em>Text</em>}</li> |
| * <li>{@link org.eclipse.rcptt.sherlock.core.model.sherlock.report.impl.LoggingDataImpl#getCategory <em>Category</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class LoggingDataImpl extends EObjectImpl implements LoggingData { |
| /** |
| * The default value of the '{@link #getText() <em>Text</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getText() |
| * @generated |
| * @ordered |
| */ |
| protected static final String TEXT_EDEFAULT = ""; |
| |
| /** |
| * The cached value of the '{@link #getText() <em>Text</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getText() |
| * @generated |
| * @ordered |
| */ |
| protected String text = TEXT_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getCategory() <em>Category</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getCategory() |
| * @generated |
| * @ordered |
| */ |
| protected static final LoggingCategory CATEGORY_EDEFAULT = LoggingCategory.DEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getCategory() <em>Category</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getCategory() |
| * @generated |
| * @ordered |
| */ |
| protected LoggingCategory category = CATEGORY_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected LoggingDataImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return ReportPackage.Literals.LOGGING_DATA; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getText() { |
| return text; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setText(String newText) { |
| String oldText = text; |
| text = newText; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ReportPackage.LOGGING_DATA__TEXT, oldText, text)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public LoggingCategory getCategory() { |
| return category; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setCategory(LoggingCategory newCategory) { |
| LoggingCategory oldCategory = category; |
| category = newCategory == null ? CATEGORY_EDEFAULT : newCategory; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ReportPackage.LOGGING_DATA__CATEGORY, oldCategory, category)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case ReportPackage.LOGGING_DATA__TEXT: |
| return getText(); |
| case ReportPackage.LOGGING_DATA__CATEGORY: |
| return getCategory(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case ReportPackage.LOGGING_DATA__TEXT: |
| setText((String)newValue); |
| return; |
| case ReportPackage.LOGGING_DATA__CATEGORY: |
| setCategory((LoggingCategory)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case ReportPackage.LOGGING_DATA__TEXT: |
| setText(TEXT_EDEFAULT); |
| return; |
| case ReportPackage.LOGGING_DATA__CATEGORY: |
| setCategory(CATEGORY_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case ReportPackage.LOGGING_DATA__TEXT: |
| return TEXT_EDEFAULT == null ? text != null : !TEXT_EDEFAULT.equals(text); |
| case ReportPackage.LOGGING_DATA__CATEGORY: |
| return category != CATEGORY_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(" (text: "); |
| result.append(text); |
| result.append(", category: "); |
| result.append(category); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //LoggingDataImpl |