Java Code Examples for org.eclipse.emf.ecore.util.EcoreUtil.isAncestor()

The following are Jave code examples for showing how to use isAncestor() of the org.eclipse.emf.ecore.util.EcoreUtil class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: neoscada   File: MasterImportImpl.java   View Source Code Vote up 7 votes
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setMaster ( MasterServer newMaster )
{
    if ( newMaster != eInternalContainer () || ( eContainerFeatureID () != InfrastructurePackage.MASTER_IMPORT__MASTER && newMaster != null ) )
    {
        if ( EcoreUtil.isAncestor ( this, newMaster ) )
            throw new IllegalArgumentException ( "Recursive containment not allowed for " + toString () ); //$NON-NLS-1$
        NotificationChain msgs = null;
        if ( eInternalContainer () != null )
            msgs = eBasicRemoveFromContainer ( msgs );
        if ( newMaster != null )
            msgs = ( (InternalEObject)newMaster ).eInverseAdd ( this, InfrastructurePackage.MASTER_SERVER__IMPORT_MASTER, MasterServer.class, msgs );
        msgs = basicSetMaster ( newMaster, msgs );
        if ( msgs != null )
            msgs.dispatch ();
    }
    else if ( eNotificationRequired () )
        eNotify ( new ENotificationImpl ( this, Notification.SET, InfrastructurePackage.MASTER_IMPORT__MASTER, newMaster, newMaster ) );
}
 
Example 2
Project: n4js   File: N4GetterDeclarationImpl.java   View Source Code Vote up 6 votes
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setOwner(N4ClassifierDefinition newOwner) {
	if (newOwner != eInternalContainer() || (eContainerFeatureID() != N4JSPackage.N4_GETTER_DECLARATION__OWNER && newOwner != null)) {
		if (EcoreUtil.isAncestor(this, newOwner))
			throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
		NotificationChain msgs = null;
		if (eInternalContainer() != null)
			msgs = eBasicRemoveFromContainer(msgs);
		if (newOwner != null)
			msgs = ((InternalEObject)newOwner).eInverseAdd(this, N4JSPackage.N4_CLASSIFIER_DEFINITION__OWNED_MEMBERS_RAW, N4ClassifierDefinition.class, msgs);
		msgs = basicSetOwner(newOwner, msgs);
		if (msgs != null) msgs.dispatch();
	}
	else if (eNotificationRequired())
		eNotify(new ENotificationImpl(this, Notification.SET, N4JSPackage.N4_GETTER_DECLARATION__OWNER, newOwner, newOwner));
}
 
Example 3
Project: time4sys   File: EventImpl.java   View Source Code Vote up 6 votes
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setTrace(Trace newTrace) {
	if (newTrace != eInternalContainer() || (eContainerFeatureID() != TracePackage.EVENT__TRACE && newTrace != null)) {
		if (EcoreUtil.isAncestor(this, newTrace))
			throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
		NotificationChain msgs = null;
		if (eInternalContainer() != null)
			msgs = eBasicRemoveFromContainer(msgs);
		if (newTrace != null)
			msgs = ((InternalEObject)newTrace).eInverseAdd(this, TracePackage.TRACE__EVENTS, Trace.class, msgs);
		msgs = basicSetTrace(newTrace, msgs);
		if (msgs != null) msgs.dispatch();
	}
	else if (eNotificationRequired())
		eNotify(new ENotificationImpl(this, Notification.SET, TracePackage.EVENT__TRACE, newTrace, newTrace));
}
 
Example 4
Project: n4js   File: N4SetterDeclarationImpl.java   View Source Code Vote up 6 votes
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setOwner(N4ClassifierDefinition newOwner) {
	if (newOwner != eInternalContainer() || (eContainerFeatureID() != N4JSPackage.N4_SETTER_DECLARATION__OWNER && newOwner != null)) {
		if (EcoreUtil.isAncestor(this, newOwner))
			throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
		NotificationChain msgs = null;
		if (eInternalContainer() != null)
			msgs = eBasicRemoveFromContainer(msgs);
		if (newOwner != null)
			msgs = ((InternalEObject)newOwner).eInverseAdd(this, N4JSPackage.N4_CLASSIFIER_DEFINITION__OWNED_MEMBERS_RAW, N4ClassifierDefinition.class, msgs);
		msgs = basicSetOwner(newOwner, msgs);
		if (msgs != null) msgs.dispatch();
	}
	else if (eNotificationRequired())
		eNotify(new ENotificationImpl(this, Notification.SET, N4JSPackage.N4_SETTER_DECLARATION__OWNER, newOwner, newOwner));
}
 
