/******************************************************************************* | |
* Copyright (c) 2011, 2013 Formal Mind GmbH and University of Dusseldorf. | |
* 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: | |
* Michael Jastram - initial API and implementation | |
******************************************************************************/ | |
package org.eclipse.rmf.reqif10.pror.configuration.impl; | |
import java.util.Collection; | |
import org.eclipse.emf.common.util.EList; | |
import org.eclipse.emf.ecore.EClass; | |
import org.eclipse.emf.ecore.impl.EObjectImpl; | |
import org.eclipse.emf.ecore.util.EDataTypeUniqueEList; | |
import org.eclipse.emf.ecore.util.InternalEList; | |
import org.eclipse.rmf.reqif10.pror.configuration.ConfigurationPackage; | |
import org.eclipse.rmf.reqif10.pror.configuration.LabelConfiguration; | |
/** | |
* <!-- begin-user-doc --> | |
* An implementation of the model object '<em><b>Label Configuration</b></em>'. | |
* <!-- end-user-doc --> | |
* <p> | |
* The following features are implemented: | |
* <ul> | |
* <li>{@link org.eclipse.rmf.reqif10.pror.configuration.impl.LabelConfigurationImpl#getDefaultLabel <em>Default Label</em>}</li> | |
* </ul> | |
* </p> | |
* | |
* @generated | |
*/ | |
public class LabelConfigurationImpl extends EObjectImpl implements LabelConfiguration { | |
/** | |
* The cached value of the '{@link #getDefaultLabel() <em>Default Label</em>}' attribute list. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getDefaultLabel() | |
* @generated | |
* @ordered | |
*/ | |
protected EList<String> defaultLabel; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
protected LabelConfigurationImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() { | |
return ConfigurationPackage.Literals.LABEL_CONFIGURATION; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public EList<String> getDefaultLabel() { | |
if (defaultLabel == null) { | |
defaultLabel = new EDataTypeUniqueEList.Unsettable<String>(String.class, this, ConfigurationPackage.LABEL_CONFIGURATION__DEFAULT_LABEL); | |
} | |
return defaultLabel; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void unsetDefaultLabel() { | |
if (defaultLabel != null) ((InternalEList.Unsettable<?>)defaultLabel).unset(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public boolean isSetDefaultLabel() { | |
return defaultLabel != null && ((InternalEList.Unsettable<?>)defaultLabel).isSet(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public Object eGet(int featureID, boolean resolve, boolean coreType) { | |
switch (featureID) { | |
case ConfigurationPackage.LABEL_CONFIGURATION__DEFAULT_LABEL: | |
return getDefaultLabel(); | |
} | |
return super.eGet(featureID, resolve, coreType); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@SuppressWarnings("unchecked") | |
@Override | |
public void eSet(int featureID, Object newValue) { | |
switch (featureID) { | |
case ConfigurationPackage.LABEL_CONFIGURATION__DEFAULT_LABEL: | |
getDefaultLabel().clear(); | |
getDefaultLabel().addAll((Collection<? extends String>)newValue); | |
return; | |
} | |
super.eSet(featureID, newValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eUnset(int featureID) { | |
switch (featureID) { | |
case ConfigurationPackage.LABEL_CONFIGURATION__DEFAULT_LABEL: | |
unsetDefaultLabel(); | |
return; | |
} | |
super.eUnset(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean eIsSet(int featureID) { | |
switch (featureID) { | |
case ConfigurationPackage.LABEL_CONFIGURATION__DEFAULT_LABEL: | |
return isSetDefaultLabel(); | |
} | |
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(" (defaultLabel: "); | |
result.append(defaultLabel); | |
result.append(')'); | |
return result.toString(); | |
} | |
} //LabelConfigurationImpl |