protected void resolveFeature(final XAbstractFeatureCall featureCall, final JvmIdentifiableElement feature) { new PendingLinkingCandidateResolver<XAbstractFeatureCall>(featureCall).resolveLinkingProxy(((InternalEObject) featureCall), feature, XbasePackage.Literals.XABSTRACT_FEATURE_CALL__FEATURE, XbasePackage.XABSTRACT_FEATURE_CALL__FEATURE); }
protected AbstractPendingLinkingCandidate( Expression expression, IIdentifiableElementDescription description, ITypeExpectation expectation, ExpressionTypeComputationState state, PendingLinkingCandidateResolver<Expression> pendingLinkingCandidateResolver) { super(expression, expectation, state); this.description = description; this.pendingLinkingCandidateResolver = pendingLinkingCandidateResolver; }
protected void resolveLinkingProxy(EReference structuralFeature, int featureId) { InternalEObject internalView = (InternalEObject) getExpression(); JvmIdentifiableElement newFeature = getFeature(); if (newFeature.eIsProxy()) { newFeature = (JvmIdentifiableElement) internalView.eResolveProxy((InternalEObject) newFeature); } pendingLinkingCandidateResolver.resolveLinkingProxy(internalView, newFeature, structuralFeature, featureId); }
public void resolveLinkingProxy(InternalEObject owner, JvmIdentifiableElement newValue, EReference structuralFeature, int featureId) { EObject oldFeature = (EObject) owner.eGet(structuralFeature, false); if (oldFeature == null || !(oldFeature.eIsProxy())) { throw new IllegalStateException("Feature was already resolved to " + oldFeature); } if (owner.eNotificationRequired()) { boolean wasDeliver = owner.eDeliver(); owner.eSetDeliver(false); internalSetValue(owner, structuralFeature, newValue); owner.eSetDeliver(wasDeliver); if (newValue != oldFeature) { owner.eNotify(new ENotificationImpl(owner, Notification.RESOLVE, featureId, oldFeature, newValue)); } } else { internalSetValue(owner, structuralFeature, newValue); } }
@Override protected void internalSetValue(InternalEObject featureCall, EReference structuralFeature, JvmIdentifiableElement newValue) { super.internalSetValue(featureCall, structuralFeature, newValue); if (featureCall instanceof XFeatureCall) { XFeatureCall casted = (XFeatureCall) featureCall; if (casted != getExpression()) { casted.setPackageFragment(true); } else { casted.setTypeLiteral(true); } } else if (featureCall instanceof XMemberFeatureCall) { XMemberFeatureCall casted = (XMemberFeatureCall) featureCall; if (casted != getExpression()) { casted.setPackageFragment(true); } else { casted.setTypeLiteral(true); } XExpression target = casted.getMemberCallTarget(); IFeatureLinkingCandidate candidate = getLinkingCandidate(target); if (candidate == null || !candidate.isTypeLiteral()) { resolveLinkingProxy((InternalEObject) target, newValue, structuralFeature, XbasePackage.XABSTRACT_FEATURE_CALL__FEATURE); } } }