Example 5
Project: n4js   File: N4MemberDeclarationImpl.java   View Source Code Vote up 6 votes
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setOwner(N4ClassifierDefinition newOwner) {
	if (newOwner != eInternalContainer() || (eContainerFeatureID() != N4JSPackage.N4_MEMBER_DECLARATION__OWNER && newOwner != null)) {
		if (EcoreUtil.isAncestor(this, newOwner))
			throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
		NotificationChain msgs = null;
		if (eInternalContainer() != null)
			msgs = eBasicRemoveFromContainer(msgs);
		if (newOwner != null)
			msgs = ((InternalEObject)newOwner).eInverseAdd(this, N4JSPackage.N4_CLASSIFIER_DEFINITION__OWNED_MEMBERS_RAW, N4ClassifierDefinition.class, msgs);
		msgs = basicSetOwner(newOwner, msgs);
		if (msgs != null) msgs.dispatch();
	}
	else if (eNotificationRequired())
		eNotify(new ENotificationImpl(this, Notification.SET, N4JSPackage.N4_MEMBER_DECLARATION__OWNER, newOwner, newOwner));
}
 
Example 6
Project: neoscada   File: DriverImpl.java   View Source Code Vote up 6 votes
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setNode ( SystemNode newNode )
{
    if ( newNode != eInternalContainer () || ( eContainerFeatureID () != InfrastructurePackage.DRIVER__NODE && newNode != null ) )
    {
        if ( EcoreUtil.isAncestor ( this, newNode ) )
            throw new IllegalArgumentException ( "Recursive containment not allowed for " + toString () ); //$NON-NLS-1$
        NotificationChain msgs = null;
        if ( eInternalContainer () != null )
            msgs = eBasicRemoveFromContainer ( msgs );
        if ( newNode != null )
            msgs = ( (InternalEObject)newNode ).eInverseAdd ( this, InfrastructurePackage.SYSTEM_NODE__DRIVERS, SystemNode.class, msgs );
        msgs = basicSetNode ( newNode, msgs );
        if ( msgs != null )
            msgs.dispatch ();
    }
    else if ( eNotificationRequired () )
        eNotify ( new ENotificationImpl ( this, Notification.SET, InfrastructurePackage.DRIVER__NODE, newNode, newNode ) );
}
 
Example 7
Project: neoscada   File: ComponentImpl.java   View Source Code Vote up 6 votes
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public void setLevel ( Level newLevel )
{
    if ( newLevel != eInternalContainer () || ( eContainerFeatureID () != ComponentPackage.COMPONENT__LEVEL && newLevel != null ) )
    {
        if ( EcoreUtil.isAncestor ( this, newLevel ) )
            throw new IllegalArgumentException ( "Recursive containment not allowed for " + toString () ); //$NON-NLS-1$
        NotificationChain msgs = null;
        if ( eInternalContainer () != null )
            msgs = eBasicRemoveFromContainer ( msgs );
        if ( newLevel != null )
            msgs = ( (InternalEObject)newLevel ).eInverseAdd ( this, ComponentPackage.LEVEL__COMPONENTS, Level.class, msgs );
        msgs = basicSetLevel ( newLevel, msgs );
        if ( msgs != null )
            msgs.dispatch ();
    }
    else if ( eNotificationRequired () )
        eNotify ( new ENotificationImpl ( this, Notification.SET, ComponentPackage.COMPONENT__LEVEL, newLevel, newLevel ) );
}
 
Example 8
Project: neoscada   File: StepImpl.java   View Source Code Vote up 6 votes
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setContainingPipeline ( CompositePipeline newContainingPipeline )
{
    if ( newContainingPipeline != eInternalContainer () || ( eContainerFeatureID () != ItemPackage.STEP__CONTAINING_PIPELINE && newContainingPipeline != null ) )
    {
        if ( EcoreUtil.isAncestor ( this, newContainingPipeline ) )
            throw new IllegalArgumentException ( "Recursive containment not allowed for " + toString () ); //$NON-NLS-1$
        NotificationChain msgs = null;
        if ( eInternalContainer () != null )
            msgs = eBasicRemoveFromContainer ( msgs );
        if ( newContainingPipeline != null )
            msgs = ( (InternalEObject)newContainingPipeline ).eInverseAdd ( this, ItemPackage.COMPOSITE_PIPELINE__STEPS, CompositePipeline.class, msgs );
        msgs = basicSetContainingPipeline ( newContainingPipeline, msgs );
        if ( msgs != null )
            msgs.dispatch ();
    }
    else if ( eNotificationRequired () )
        eNotify ( new ENotificationImpl ( this, Notification.SET, ItemPackage.STEP__CONTAINING_PIPELINE, newContainingPipeline, newContainingPipeline ) );
}
 
