/******************************************************************************* * Copyright (c) 2006-2012 * Software Technology Group, Dresden University of Technology * DevBoost GmbH, Berlin, Amtsgericht Charlottenburg, HRB 140026 * * 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: * Software Technology Group - TU Dresden, Germany; * DevBoost GmbH - Berlin, Germany * - initial API and implementation ******************************************************************************/ /** * <copyright> * </copyright> * * $Id$ */ package org.oasisopen.names.tc.opendocument.xmlns.text.impl; 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; import org.oasisopen.names.tc.opendocument.xmlns.form.PropertiesType; import org.oasisopen.names.tc.opendocument.xmlns.office.EventListenersType; import org.oasisopen.names.tc.opendocument.xmlns.text.CommonFormControlContent; import org.oasisopen.names.tc.opendocument.xmlns.text.TextPackage; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Common Form Control Content</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.oasisopen.names.tc.opendocument.xmlns.text.impl.CommonFormControlContentImpl#getProperties <em>Properties</em>}</li> * <li>{@link org.oasisopen.names.tc.opendocument.xmlns.text.impl.CommonFormControlContentImpl#getEventListeners <em>Event Listeners</em>}</li> * </ul> * </p> * * @generated */ public class CommonFormControlContentImpl extends EObjectImpl implements CommonFormControlContent { /** * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getProperties() * @generated * @ordered */ protected PropertiesType properties; /** * The cached value of the '{@link #getEventListeners() <em>Event Listeners</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getEventListeners() * @generated * @ordered */ protected EventListenersType eventListeners; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected CommonFormControlContentImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return TextPackage.eINSTANCE.getCommonFormControlContent(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public PropertiesType getProperties() { return properties; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetProperties(PropertiesType newProperties, NotificationChain msgs) { PropertiesType oldProperties = properties; properties = newProperties; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, TextPackage.COMMON_FORM_CONTROL_CONTENT__PROPERTIES, oldProperties, newProperties); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setProperties(PropertiesType newProperties) { if (newProperties != properties) { NotificationChain msgs = null; if (properties != null) msgs = ((InternalEObject)properties).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - TextPackage.COMMON_FORM_CONTROL_CONTENT__PROPERTIES, null, msgs); if (newProperties != null) msgs = ((InternalEObject)newProperties).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - TextPackage.COMMON_FORM_CONTROL_CONTENT__PROPERTIES, null, msgs); msgs = basicSetProperties(newProperties, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, TextPackage.COMMON_FORM_CONTROL_CONTENT__PROPERTIES, newProperties, newProperties)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EventListenersType getEventListeners() { return eventListeners; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NotificationChain basicSetEventListeners(EventListenersType newEventListeners, NotificationChain msgs) { EventListenersType oldEventListeners = eventListeners; eventListeners = newEventListeners; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, TextPackage.COMMON_FORM_CONTROL_CONTENT__EVENT_LISTENERS, oldEventListeners, newEventListeners); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setEventListeners(EventListenersType newEventListeners) { if (newEventListeners != eventListeners) { NotificationChain msgs = null; if (eventListeners != null) msgs = ((InternalEObject)eventListeners).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - TextPackage.COMMON_FORM_CONTROL_CONTENT__EVENT_LISTENERS, null, msgs); if (newEventListeners != null) msgs = ((InternalEObject)newEventListeners).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - TextPackage.COMMON_FORM_CONTROL_CONTENT__EVENT_LISTENERS, null, msgs); msgs = basicSetEventListeners(newEventListeners, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, TextPackage.COMMON_FORM_CONTROL_CONTENT__EVENT_LISTENERS, newEventListeners, newEventListeners)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case TextPackage.COMMON_FORM_CONTROL_CONTENT__PROPERTIES: return basicSetProperties(null, msgs); case TextPackage.COMMON_FORM_CONTROL_CONTENT__EVENT_LISTENERS: return basicSetEventListeners(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 TextPackage.COMMON_FORM_CONTROL_CONTENT__PROPERTIES: return getProperties(); case TextPackage.COMMON_FORM_CONTROL_CONTENT__EVENT_LISTENERS: return getEventListeners(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case TextPackage.COMMON_FORM_CONTROL_CONTENT__PROPERTIES: setProperties((PropertiesType)newValue); return; case TextPackage.COMMON_FORM_CONTROL_CONTENT__EVENT_LISTENERS: setEventListeners((EventListenersType)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case TextPackage.COMMON_FORM_CONTROL_CONTENT__PROPERTIES: setProperties((PropertiesType)null); return; case TextPackage.COMMON_FORM_CONTROL_CONTENT__EVENT_LISTENERS: setEventListeners((EventListenersType)null); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case TextPackage.COMMON_FORM_CONTROL_CONTENT__PROPERTIES: return properties != null; case TextPackage.COMMON_FORM_CONTROL_CONTENT__EVENT_LISTENERS: return eventListeners != null; } return super.eIsSet(featureID); } } //CommonFormControlContentImpl