當前位置: 首頁>>代碼示例>>Java>>正文


Java EcoreUtil.isAncestor方法代碼示例

本文整理匯總了Java中org.eclipse.emf.ecore.util.EcoreUtil.isAncestor方法的典型用法代碼示例。如果您正苦於以下問題:Java EcoreUtil.isAncestor方法的具體用法?Java EcoreUtil.isAncestor怎麽用?Java EcoreUtil.isAncestor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.emf.ecore.util.EcoreUtil的用法示例。


在下文中一共展示了EcoreUtil.isAncestor方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setMaster

import org.eclipse.emf.ecore.util.EcoreUtil; //導入方法依賴的package包/類
/**
 * <!-- 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 ) );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:24,代碼來源:MasterImportImpl.java

示例2: setOwner

import org.eclipse.emf.ecore.util.EcoreUtil; //導入方法依賴的package包/類
/**
 * <!-- 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));
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:21,代碼來源:N4GetterDeclarationImpl.java

示例3: setTrace

import org.eclipse.emf.ecore.util.EcoreUtil; //導入方法依賴的package包/類
/**
 * <!-- 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));
}
 
開發者ID:polarsys,項目名稱:time4sys,代碼行數:21,代碼來源:EventImpl.java

示例4: setOwner

import org.eclipse.emf.ecore.util.EcoreUtil; //導入方法依賴的package包/類
/**
 * <!-- 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));
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:21,代碼來源:N4SetterDeclarationImpl.java

示例5: setOwner

import org.eclipse.emf.ecore.util.EcoreUtil; //導入方法依賴的package包/類
/**
 * <!-- 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));
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:21,代碼來源:N4MemberDeclarationImpl.java

示例6: setNode

import org.eclipse.emf.ecore.util.EcoreUtil; //導入方法依賴的package包/類
/**
 * <!-- 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 ) );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:24,代碼來源:DriverImpl.java

示例7: setLevel

import org.eclipse.emf.ecore.util.EcoreUtil; //導入方法依賴的package包/類
/**
 * <!-- 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 ) );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:25,代碼來源:ComponentImpl.java

示例8: setContainingPipeline

import org.eclipse.emf.ecore.util.EcoreUtil; //導入方法依賴的package包/類
/**
 * <!-- 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 ) );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:24,代碼來源:StepImpl.java

示例9: setParent

import org.eclipse.emf.ecore.util.EcoreUtil; //導入方法依賴的package包/類
/**
 * <!-- 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));
}
 
開發者ID:polarsys,項目名稱:time4sys,代碼行數:21,代碼來源:SchedulerParameterValueImpl.java

示例10: setEventModel

import org.eclipse.emf.ecore.util.EcoreUtil; //導入方法依賴的package包/類
/**
 * <!-- 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));
}
 
開發者ID:polarsys,項目名稱:time4sys,代碼行數:21,代碼來源:OffsetImpl.java

示例11: setParent

import org.eclipse.emf.ecore.util.EcoreUtil; //導入方法依賴的package包/類
/**
 * <!-- 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));
}
 
開發者ID:polarsys,項目名稱:time4sys,代碼行數:21,代碼來源:EventModelImpl.java

示例12: setVersion

import org.eclipse.emf.ecore.util.EcoreUtil; //導入方法依賴的package包/類
/**
 * <!-- 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));
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:21,代碼來源:ReleaseImpl.java

示例13: setEntity

import org.eclipse.emf.ecore.util.EcoreUtil; //導入方法依賴的package包/類
/**
 * <!-- 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));
}
 
開發者ID:occiware,項目名稱:OCCI-Studio,代碼行數:21,代碼來源:MixinBaseImpl.java

示例14: setOwningFSM

import org.eclipse.emf.ecore.util.EcoreUtil; //導入方法依賴的package包/類
/**
 * <!-- 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));
}
 
開發者ID:eclipse,項目名稱:gemoc-studio,代碼行數:21,代碼來源:StateImpl.java

示例15: setOwningFSM

import org.eclipse.emf.ecore.util.EcoreUtil; //導入方法依賴的package包/類
/**
 * <!-- 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));
}
 
開發者ID:occiware,項目名稱:OCCI-Studio,代碼行數:21,代碼來源:StateImpl.java


注:本文中的org.eclipse.emf.ecore.util.EcoreUtil.isAncestor方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。