Search in sources :

Example 71 with InternalEObject

use of org.eclipse.emf.ecore.InternalEObject in project openhab1-addons by openhab.

the class ColorLedImpl method setMbrick.

/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * 
     * @generated
     */
@Override
public void setMbrick(MBrickletColor newMbrick) {
    if (newMbrick != eInternalContainer() || (eContainerFeatureID() != ModelPackage.COLOR_LED__MBRICK && newMbrick != null)) {
        if (EcoreUtil.isAncestor(this, newMbrick))
            throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
        NotificationChain msgs = null;
        if (eInternalContainer() != null)
            msgs = eBasicRemoveFromContainer(msgs);
        if (newMbrick != null)
            msgs = ((InternalEObject) newMbrick).eInverseAdd(this, ModelPackage.MSUB_DEVICE_HOLDER__MSUBDEVICES, MSubDeviceHolder.class, msgs);
        msgs = basicSetMbrick(newMbrick, msgs);
        if (msgs != null)
            msgs.dispatch();
    } else if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.COLOR_LED__MBRICK, newMbrick, newMbrick));
}
Also used : NotificationChain(org.eclipse.emf.common.notify.NotificationChain) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) InternalEObject(org.eclipse.emf.ecore.InternalEObject)

Example 72 with InternalEObject

use of org.eclipse.emf.ecore.InternalEObject in project openhab1-addons by openhab.

the class AccelerometerTemperatureImpl method setMbrick.

/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * 
     * @generated
     */
@Override
public void setMbrick(MBrickletAccelerometer newMbrick) {
    if (newMbrick != eInternalContainer() || (eContainerFeatureID() != ModelPackage.ACCELEROMETER_TEMPERATURE__MBRICK && newMbrick != null)) {
        if (EcoreUtil.isAncestor(this, newMbrick))
            throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
        NotificationChain msgs = null;
        if (eInternalContainer() != null)
            msgs = eBasicRemoveFromContainer(msgs);
        if (newMbrick != null)
            msgs = ((InternalEObject) newMbrick).eInverseAdd(this, ModelPackage.MSUB_DEVICE_HOLDER__MSUBDEVICES, MSubDeviceHolder.class, msgs);
        msgs = basicSetMbrick(newMbrick, msgs);
        if (msgs != null)
            msgs.dispatch();
    } else if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.ACCELEROMETER_TEMPERATURE__MBRICK, newMbrick, newMbrick));
}
Also used : NotificationChain(org.eclipse.emf.common.notify.NotificationChain) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) InternalEObject(org.eclipse.emf.ecore.InternalEObject)

Example 73 with InternalEObject

use of org.eclipse.emf.ecore.InternalEObject in project openhab1-addons by openhab.

the class DigitalActorIO16Impl method setMbrick.

/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * 
     * @generated
     */
@Override
public void setMbrick(MBrickletIO16 newMbrick) {
    if (newMbrick != eInternalContainer() || (eContainerFeatureID() != ModelPackage.DIGITAL_ACTOR_IO16__MBRICK && newMbrick != null)) {
        if (EcoreUtil.isAncestor(this, newMbrick))
            throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
        NotificationChain msgs = null;
        if (eInternalContainer() != null)
            msgs = eBasicRemoveFromContainer(msgs);
        if (newMbrick != null)
            msgs = ((InternalEObject) newMbrick).eInverseAdd(this, ModelPackage.MSUB_DEVICE_HOLDER__MSUBDEVICES, MSubDeviceHolder.class, msgs);
        msgs = basicSetMbrick(newMbrick, msgs);
        if (msgs != null)
            msgs.dispatch();
    } else if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.DIGITAL_ACTOR_IO16__MBRICK, newMbrick, newMbrick));
}
Also used : NotificationChain(org.eclipse.emf.common.notify.NotificationChain) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) InternalEObject(org.eclipse.emf.ecore.InternalEObject)

Example 74 with InternalEObject

use of org.eclipse.emf.ecore.InternalEObject in project openhab1-addons by openhab.

the class DigitalActorIO4Impl method setTfConfig.

/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * 
     * @generated
     */
@Override
public void setTfConfig(TFIOActorConfiguration newTfConfig) {
    if (newTfConfig != tfConfig) {
        NotificationChain msgs = null;
        if (tfConfig != null)
            msgs = ((InternalEObject) tfConfig).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ModelPackage.DIGITAL_ACTOR_IO4__TF_CONFIG, null, msgs);
        if (newTfConfig != null)
            msgs = ((InternalEObject) newTfConfig).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ModelPackage.DIGITAL_ACTOR_IO4__TF_CONFIG, null, msgs);
        msgs = basicSetTfConfig(newTfConfig, msgs);
        if (msgs != null)
            msgs.dispatch();
    } else if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.DIGITAL_ACTOR_IO4__TF_CONFIG, newTfConfig, newTfConfig));
}
Also used : NotificationChain(org.eclipse.emf.common.notify.NotificationChain) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) InternalEObject(org.eclipse.emf.ecore.InternalEObject)

Example 75 with InternalEObject

use of org.eclipse.emf.ecore.InternalEObject in project openhab1-addons by openhab.

the class AmbientTemperatureImpl method setTfConfig.

/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * 
     * @generated
     */
@Override
public void setTfConfig(TFBaseConfiguration newTfConfig) {
    if (newTfConfig != tfConfig) {
        NotificationChain msgs = null;
        if (tfConfig != null)
            msgs = ((InternalEObject) tfConfig).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ModelPackage.AMBIENT_TEMPERATURE__TF_CONFIG, null, msgs);
        if (newTfConfig != null)
            msgs = ((InternalEObject) newTfConfig).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ModelPackage.AMBIENT_TEMPERATURE__TF_CONFIG, null, msgs);
        msgs = basicSetTfConfig(newTfConfig, msgs);
        if (msgs != null)
            msgs.dispatch();
    } else if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.AMBIENT_TEMPERATURE__TF_CONFIG, newTfConfig, newTfConfig));
}
Also used : NotificationChain(org.eclipse.emf.common.notify.NotificationChain) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) InternalEObject(org.eclipse.emf.ecore.InternalEObject)

Aggregations

InternalEObject (org.eclipse.emf.ecore.InternalEObject)791 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)761 NotificationChain (org.eclipse.emf.common.notify.NotificationChain)607 EObject (org.eclipse.emf.ecore.EObject)12 URI (org.eclipse.emf.common.util.URI)11 EClass (org.eclipse.emf.ecore.EClass)6 Resource (org.eclipse.emf.ecore.resource.Resource)6 XtextResource (org.eclipse.xtext.resource.XtextResource)6 Test (org.junit.Test)5 INode (org.eclipse.xtext.nodemodel.INode)4 ArrayList (java.util.ArrayList)3 EPackage (org.eclipse.emf.ecore.EPackage)3 EClassifier (org.eclipse.emf.ecore.EClassifier)2 EReference (org.eclipse.emf.ecore.EReference)2 EStructuralFeature (org.eclipse.emf.ecore.EStructuralFeature)2 BinaryResourceImpl (org.eclipse.emf.ecore.resource.impl.BinaryResourceImpl)2 InternalEList (org.eclipse.emf.ecore.util.InternalEList)2 Grammar (org.eclipse.xtext.Grammar)2 JvmAnnotationType (org.eclipse.xtext.common.types.JvmAnnotationType)2 IResourceDescription (org.eclipse.xtext.resource.IResourceDescription)2