Search in sources :

Example 41 with InternalEObject

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

the class MServoImpl method setMbrick.

/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * 
     * @generated
     */
@Override
public void setMbrick(MBrickServo newMbrick) {
    if (newMbrick != eInternalContainer() || (eContainerFeatureID() != ModelPackage.MSERVO__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.MSERVO__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 42 with InternalEObject

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

the class MDualRelayImpl method setMbrick.

/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * 
     * @generated
     */
@Override
public void setMbrick(MDualRelayBricklet newMbrick) {
    if (newMbrick != eInternalContainer() || (eContainerFeatureID() != ModelPackage.MDUAL_RELAY__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.MDUAL_RELAY__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 43 with InternalEObject

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

the class MBrickletVoltageCurrentImpl method setBrickd.

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

Example 44 with InternalEObject

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

the class MLCD20x4ButtonImpl method setTfConfig.

/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * 
     * @generated
     */
@Override
public void setTfConfig(ButtonConfiguration newTfConfig) {
    if (newTfConfig != tfConfig) {
        NotificationChain msgs = null;
        if (tfConfig != null)
            msgs = ((InternalEObject) tfConfig).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ModelPackage.MLCD2_0X4_BUTTON__TF_CONFIG, null, msgs);
        if (newTfConfig != null)
            msgs = ((InternalEObject) newTfConfig).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ModelPackage.MLCD2_0X4_BUTTON__TF_CONFIG, null, msgs);
        msgs = basicSetTfConfig(newTfConfig, msgs);
        if (msgs != null)
            msgs.dispatch();
    } else if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.MLCD2_0X4_BUTTON__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 45 with InternalEObject

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

the class DigitalSensorIO4Impl method setTfConfig.

/**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * 
     * @generated
     */
@Override
public void setTfConfig(TFIOSensorConfiguration newTfConfig) {
    if (newTfConfig != tfConfig) {
        NotificationChain msgs = null;
        if (tfConfig != null)
            msgs = ((InternalEObject) tfConfig).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ModelPackage.DIGITAL_SENSOR_IO4__TF_CONFIG, null, msgs);
        if (newTfConfig != null)
            msgs = ((InternalEObject) newTfConfig).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ModelPackage.DIGITAL_SENSOR_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_SENSOR_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)

Aggregations

InternalEObject (org.eclipse.emf.ecore.InternalEObject)1873 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)1807 NotificationChain (org.eclipse.emf.common.notify.NotificationChain)1330 URI (org.eclipse.emf.common.util.URI)44 EObject (org.eclipse.emf.ecore.EObject)41 Resource (org.eclipse.emf.ecore.resource.Resource)31 Test (org.junit.Test)10 EClass (org.eclipse.emf.ecore.EClass)8 EStructuralFeature (org.eclipse.emf.ecore.EStructuralFeature)6 XtextResource (org.eclipse.xtext.resource.XtextResource)6 ArrayList (java.util.ArrayList)4 IResourceDescription (org.eclipse.xtext.resource.IResourceDescription)4 ModelElement (orgomg.cwm.objectmodel.core.ModelElement)4 ResourceSet (org.eclipse.emf.ecore.resource.ResourceSet)3 InternalEList (org.eclipse.emf.ecore.util.InternalEList)3 INode (org.eclipse.xtext.nodemodel.INode)3 File (java.io.File)2 IOException (java.io.IOException)2 Iterator (java.util.Iterator)2 List (java.util.List)2