blob: fafc43eb3495fcf5957a0e7fc98caabe7ab35719 [file] [log] [blame]
/*
* Copyright (c) 2016 Eike Stepper (Loehne, Germany) and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v20.html
*
* Contributors:
* Eike Stepper - initial API and implementation
*/
package org.eclipse.oomph.targlets.impl;
import org.eclipse.oomph.targlets.DropinLocation;
import org.eclipse.oomph.targlets.TargletPackage;
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.MinimalEObjectImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Dropin Location</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.oomph.targlets.impl.DropinLocationImpl#getRootFolder <em>Root Folder</em>}</li>
* <li>{@link org.eclipse.oomph.targlets.impl.DropinLocationImpl#isRecursive <em>Recursive</em>}</li>
* </ul>
*
* @generated
*/
public class DropinLocationImpl extends MinimalEObjectImpl.Container implements DropinLocation
{
/**
* The default value of the '{@link #getRootFolder() <em>Root Folder</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getRootFolder()
* @generated
* @ordered
*/
protected static final String ROOT_FOLDER_EDEFAULT = null;
/**
* The cached value of the '{@link #getRootFolder() <em>Root Folder</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getRootFolder()
* @generated
* @ordered
*/
protected String rootFolder = ROOT_FOLDER_EDEFAULT;
/**
* The default value of the '{@link #isRecursive() <em>Recursive</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isRecursive()
* @generated
* @ordered
*/
protected static final boolean RECURSIVE_EDEFAULT = true;
/**
* The cached value of the '{@link #isRecursive() <em>Recursive</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isRecursive()
* @generated
* @ordered
*/
protected boolean recursive = RECURSIVE_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected DropinLocationImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return TargletPackage.Literals.DROPIN_LOCATION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getRootFolder()
{
return rootFolder;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setRootFolder(String newRootFolder)
{
String oldRootFolder = rootFolder;
rootFolder = newRootFolder;
if (eNotificationRequired())
{
eNotify(new ENotificationImpl(this, Notification.SET, TargletPackage.DROPIN_LOCATION__ROOT_FOLDER, oldRootFolder, rootFolder));
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isRecursive()
{
return recursive;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setRecursive(boolean newRecursive)
{
boolean oldRecursive = recursive;
recursive = newRecursive;
if (eNotificationRequired())
{
eNotify(new ENotificationImpl(this, Notification.SET, TargletPackage.DROPIN_LOCATION__RECURSIVE, oldRecursive, recursive));
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case TargletPackage.DROPIN_LOCATION__ROOT_FOLDER:
return getRootFolder();
case TargletPackage.DROPIN_LOCATION__RECURSIVE:
return isRecursive();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case TargletPackage.DROPIN_LOCATION__ROOT_FOLDER:
setRootFolder((String)newValue);
return;
case TargletPackage.DROPIN_LOCATION__RECURSIVE:
setRecursive((Boolean)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case TargletPackage.DROPIN_LOCATION__ROOT_FOLDER:
setRootFolder(ROOT_FOLDER_EDEFAULT);
return;
case TargletPackage.DROPIN_LOCATION__RECURSIVE:
setRecursive(RECURSIVE_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case TargletPackage.DROPIN_LOCATION__ROOT_FOLDER:
return ROOT_FOLDER_EDEFAULT == null ? rootFolder != null : !ROOT_FOLDER_EDEFAULT.equals(rootFolder);
case TargletPackage.DROPIN_LOCATION__RECURSIVE:
return recursive != RECURSIVE_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(" (rootFolder: ");
result.append(rootFolder);
result.append(", recursive: ");
result.append(recursive);
result.append(')');
return result.toString();
}
} // DropinLocationImpl