/******************************************************************************* * Copyright © 2008, 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.formatting.profile.impl; import org.eclipse.edt.ide.ui.internal.formatting.profile.Controls; import org.eclipse.edt.ide.ui.internal.formatting.profile.ProfilePackage; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.EObjectImpl; import org.eclipse.emf.ecore.util.BasicFeatureMap; import org.eclipse.emf.ecore.util.FeatureMap; import org.eclipse.emf.ecore.util.InternalEList; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Controls</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.eclipse.edt.ide.ui.internal.formatting.profile.impl.ControlsImpl#getControlGroup <em>Control Group</em>}</li> * <li>{@link org.eclipse.edt.ide.ui.internal.formatting.profile.impl.ControlsImpl#getControl <em>Control</em>}</li> * </ul> * </p> * * @generated */ public class ControlsImpl extends EObjectImpl implements Controls { /** * The cached value of the '{@link #getControlGroup() <em>Control Group</em>}' attribute list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getControlGroup() * @generated * @ordered */ protected FeatureMap controlGroup = null; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected ControlsImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected EClass eStaticClass() { return ProfilePackage.Literals.CONTROLS; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public FeatureMap getControlGroup() { if (controlGroup == null) { controlGroup = new BasicFeatureMap(this, ProfilePackage.CONTROLS__CONTROL_GROUP); } return controlGroup; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EList getControl() { return ((FeatureMap)getControlGroup()).list(ProfilePackage.Literals.CONTROLS__CONTROL); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case ProfilePackage.CONTROLS__CONTROL_GROUP: return ((InternalEList)getControlGroup()).basicRemove(otherEnd, msgs); case ProfilePackage.CONTROLS__CONTROL: return ((InternalEList)getControl()).basicRemove(otherEnd, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case ProfilePackage.CONTROLS__CONTROL_GROUP: if (coreType) return getControlGroup(); return ((FeatureMap.Internal)getControlGroup()).getWrapper(); case ProfilePackage.CONTROLS__CONTROL: return getControl(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void eSet(int featureID, Object newValue) { switch (featureID) { case ProfilePackage.CONTROLS__CONTROL_GROUP: ((FeatureMap.Internal)getControlGroup()).set(newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void eUnset(int featureID) { switch (featureID) { case ProfilePackage.CONTROLS__CONTROL_GROUP: getControlGroup().clear(); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean eIsSet(int featureID) { switch (featureID) { case ProfilePackage.CONTROLS__CONTROL_GROUP: return controlGroup != null && !controlGroup.isEmpty(); case ProfilePackage.CONTROLS__CONTROL: return !getControl().isEmpty(); } return super.eIsSet(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (controlGroup: "); result.append(controlGroup); result.append(')'); return result.toString(); } } //ControlsImpl