| /******************************************************************************* |
| * 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.core.ecl.core.model.impl; |
| |
| import org.eclipse.rcptt.core.ecl.core.model.CreateReport; |
| import org.eclipse.rcptt.core.ecl.core.model.Q7CorePackage; |
| |
| import org.eclipse.rcptt.reporting.Q7Info; |
| |
| 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.rcptt.ecl.core.impl.CommandImpl; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Create Report</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.rcptt.core.ecl.core.model.impl.CreateReportImpl#getName <em>Name</em>}</li> |
| * <li>{@link org.eclipse.rcptt.core.ecl.core.model.impl.CreateReportImpl#getQ7info <em>Q7info</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class CreateReportImpl extends CommandImpl implements CreateReport { |
| /** |
| * The default value of the '{@link #getName() <em>Name</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getName() |
| * @generated |
| * @ordered |
| */ |
| protected static final String NAME_EDEFAULT = null; |
| /** |
| * The cached value of the '{@link #getName() <em>Name</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getName() |
| * @generated |
| * @ordered |
| */ |
| protected String name = NAME_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getQ7info() <em>Q7info</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getQ7info() |
| * @generated |
| * @ordered |
| */ |
| protected Q7Info q7info; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected CreateReportImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return Q7CorePackage.Literals.CREATE_REPORT; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getName() { |
| return name; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setName(String newName) { |
| String oldName = name; |
| name = newName; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, Q7CorePackage.CREATE_REPORT__NAME, oldName, name)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Q7Info getQ7info() { |
| if (q7info != null && q7info.eIsProxy()) { |
| InternalEObject oldQ7info = (InternalEObject)q7info; |
| q7info = (Q7Info)eResolveProxy(oldQ7info); |
| if (q7info != oldQ7info) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, Q7CorePackage.CREATE_REPORT__Q7INFO, oldQ7info, q7info)); |
| } |
| } |
| return q7info; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Q7Info basicGetQ7info() { |
| return q7info; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setQ7info(Q7Info newQ7info) { |
| Q7Info oldQ7info = q7info; |
| q7info = newQ7info; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, Q7CorePackage.CREATE_REPORT__Q7INFO, oldQ7info, q7info)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case Q7CorePackage.CREATE_REPORT__NAME: |
| return getName(); |
| case Q7CorePackage.CREATE_REPORT__Q7INFO: |
| if (resolve) return getQ7info(); |
| return basicGetQ7info(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case Q7CorePackage.CREATE_REPORT__NAME: |
| setName((String)newValue); |
| return; |
| case Q7CorePackage.CREATE_REPORT__Q7INFO: |
| setQ7info((Q7Info)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case Q7CorePackage.CREATE_REPORT__NAME: |
| setName(NAME_EDEFAULT); |
| return; |
| case Q7CorePackage.CREATE_REPORT__Q7INFO: |
| setQ7info((Q7Info)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case Q7CorePackage.CREATE_REPORT__NAME: |
| return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); |
| case Q7CorePackage.CREATE_REPORT__Q7INFO: |
| return q7info != null; |
| } |
| 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(" (name: "); |
| result.append(name); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //CreateReportImpl |