/*******************************************************************************
* Copyright © 2011, 2013 IBM Corporation 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:
* IBM Corporation - initial API and implementation
*
*******************************************************************************/
package org.eclipse.edt.ide.ui.internal.deployment.impl;
import org.eclipse.edt.ide.ui.internal.deployment.DeploymentPackage;
import org.eclipse.edt.ide.ui.internal.deployment.Parameters;
import org.eclipse.edt.ide.ui.internal.deployment.RUIHandler;
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.ecore.impl.EObjectImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>RUI Handler</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.edt.ide.ui.internal.deployment.impl.RUIHandlerImpl#getParameters <em>Parameters</em>}</li>
* <li>{@link org.eclipse.edt.ide.ui.internal.deployment.impl.RUIHandlerImpl#isEnableGeneration <em>Enable Generation</em>}</li>
* <li>{@link org.eclipse.edt.ide.ui.internal.deployment.impl.RUIHandlerImpl#getImplementation <em>Implementation</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class RUIHandlerImpl extends EObjectImpl implements RUIHandler
{
/**
* The cached value of the '{@link #getParameters() <em>Parameters</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getParameters()
* @generated
* @ordered
*/
protected Parameters parameters;
/**
* The default value of the '{@link #isEnableGeneration() <em>Enable Generation</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isEnableGeneration()
* @generated
* @ordered
*/
protected static final boolean ENABLE_GENERATION_EDEFAULT = true;
/**
* The cached value of the '{@link #isEnableGeneration() <em>Enable Generation</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isEnableGeneration()
* @generated
* @ordered
*/
protected boolean enableGeneration = ENABLE_GENERATION_EDEFAULT;
/**
* This is true if the Enable Generation attribute has been set.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
protected boolean enableGenerationESet;
/**
* The default value of the '{@link #getImplementation() <em>Implementation</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getImplementation()
* @generated
* @ordered
*/
protected static final String IMPLEMENTATION_EDEFAULT = null;
/**
* The cached value of the '{@link #getImplementation() <em>Implementation</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getImplementation()
* @generated
* @ordered
*/
protected String implementation = IMPLEMENTATION_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected RUIHandlerImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return DeploymentPackage.Literals.RUI_HANDLER;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Parameters getParameters()
{
return parameters;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetParameters(Parameters newParameters, NotificationChain msgs)
{
Parameters oldParameters = parameters;
parameters = newParameters;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DeploymentPackage.RUI_HANDLER__PARAMETERS, oldParameters, newParameters);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setParameters(Parameters newParameters)
{
if (newParameters != parameters)
{
NotificationChain msgs = null;
if (parameters != null)
msgs = ((InternalEObject)parameters).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DeploymentPackage.RUI_HANDLER__PARAMETERS, null, msgs);
if (newParameters != null)
msgs = ((InternalEObject)newParameters).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DeploymentPackage.RUI_HANDLER__PARAMETERS, null, msgs);
msgs = basicSetParameters(newParameters, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DeploymentPackage.RUI_HANDLER__PARAMETERS, newParameters, newParameters));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isEnableGeneration()
{
return enableGeneration;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setEnableGeneration(boolean newEnableGeneration)
{
boolean oldEnableGeneration = enableGeneration;
enableGeneration = newEnableGeneration;
boolean oldEnableGenerationESet = enableGenerationESet;
enableGenerationESet = true;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DeploymentPackage.RUI_HANDLER__ENABLE_GENERATION, oldEnableGeneration, enableGeneration, !oldEnableGenerationESet));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void unsetEnableGeneration()
{
boolean oldEnableGeneration = enableGeneration;
boolean oldEnableGenerationESet = enableGenerationESet;
enableGeneration = ENABLE_GENERATION_EDEFAULT;
enableGenerationESet = false;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.UNSET, DeploymentPackage.RUI_HANDLER__ENABLE_GENERATION, oldEnableGeneration, ENABLE_GENERATION_EDEFAULT, oldEnableGenerationESet));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isSetEnableGeneration()
{
return enableGenerationESet;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getImplementation()
{
return implementation;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setImplementation(String newImplementation)
{
String oldImplementation = implementation;
implementation = newImplementation;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DeploymentPackage.RUI_HANDLER__IMPLEMENTATION, oldImplementation, implementation));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case DeploymentPackage.RUI_HANDLER__PARAMETERS:
return basicSetParameters(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 DeploymentPackage.RUI_HANDLER__PARAMETERS:
return getParameters();
case DeploymentPackage.RUI_HANDLER__ENABLE_GENERATION:
return isEnableGeneration();
case DeploymentPackage.RUI_HANDLER__IMPLEMENTATION:
return getImplementation();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case DeploymentPackage.RUI_HANDLER__PARAMETERS:
setParameters((Parameters)newValue);
return;
case DeploymentPackage.RUI_HANDLER__ENABLE_GENERATION:
setEnableGeneration((Boolean)newValue);
return;
case DeploymentPackage.RUI_HANDLER__IMPLEMENTATION:
setImplementation((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case DeploymentPackage.RUI_HANDLER__PARAMETERS:
setParameters((Parameters)null);
return;
case DeploymentPackage.RUI_HANDLER__ENABLE_GENERATION:
unsetEnableGeneration();
return;
case DeploymentPackage.RUI_HANDLER__IMPLEMENTATION:
setImplementation(IMPLEMENTATION_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case DeploymentPackage.RUI_HANDLER__PARAMETERS:
return parameters != null;
case DeploymentPackage.RUI_HANDLER__ENABLE_GENERATION:
return isSetEnableGeneration();
case DeploymentPackage.RUI_HANDLER__IMPLEMENTATION:
return IMPLEMENTATION_EDEFAULT == null ? implementation != null : !IMPLEMENTATION_EDEFAULT.equals(implementation);
}
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(" (enableGeneration: ");
if (enableGenerationESet) result.append(enableGeneration); else result.append("<unset>");
result.append(", implementation: ");
result.append(implementation);
result.append(')');
return result.toString();
}
} //RUIHandlerImpl