Example 9
Project: time4sys   File: SchedulerParameterValueImpl.java   View Source Code Vote up 6 votes
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setParent(SchedulableElement newParent) {
	if (newParent != eInternalContainer() || (eContainerFeatureID() != AnalysisPackage.SCHEDULER_PARAMETER_VALUE__PARENT && newParent != null)) {
		if (EcoreUtil.isAncestor(this, newParent))
			throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
		NotificationChain msgs = null;
		if (eInternalContainer() != null)
			msgs = eBasicRemoveFromContainer(msgs);
		if (newParent != null)
			msgs = ((InternalEObject)newParent).eInverseAdd(this, AnalysisPackage.SCHEDULABLE_ELEMENT__SCHEDULING_PARAMETERS, SchedulableElement.class, msgs);
		msgs = basicSetParent(newParent, msgs);
		if (msgs != null) msgs.dispatch();
	}
	else if (eNotificationRequired())
		eNotify(new ENotificationImpl(this, Notification.SET, AnalysisPackage.SCHEDULER_PARAMETER_VALUE__PARENT, newParent, newParent));
}
 
Example 10
Project: time4sys   File: OffsetImpl.java   View Source Code Vote up 6 votes
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setEventModel(EventModel newEventModel) {
	if (newEventModel != eInternalContainer() || (eContainerFeatureID() != AnalysisPackage.OFFSET__EVENT_MODEL && newEventModel != null)) {
		if (EcoreUtil.isAncestor(this, newEventModel))
			throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
		NotificationChain msgs = null;
		if (eInternalContainer() != null)
			msgs = eBasicRemoveFromContainer(msgs);
		if (newEventModel != null)
			msgs = ((InternalEObject)newEventModel).eInverseAdd(this, AnalysisPackage.EVENT_MODEL__OFFSETS, EventModel.class, msgs);
		msgs = basicSetEventModel(newEventModel, msgs);
		if (msgs != null) msgs.dispatch();
	}
	else if (eNotificationRequired())
		eNotify(new ENotificationImpl(this, Notification.SET, AnalysisPackage.OFFSET__EVENT_MODEL, newEventModel, newEventModel));
}
 
Example 11
Project: time4sys   File: EventModelImpl.java   View Source Code Vote up 6 votes
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setParent(EventModelContainer newParent) {
	if (newParent != eInternalContainer() || (eContainerFeatureID() != AnalysisPackage.EVENT_MODEL__PARENT && newParent != null)) {
		if (EcoreUtil.isAncestor(this, newParent))
			throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
		NotificationChain msgs = null;
		if (eInternalContainer() != null)
			msgs = eBasicRemoveFromContainer(msgs);
		if (newParent != null)
			msgs = ((InternalEObject)newParent).eInverseAdd(this, AnalysisPackage.EVENT_MODEL_CONTAINER__EVENT_MODEL, EventModelContainer.class, msgs);
		msgs = basicSetParent(newParent, msgs);
		if (msgs != null) msgs.dispatch();
	}
	else if (eNotificationRequired())
		eNotify(new ENotificationImpl(this, Notification.SET, AnalysisPackage.EVENT_MODEL__PARENT, newParent, newParent));
}
 
Example 12
Project: neoscada   File: ReleaseImpl.java   View Source Code Vote up 6 votes
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setVersion(Version newVersion) {
	if (newVersion != eInternalContainer() || (eContainerFeatureID() != WebPackage.RELEASE__VERSION && newVersion != null)) {
		if (EcoreUtil.isAncestor(this, newVersion))
			throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
		NotificationChain msgs = null;
		if (eInternalContainer() != null)
			msgs = eBasicRemoveFromContainer(msgs);
		if (newVersion != null)
			msgs = ((InternalEObject)newVersion).eInverseAdd(this, WebPackage.VERSION__RELEASES, Version.class, msgs);
		msgs = basicSetVersion(newVersion, msgs);
		if (msgs != null) msgs.dispatch();
	}
	else if (eNotificationRequired())
		eNotify(new ENotificationImpl(this, Notification.SET, WebPackage.RELEASE__VERSION, newVersion, newVersion));
}
 
