use of org.eclipse.xtext.serializer.syntacticsequencertest.SingleCrossReference in project xtext-core by eclipse.
the class TokenSerializerTest method testConstructedCrossReferenceWithProxy.
@Test
public void testConstructedCrossReferenceWithProxy() {
final XtextResourceSet resourceSet = this.resourceSetProvider.get();
Resource _createResource = resourceSet.createResource(this.getFileURI("dummy"));
final XtextResource resource = ((XtextResource) _createResource);
Model _createModel = this.factory.createModel();
final Procedure1<Model> _function = (Model it) -> {
SingleCrossReference _createSingleCrossReference = this.factory.createSingleCrossReference();
final Procedure1<SingleCrossReference> _function_1 = (SingleCrossReference it_1) -> {
it_1.setName("myref");
};
SingleCrossReference _doubleArrow = ObjectExtensions.<SingleCrossReference>operator_doubleArrow(_createSingleCrossReference, _function_1);
it.setX5(_doubleArrow);
};
final Model model = ObjectExtensions.<Model>operator_doubleArrow(_createModel, _function);
EList<EObject> _contents = resource.getContents();
_contents.add(model);
SingleCrossReference _x5 = model.getX5();
SingleCrossReference _createSingleCrossReference = this.factory.createSingleCrossReference();
final Procedure1<SingleCrossReference> _function_1 = (SingleCrossReference it) -> {
((InternalEObject) it).eSetProxyURI(resource.getURI().appendFragment("foo"));
};
SingleCrossReference _doubleArrow = ObjectExtensions.<SingleCrossReference>operator_doubleArrow(_createSingleCrossReference, _function_1);
_x5.setRef3(_doubleArrow);
resource.setFragmentProvider(new DefaultFragmentProvider() {
@Override
public EObject getEObject(final Resource resource, final String fragment, final IFragmentProvider.Fallback fallback) {
EObject _xifexpression = null;
boolean _equals = Objects.equal(fragment, "foo");
if (_equals) {
_xifexpression = model.getX5();
} else {
_xifexpression = super.getEObject(resource, fragment, fallback);
}
return _xifexpression;
}
});
StringConcatenation _builder = new StringConcatenation();
_builder.append("#5 myref kw3 myref");
_builder.newLine();
this.assertSerializesTo(model, _builder);
}
use of org.eclipse.xtext.serializer.syntacticsequencertest.SingleCrossReference in project xtext-core by eclipse.
the class ModelImpl method basicSetX5.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetX5(SingleCrossReference newX5, NotificationChain msgs) {
SingleCrossReference oldX5 = x5;
x5 = newX5;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SyntacticsequencertestPackage.MODEL__X5, oldX5, newX5);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
use of org.eclipse.xtext.serializer.syntacticsequencertest.SingleCrossReference in project xtext-core by eclipse.
the class SingleCrossReferenceImpl method setRef2.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setRef2(SingleCrossReference newRef2) {
SingleCrossReference oldRef2 = ref2;
ref2 = newRef2;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SyntacticsequencertestPackage.SINGLE_CROSS_REFERENCE__REF2, oldRef2, ref2));
}
use of org.eclipse.xtext.serializer.syntacticsequencertest.SingleCrossReference in project xtext-core by eclipse.
the class SingleCrossReferenceImpl method setRef3.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setRef3(SingleCrossReference newRef3) {
SingleCrossReference oldRef3 = ref3;
ref3 = newRef3;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SyntacticsequencertestPackage.SINGLE_CROSS_REFERENCE__REF3, oldRef3, ref3));
}
use of org.eclipse.xtext.serializer.syntacticsequencertest.SingleCrossReference in project xtext-core by eclipse.
the class SingleCrossReferenceImpl method setRef4.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setRef4(SingleCrossReference newRef4) {
SingleCrossReference oldRef4 = ref4;
ref4 = newRef4;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SyntacticsequencertestPackage.SINGLE_CROSS_REFERENCE__REF4, oldRef4, ref4));
}
Aggregations