use of org.yakindu.sct.generator.genmodel.resource.FeatureResourceDescription in project statecharts by Yakindu.
the class SGenScopeProvider method getLibraryScope.
protected SimpleScope getLibraryScope(Resource resource) {
GeneratorModel generatorModel = (GeneratorModel) EcoreUtil.getObjectByType(resource.getContents(), SGenPackage.Literals.GENERATOR_MODEL);
Assert.isNotNull(generatorModel);
String generatorId = generatorModel.getGeneratorId();
IGeneratorDescriptor generatorDescriptor = GeneratorExtensions.getGeneratorDescriptor(generatorId);
Iterable<IEObjectDescription> allElements = Lists.newArrayList();
if (generatorDescriptor != null) {
Iterable<ILibraryDescriptor> libraryDescriptor = LibraryExtensions.getLibraryDescriptors(generatorDescriptor.getLibraryIDs());
for (ILibraryDescriptor desc : libraryDescriptor) {
Resource library = resourceSet.getResource(desc.getURI(), true);
FeatureResourceDescription description = new FeatureResourceDescription(library);
injector.injectMembers(description);
allElements = Iterables.concat(allElements, description.getExportedObjects());
}
}
return new SimpleScope(allElements);
}
use of org.yakindu.sct.generator.genmodel.resource.FeatureResourceDescription in project statecharts by Yakindu.
the class HelpIntegrationTest method getAllElements.
private Iterable<IEObjectDescription> getAllElements(String generatorId) {
IGeneratorDescriptor generatorDescriptor = GeneratorExtensions.getGeneratorDescriptor(generatorId);
Iterable<ILibraryDescriptor> libraryDescriptor = LibraryExtensions.getLibraryDescriptors(generatorDescriptor.getLibraryIDs());
Iterable<IEObjectDescription> allElements = Lists.newArrayList();
for (ILibraryDescriptor desc : libraryDescriptor) {
Resource library = resourceSet.getResource(desc.getURI(), true);
FeatureResourceDescription description = new FeatureResourceDescription(library);
injector.injectMembers(description);
allElements = Iterables.concat(allElements, description.getExportedObjects());
}
return allElements;
}
Aggregations