Example 13
Project: OCCI-Studio   File: MixinBaseImpl.java   View Source Code Vote up 6 votes
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setEntity(Entity newEntity) {
	if (newEntity != eInternalContainer() || (eContainerFeatureID() != OCCIPackage.MIXIN_BASE__ENTITY && newEntity != null)) {
		if (EcoreUtil.isAncestor(this, newEntity))
			throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
		NotificationChain msgs = null;
		if (eInternalContainer() != null)
			msgs = eBasicRemoveFromContainer(msgs);
		if (newEntity != null)
			msgs = ((InternalEObject)newEntity).eInverseAdd(this, OCCIPackage.ENTITY__PARTS, Entity.class, msgs);
		msgs = basicSetEntity(newEntity, msgs);
		if (msgs != null) msgs.dispatch();
	}
	else if (eNotificationRequired())
		eNotify(new ENotificationImpl(this, Notification.SET, OCCIPackage.MIXIN_BASE__ENTITY, newEntity, newEntity));
}
 
Example 14
Project: gemoc-studio   File: StateImpl.java   View Source Code Vote up 6 votes
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setOwningFSM(StateMachine newOwningFSM) {
	if (newOwningFSM != eInternalContainer() || (eContainerFeatureID() != FsmPackage.STATE__OWNING_FSM && newOwningFSM != null)) {
		if (EcoreUtil.isAncestor(this, newOwningFSM))
			throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
		NotificationChain msgs = null;
		if (eInternalContainer() != null)
			msgs = eBasicRemoveFromContainer(msgs);
		if (newOwningFSM != null)
			msgs = ((InternalEObject)newOwningFSM).eInverseAdd(this, FsmPackage.STATE_MACHINE__OWNED_STATES, StateMachine.class, msgs);
		msgs = basicSetOwningFSM(newOwningFSM, msgs);
		if (msgs != null) msgs.dispatch();
	}
	else if (eNotificationRequired())
		eNotify(new ENotificationImpl(this, Notification.SET, FsmPackage.STATE__OWNING_FSM, newOwningFSM, newOwningFSM));
}
 
Example 15
Project: OCCI-Studio   File: StateImpl.java   View Source Code Vote up 6 votes
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setOwningFSM(FSM newOwningFSM) {
	if (newOwningFSM != eInternalContainer() || (eContainerFeatureID() != OCCIPackage.STATE__OWNING_FSM && newOwningFSM != null)) {
		if (EcoreUtil.isAncestor(this, newOwningFSM))
			throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
		NotificationChain msgs = null;
		if (eInternalContainer() != null)
			msgs = eBasicRemoveFromContainer(msgs);
		if (newOwningFSM != null)
			msgs = ((InternalEObject)newOwningFSM).eInverseAdd(this, OCCIPackage.FSM__OWNED_STATE, FSM.class, msgs);
		msgs = basicSetOwningFSM(newOwningFSM, msgs);
		if (msgs != null) msgs.dispatch();
	}
	else if (eNotificationRequired())
		eNotify(new ENotificationImpl(this, Notification.SET, OCCIPackage.STATE__OWNING_FSM, newOwningFSM, newOwningFSM));
}
 
Example 16
Project: neoscada   File: DeviceImpl.java   View Source Code Vote up 6 votes
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setNode ( Node newNode )
{
    if ( newNode != eInternalContainer () || ( eContainerFeatureID () != InfrastructurePackage.DEVICE__NODE && newNode != null ) )
    {
        if ( EcoreUtil.isAncestor ( this, newNode ) )
            throw new IllegalArgumentException ( "Recursive containment not allowed for " + toString () ); //$NON-NLS-1$
        NotificationChain msgs = null;
        if ( eInternalContainer () != null )
            msgs = eBasicRemoveFromContainer ( msgs );
        if ( newNode != null )
            msgs = ( (InternalEObject)newNode ).eInverseAdd ( this, InfrastructurePackage.NODE__DEVICES, Node.class, msgs );
        msgs = basicSetNode ( newNode, msgs );
        if ( msgs != null )
            msgs.dispatch ();
    }
    else if ( eNotificationRequired () )
        eNotify ( new ENotificationImpl ( this, Notification.SET, InfrastructurePackage.DEVICE__NODE, newNode, newNode ) );
}
 
