| /** |
| * <copyright> |
| * </copyright> |
| * |
| * $Id: WorkbenchModuleImpl.java,v 1.5 2005/01/26 16:48:35 cbridgha Exp $ |
| */ |
| package org.eclipse.wst.common.modulecore.impl; |
| |
| import java.util.Collection; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.common.util.EList; |
| import org.eclipse.emf.common.util.URI; |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.EStructuralFeature; |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.emf.ecore.impl.EObjectImpl; |
| import org.eclipse.emf.ecore.util.EObjectResolvingEList; |
| import org.eclipse.wst.common.modulecore.IModuleType; |
| import org.eclipse.wst.common.modulecore.ModuleCorePackage; |
| import org.eclipse.wst.common.modulecore.WorkbenchModule; |
| import org.eclipse.wst.common.modulecore.WorkbenchModuleResource; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Workbench Module</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.wst.common.modulecore.impl.WorkbenchModuleImpl#getHandle <em>Handle</em>}</li> |
| * <li>{@link org.eclipse.wst.common.modulecore.impl.WorkbenchModuleImpl#getDeployedPath <em>Deployed Path</em>}</li> |
| * <li>{@link org.eclipse.wst.common.modulecore.impl.WorkbenchModuleImpl#getModules <em>Modules</em>}</li> |
| * <li>{@link org.eclipse.wst.common.modulecore.impl.WorkbenchModuleImpl#getResources <em>Resources</em>}</li> |
| * <li>{@link org.eclipse.wst.common.modulecore.impl.WorkbenchModuleImpl#getModuleType <em>Module Type</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class WorkbenchModuleImpl extends EObjectImpl implements WorkbenchModule { |
| /** |
| * The default value of the '{@link #getHandle() <em>Handle</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getHandle() |
| * @generated |
| * @ordered |
| */ |
| protected static final URI HANDLE_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getHandle() <em>Handle</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getHandle() |
| * @generated |
| * @ordered |
| */ |
| protected URI handle = HANDLE_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getDeployedPath() <em>Deployed Path</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDeployedPath() |
| * @generated |
| * @ordered |
| */ |
| protected static final URI DEPLOYED_PATH_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getDeployedPath() <em>Deployed Path</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDeployedPath() |
| * @generated |
| * @ordered |
| */ |
| protected URI deployedPath = DEPLOYED_PATH_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getModules() <em>Modules</em>}' reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getModules() |
| * @generated |
| * @ordered |
| */ |
| protected EList modules = null; |
| |
| /** |
| * The cached value of the '{@link #getResources() <em>Resources</em>}' reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getResources() |
| * @generated |
| * @ordered |
| */ |
| protected EList resources = null; |
| |
| /** |
| * The cached value of the '{@link #getModuleType() <em>Module Type</em>}' reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getModuleType() |
| * @generated |
| * @ordered |
| */ |
| protected EList moduleType = null; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected WorkbenchModuleImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected EClass eStaticClass() { |
| return ModuleCorePackage.eINSTANCE.getWorkbenchModule(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public URI getHandle() { |
| return handle; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setHandle(URI newHandle) { |
| URI oldHandle = handle; |
| handle = newHandle; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ModuleCorePackage.WORKBENCH_MODULE__HANDLE, oldHandle, handle)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public URI getDeployedPath() { |
| return deployedPath; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setDeployedPath(URI newDeployedPath) { |
| URI oldDeployedPath = deployedPath; |
| deployedPath = newDeployedPath; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ModuleCorePackage.WORKBENCH_MODULE__DEPLOYED_PATH, oldDeployedPath, deployedPath)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList getModules() { |
| if (modules == null) { |
| modules = new EObjectResolvingEList(WorkbenchModule.class, this, ModuleCorePackage.WORKBENCH_MODULE__MODULES); |
| } |
| return modules; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList getResources() { |
| if (resources == null) { |
| resources = new EObjectResolvingEList(WorkbenchModuleResource.class, this, ModuleCorePackage.WORKBENCH_MODULE__RESOURCES); |
| } |
| return resources; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList getModuleType() { |
| if (moduleType == null) { |
| moduleType = new EObjectResolvingEList(IModuleType.class, this, ModuleCorePackage.WORKBENCH_MODULE__MODULE_TYPE); |
| } |
| return moduleType; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Object eGet(EStructuralFeature eFeature, boolean resolve) { |
| switch (eDerivedStructuralFeatureID(eFeature)) { |
| case ModuleCorePackage.WORKBENCH_MODULE__HANDLE: |
| return getHandle(); |
| case ModuleCorePackage.WORKBENCH_MODULE__DEPLOYED_PATH: |
| return getDeployedPath(); |
| case ModuleCorePackage.WORKBENCH_MODULE__MODULES: |
| return getModules(); |
| case ModuleCorePackage.WORKBENCH_MODULE__RESOURCES: |
| return getResources(); |
| case ModuleCorePackage.WORKBENCH_MODULE__MODULE_TYPE: |
| return getModuleType(); |
| } |
| return eDynamicGet(eFeature, resolve); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void eSet(EStructuralFeature eFeature, Object newValue) { |
| switch (eDerivedStructuralFeatureID(eFeature)) { |
| case ModuleCorePackage.WORKBENCH_MODULE__HANDLE: |
| setHandle((URI)newValue); |
| return; |
| case ModuleCorePackage.WORKBENCH_MODULE__DEPLOYED_PATH: |
| setDeployedPath((URI)newValue); |
| return; |
| case ModuleCorePackage.WORKBENCH_MODULE__MODULES: |
| getModules().clear(); |
| getModules().addAll((Collection)newValue); |
| return; |
| case ModuleCorePackage.WORKBENCH_MODULE__RESOURCES: |
| getResources().clear(); |
| getResources().addAll((Collection)newValue); |
| return; |
| case ModuleCorePackage.WORKBENCH_MODULE__MODULE_TYPE: |
| getModuleType().clear(); |
| getModuleType().addAll((Collection)newValue); |
| return; |
| } |
| eDynamicSet(eFeature, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void eUnset(EStructuralFeature eFeature) { |
| switch (eDerivedStructuralFeatureID(eFeature)) { |
| case ModuleCorePackage.WORKBENCH_MODULE__HANDLE: |
| setHandle(HANDLE_EDEFAULT); |
| return; |
| case ModuleCorePackage.WORKBENCH_MODULE__DEPLOYED_PATH: |
| setDeployedPath(DEPLOYED_PATH_EDEFAULT); |
| return; |
| case ModuleCorePackage.WORKBENCH_MODULE__MODULES: |
| getModules().clear(); |
| return; |
| case ModuleCorePackage.WORKBENCH_MODULE__RESOURCES: |
| getResources().clear(); |
| return; |
| case ModuleCorePackage.WORKBENCH_MODULE__MODULE_TYPE: |
| getModuleType().clear(); |
| return; |
| } |
| eDynamicUnset(eFeature); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean eIsSet(EStructuralFeature eFeature) { |
| switch (eDerivedStructuralFeatureID(eFeature)) { |
| case ModuleCorePackage.WORKBENCH_MODULE__HANDLE: |
| return HANDLE_EDEFAULT == null ? handle != null : !HANDLE_EDEFAULT.equals(handle); |
| case ModuleCorePackage.WORKBENCH_MODULE__DEPLOYED_PATH: |
| return DEPLOYED_PATH_EDEFAULT == null ? deployedPath != null : !DEPLOYED_PATH_EDEFAULT.equals(deployedPath); |
| case ModuleCorePackage.WORKBENCH_MODULE__MODULES: |
| return modules != null && !modules.isEmpty(); |
| case ModuleCorePackage.WORKBENCH_MODULE__RESOURCES: |
| return resources != null && !resources.isEmpty(); |
| case ModuleCorePackage.WORKBENCH_MODULE__MODULE_TYPE: |
| return moduleType != null && !moduleType.isEmpty(); |
| } |
| return eDynamicIsSet(eFeature); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuffer result = new StringBuffer(super.toString()); |
| result.append(" (handle: "); |
| result.append(handle); |
| result.append(", deployedPath: "); |
| result.append(deployedPath); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //WorkbenchModuleImpl |