Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Resolvig ProxyObjects from importUri Scope(I can not resolve Ecore proxy objects gotten from an importUriScopeProvider)
Resolvig ProxyObjects from importUri Scope [message #1391796] Tue, 01 July 2014 12:24 Go to next message
Olaf Bigalk is currently offline Olaf BigalkFriend
Messages: 155
Registered: July 2009
Location: Berlin
Senior Member
I can not resolve Ecore proxy objects gotten from an importUriScopeProvider neither implicid as it should be nor expicit with:
EcoreUtil.resolveAll(eObjectOrProxy)

I am doing:
@Inject
protected ImportUriGlobalScopeProvider importUriScopeProvider;
...
final IScope scope = importUriScopeProvider.getScope(eResource, XtextPackage.Literals.GRAMMAR__RULES);
eods = scope.getAllElements()
eop = eods.iterator().next()

I get a non empty list but the values of the proxy objects are always null.
What I am doing wrong ?
Re: Resolvig ProxyObjects from importUri Scope [message #1391880 is a reply to message #1391796] Tue, 01 July 2014 14:50 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Standalone or in eclipse? standalone all resources have to be added to the resourceset manually

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Resolvig ProxyObjects from importUri Scope [message #1391921 is a reply to message #1391880] Tue, 01 July 2014 15:51 Go to previous messageGo to next message
Olaf Bigalk is currently offline Olaf BigalkFriend
Messages: 155
Registered: July 2009
Location: Berlin
Senior Member
Christian Dietrich wrote on Tue, 01 July 2014 10:50
Standalone or in eclipse? standalone all resources have to be added to the resourceset manually

In eclipse inside a ProposalProvider. So I asume all resources should have been added already. And as I mentions the list is not empty what it would be if the resource would not have been available.
Re: Resolvig ProxyObjects from importUri Scope [message #1392100 is a reply to message #1391921] Tue, 01 July 2014 22:12 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
the question is: why do you need to do that in the proposal provider?

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Resolvig ProxyObjects from importUri Scope [message #1392936 is a reply to message #1392100] Thu, 03 July 2014 02:47 Go to previous messageGo to next message
Olaf Bigalk is currently offline Olaf BigalkFriend
Messages: 155
Registered: July 2009
Location: Berlin
Senior Member
Christian Dietrich wrote on Tue, 01 July 2014 18:12
the question is: why do you need to do that in the proposal provider?

I simply want to generate proposals based on the objects that are in scope.
Re: Resolvig ProxyObjects from importUri Scope [message #1392987 is a reply to message #1392936] Thu, 03 July 2014 04:40 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
is it for cross refs? is it for something else?
it would be nice to get a concrete usecase. maybe one of the existing hook already fit.


and of course the scope provider delivers only elements from the index. (IEObjectDescription) which have EObjectorproxy that are ideally all proxies.
for resolving you should pass in the actual context ("model") you have

EcoreUtil.resolve(EObject proxy, EObject objectContext)


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:How can I create a variable or static initializer with Xbase means
Next Topic:Prevent UpdateEditorStateJob and XtextBuilder from concurrent execution
Goto Forum:
  


Current Time: Thu Apr 25 19:42:43 GMT 2024

Powered by FUDForum. Page generated in 0.03066 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top