Example 17
Project: neoscada   File: LevelImpl.java   View Source Code Vote up 6 votes
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setParent ( Level newParent )
{
    if ( newParent != eInternalContainer () || ( eContainerFeatureID () != ComponentPackage.LEVEL__PARENT && newParent != null ) )
    {
        if ( EcoreUtil.isAncestor ( this, newParent ) )
            throw new IllegalArgumentException ( "Recursive containment not allowed for " + toString () ); //$NON-NLS-1$
        NotificationChain msgs = null;
        if ( eInternalContainer () != null )
            msgs = eBasicRemoveFromContainer ( msgs );
        if ( newParent != null )
            msgs = ( (InternalEObject)newParent ).eInverseAdd ( this, ComponentPackage.LEVEL__LEVELS, Level.class, msgs );
        msgs = basicSetParent ( newParent, msgs );
        if ( msgs != null )
            msgs.dispatch ();
    }
    else if ( eNotificationRequired () )
        eNotify ( new ENotificationImpl ( this, Notification.SET, ComponentPackage.LEVEL__PARENT, newParent, newParent ) );
}
 
Example 18
Project: neoscada   File: InterfaceImpl.java   View Source Code Vote up 6 votes
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public void setProtocol ( Protocol newProtocol )
{
    if ( newProtocol != eInternalContainer () || ( eContainerFeatureID () != ProtocolPackage.INTERFACE__PROTOCOL && newProtocol != null ) )
    {
        if ( EcoreUtil.isAncestor ( this, newProtocol ) )
            throw new IllegalArgumentException ( "Recursive containment not allowed for " + toString () ); //$NON-NLS-1$
        NotificationChain msgs = null;
        if ( eInternalContainer () != null )
            msgs = eBasicRemoveFromContainer ( msgs );
        if ( newProtocol != null )
            msgs = ( (InternalEObject)newProtocol ).eInverseAdd ( this, ProtocolPackage.PROTOCOL__INTERFACES, Protocol.class, msgs );
        msgs = basicSetProtocol ( newProtocol, msgs );
        if ( msgs != null )
            msgs.dispatch ();
    }
    else if ( eNotificationRequired () )
        eNotify ( new ENotificationImpl ( this, Notification.SET, ProtocolPackage.INTERFACE__PROTOCOL, newProtocol, newProtocol ) );
}
 
Example 19
Project: xmontiarc   File: SubcomponentImpl.java   View Source Code Vote up 6 votes
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setParent(ComponentType newParent) {
	if (newParent != eInternalContainer() || (eContainerFeatureID() != XmontiarcPackage.SUBCOMPONENT__PARENT && newParent != null)) {
		if (EcoreUtil.isAncestor(this, newParent))
			throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
		NotificationChain msgs = null;
		if (eInternalContainer() != null)
			msgs = eBasicRemoveFromContainer(msgs);
		if (newParent != null)
			msgs = ((InternalEObject)newParent).eInverseAdd(this, XmontiarcPackage.COMPONENT_TYPE__SUBCOMPONENTS, ComponentType.class, msgs);
		msgs = basicSetParent(newParent, msgs);
		if (msgs != null) msgs.dispatch();
	}
	else if (eNotificationRequired())
		eNotify(new ENotificationImpl(this, Notification.SET, XmontiarcPackage.SUBCOMPONENT__PARENT, newParent, newParent));
}
 
Example 20
Project: time4sys   File: StimulusImpl.java   View Source Code Vote up 6 votes
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setParent(AnalyzedSystem newParent) {
	if (newParent != eInternalContainer() || (eContainerFeatureID() != AnalysisPackage.STIMULUS__PARENT && newParent != null)) {
		if (EcoreUtil.isAncestor(this, newParent))
			throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
		NotificationChain msgs = null;
		if (eInternalContainer() != null)
			msgs = eBasicRemoveFromContainer(msgs);
		if (newParent != null)
			msgs = ((InternalEObject)newParent).eInverseAdd(this, AnalysisPackage.ANALYZED_SYSTEM__STIMULI, AnalyzedSystem.class, msgs);
		msgs = basicSetParent(newParent, msgs);
		if (msgs != null) msgs.dispatch();
	}
	else if (eNotificationRequired())
		eNotify(new ENotificationImpl(this, Notification.SET, AnalysisPackage.STIMULUS__PARENT, newParent, newParent));
}