use of org.eclipse.xtext.ui.tests.foo.Stuff in project xtext-eclipse by eclipse.
the class AbstractScopeResourceDescriptionsTest method assertLiveModelScopeExternalFile.
protected void assertLiveModelScopeExternalFile(boolean enabled) throws CoreException, InvocationTargetException, InterruptedException {
String pathName = "test/test." + fileExt.getPrimaryFileExtension();
String pathName2 = "test/test2." + fileExt.getPrimaryFileExtension();
String model = "stuff A refs B";
createFile(pathName, model);
createFile(pathName2, "stuff B");
waitForBuild();
final URI resourceURI = URI.createPlatformResourceURI(pathName, true);
Resource resource = resourceSet.getResource(resourceURI, true);
assertExportedObject(resource, "A");
Stuff elementA = ((File) resource.getContents().get(0)).getStuff().get(0);
Stuff elementB = elementA.getRefs();
assertFalse(elementB.eIsProxy());
elementA.setName("C");
elementB.setName("D");
if (enabled) {
assertExportedObject(elementA.eResource(), "C");
assertExportedObject(elementB.eResource(), "D");
} else {
assertExportedObject(elementA.eResource(), "A");
assertExportedObject(elementB.eResource(), "B");
}
}
use of org.eclipse.xtext.ui.tests.foo.Stuff in project xtext-eclipse by eclipse.
the class AbstractScopeResourceDescriptionsTest method assertLiveModelScopeLocal.
protected void assertLiveModelScopeLocal(boolean enabled) throws IOException {
final URI resourceURI = URI.createPlatformResourceURI("test/assertLiveModelScopeLocal." + fileExt.getPrimaryFileExtension(), true);
Resource resource = resourceSet.createResource(resourceURI);
resource.load(new StringInputStream("stuff foo"), null);
Stuff stuffFoo = ((File) resource.getContents().get(0)).getStuff().get(0);
if (enabled) {
assertExportedObject(resource, "foo");
stuffFoo.setName("bar");
assertExportedObject(resource, "bar");
} else {
IResourceDescriptions resourceDescriptions = resourceDescriptionsProvider.getResourceDescriptions(resource);
IResourceDescription resourceDescription = resourceDescriptions.getResourceDescription(resource.getURI());
assertNull(resourceDescription);
}
}
use of org.eclipse.xtext.ui.tests.foo.Stuff in project xtext-eclipse by eclipse.
the class StuffImpl method setRefs.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setRefs(Stuff newRefs) {
Stuff oldRefs = refs;
refs = newRefs;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FooPackage.STUFF__REFS, oldRefs, refs));
}
use of org.eclipse.xtext.ui.tests.foo.Stuff in project xtext-eclipse by eclipse.
the class TestLanguageSemanticSequencer method sequence.
@Override
public void sequence(ISerializationContext context, EObject semanticObject) {
EPackage epackage = semanticObject.eClass().getEPackage();
ParserRule rule = context.getParserRule();
Action action = context.getAssignedAction();
Set<Parameter> parameters = context.getEnabledBooleanParameters();
if (epackage == FooPackage.eINSTANCE)
switch(semanticObject.eClass().getClassifierID()) {
case FooPackage.FILE:
sequence_File(context, (File) semanticObject);
return;
case FooPackage.STUFF:
sequence_Stuff(context, (Stuff) semanticObject);
return;
}
if (errorAcceptor != null)
errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Aggregations