|
Re: Adding definition in global scope provider [message #1753287 is a reply to message #1753282] |
Fri, 03 February 2017 10:23 |
|
whats the problem with the libary approach in the first place? is it your main method? what do you there? it should be no problem to traverste the lib jar directly or indirectly there
there is no tutorial.
many years ago i did something like (dont know if this still works)
public class MyDslGSP extends DefaultGlobalScopeProvider {
@Inject
IResourceDescription.Manager mgr;
@Override
public IScope getScope(Resource resource, EReference reference, Predicate<IEObjectDescription> filter) {
URI libaryResourceURI = URI.createURI("dummy://demo/test.mydsl");
Resource libaryResource = resource.getResourceSet().getResource(libaryResourceURI, false);
if (libaryResource == null) {
System.out.println("LOOOOOOOOAAAAADDDDD");
libaryResource = resource.getResourceSet().createResource(libaryResourceURI);
try {
libaryResource.load(new StringInputStream("Hello Libary1! Hello Libary2 from Libary1!"), null);
} catch (IOException e) {
e.printStackTrace();
}
}
IResourceDescription resourceDescription = mgr.getResourceDescription(libaryResource);
Iterable<IEObjectDescription> libary = resourceDescription.getExportedObjects();
return new SimpleScope(super.getScope(resource, reference, filter), libary, false);
}
}
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Day Job: https://www.everest-systems.com
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04108 seconds