/** * <copyright> Copyright (c) 2008-2009 Jonas Helming, Maximilian Koegel. 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 </copyright> * * * */ package org.eclipse.emf.emfstore.server.model.operation.impl; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.emfstore.common.model.Project; import org.eclipse.emf.emfstore.server.model.ProjectInfo; import org.eclipse.emf.emfstore.server.model.operation.CreateProjectOperation; import org.eclipse.emf.emfstore.server.model.operation.OperationPackage; import org.eclipse.emf.emfstore.server.model.versioning.LogMessage; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Create Project Operation</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.eclipse.emf.emfstore.server.model.operation.impl.CreateProjectOperationImpl#getDescription <em>Description</em>}</li> * <li>{@link org.eclipse.emf.emfstore.server.model.operation.impl.CreateProjectOperationImpl#getProject <em>Project</em>}</li> * <li>{@link org.eclipse.emf.emfstore.server.model.operation.impl.CreateProjectOperationImpl#getLogMessage <em>Log Message</em>}</li> * <li>{@link org.eclipse.emf.emfstore.server.model.operation.impl.CreateProjectOperationImpl#getName <em>Name</em>}</li> * </ul> * </p> * * @generated */ public class CreateProjectOperationImpl extends OperationImpl<ProjectInfo> implements CreateProjectOperation { /** * The default value of the '{@link #getDescription() <em>Description</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getDescription() * @generated * @ordered */ protected static final String DESCRIPTION_EDEFAULT = null; /** * The cached value of the '{@link #getDescription() <em>Description</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getDescription() * @generated * @ordered */ protected String description = DESCRIPTION_EDEFAULT; /** * The cached value of the '{@link #getProject() <em>Project</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getProject() * @generated * @ordered */ protected Project project; /** * The cached value of the '{@link #getLogMessage() <em>Log Message</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getLogMessage() * @generated * @ordered */ protected LogMessage logMessage; /** * 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; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected CreateProjectOperationImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return OperationPackage.Literals.CREATE_PROJECT_OPERATION; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getDescription() { return description; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setDescription(String newDescription) { String oldDescription = description; description = newDescription; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, OperationPackage.CREATE_PROJECT_OPERATION__DESCRIPTION, oldDescription, description)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Project getProject() { if (project != null && project.eIsProxy()) { InternalEObject oldProject = (InternalEObject)project; project = (Project)eResolveProxy(oldProject); if (project != oldProject) { InternalEObject newProject = (InternalEObject)project; NotificationChain msgs = oldProject.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OperationPackage.CREATE_PROJECT_OPERATION__PROJECT, null, null); if (newProject.eInternalContainer() == null) { msgs = newProject.eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OperationPackage.CREATE_PROJECT_OPERATION__PROJECT, null, msgs); } if (msgs != null) msgs.dispatch(); if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, OperationPackage.CREATE_PROJECT_OPERATION__PROJECT, oldProject, project)); } } return project; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Project basicGetProject() { return project; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetProject(Project newProject, NotificationChain msgs) { Project oldProject = project; project = newProject; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OperationPackage.CREATE_PROJECT_OPERATION__PROJECT, oldProject, newProject); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setProject(Project newProject) { if (newProject != project) { NotificationChain msgs = null; if (project != null) msgs = ((InternalEObject)project).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OperationPackage.CREATE_PROJECT_OPERATION__PROJECT, null, msgs); if (newProject != null) msgs = ((InternalEObject)newProject).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OperationPackage.CREATE_PROJECT_OPERATION__PROJECT, null, msgs); msgs = basicSetProject(newProject, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, OperationPackage.CREATE_PROJECT_OPERATION__PROJECT, newProject, newProject)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public LogMessage getLogMessage() { if (logMessage != null && logMessage.eIsProxy()) { InternalEObject oldLogMessage = (InternalEObject)logMessage; logMessage = (LogMessage)eResolveProxy(oldLogMessage); if (logMessage != oldLogMessage) { InternalEObject newLogMessage = (InternalEObject)logMessage; NotificationChain msgs = oldLogMessage.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OperationPackage.CREATE_PROJECT_OPERATION__LOG_MESSAGE, null, null); if (newLogMessage.eInternalContainer() == null) { msgs = newLogMessage.eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OperationPackage.CREATE_PROJECT_OPERATION__LOG_MESSAGE, null, msgs); } if (msgs != null) msgs.dispatch(); if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, OperationPackage.CREATE_PROJECT_OPERATION__LOG_MESSAGE, oldLogMessage, logMessage)); } } return logMessage; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public LogMessage basicGetLogMessage() { return logMessage; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetLogMessage(LogMessage newLogMessage, NotificationChain msgs) { LogMessage oldLogMessage = logMessage; logMessage = newLogMessage; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OperationPackage.CREATE_PROJECT_OPERATION__LOG_MESSAGE, oldLogMessage, newLogMessage); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setLogMessage(LogMessage newLogMessage) { if (newLogMessage != logMessage) { NotificationChain msgs = null; if (logMessage != null) msgs = ((InternalEObject)logMessage).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OperationPackage.CREATE_PROJECT_OPERATION__LOG_MESSAGE, null, msgs); if (newLogMessage != null) msgs = ((InternalEObject)newLogMessage).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OperationPackage.CREATE_PROJECT_OPERATION__LOG_MESSAGE, null, msgs); msgs = basicSetLogMessage(newLogMessage, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, OperationPackage.CREATE_PROJECT_OPERATION__LOG_MESSAGE, newLogMessage, newLogMessage)); } /** * <!-- 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, OperationPackage.CREATE_PROJECT_OPERATION__NAME, oldName, name)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case OperationPackage.CREATE_PROJECT_OPERATION__PROJECT: return basicSetProject(null, msgs); case OperationPackage.CREATE_PROJECT_OPERATION__LOG_MESSAGE: return basicSetLogMessage(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case OperationPackage.CREATE_PROJECT_OPERATION__DESCRIPTION: return getDescription(); case OperationPackage.CREATE_PROJECT_OPERATION__PROJECT: if (resolve) return getProject(); return basicGetProject(); case OperationPackage.CREATE_PROJECT_OPERATION__LOG_MESSAGE: if (resolve) return getLogMessage(); return basicGetLogMessage(); case OperationPackage.CREATE_PROJECT_OPERATION__NAME: return getName(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case OperationPackage.CREATE_PROJECT_OPERATION__DESCRIPTION: setDescription((String)newValue); return; case OperationPackage.CREATE_PROJECT_OPERATION__PROJECT: setProject((Project)newValue); return; case OperationPackage.CREATE_PROJECT_OPERATION__LOG_MESSAGE: setLogMessage((LogMessage)newValue); return; case OperationPackage.CREATE_PROJECT_OPERATION__NAME: setName((String)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case OperationPackage.CREATE_PROJECT_OPERATION__DESCRIPTION: setDescription(DESCRIPTION_EDEFAULT); return; case OperationPackage.CREATE_PROJECT_OPERATION__PROJECT: setProject((Project)null); return; case OperationPackage.CREATE_PROJECT_OPERATION__LOG_MESSAGE: setLogMessage((LogMessage)null); return; case OperationPackage.CREATE_PROJECT_OPERATION__NAME: setName(NAME_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case OperationPackage.CREATE_PROJECT_OPERATION__DESCRIPTION: return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description); case OperationPackage.CREATE_PROJECT_OPERATION__PROJECT: return project != null; case OperationPackage.CREATE_PROJECT_OPERATION__LOG_MESSAGE: return logMessage != null; case OperationPackage.CREATE_PROJECT_OPERATION__NAME: return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); } 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(" (description: "); result.append(description); result.append(", name: "); result.append(name); result.append(')'); return result.toString(); } } //CreateProjectOperationImpl