Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » retrieving crossreferences from external file
retrieving crossreferences from external file [message #644656] Mon, 13 December 2010 16:45 Go to next message
chuck  is currently offline chuck Friend
Messages: 160
Registered: July 2010
Senior Member
in my scope provider i do something to retrieve elements of a crossreference...
but it's possible to manually retrieve elements from ecore models in workspace?
i mean... i'm building lists in scope provider and i need to add some of existing packages in ecore model in ws... i know how to filter... but do i have invoke default scope provider? thx for the perfect support Smile
Re: retrieving crossreferences from external file [message #644768 is a reply to message #644656] Tue, 14 December 2010 08:21 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Chuck,

you may always use other scopes to compute your very own visible
objects. However, please keep in mind to do it in a functional way
instead of iterating the complete contents of another scope.
However, I'm not sure that I understood your question so please post a
more concrete example if this answer is not sufficient.

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 13.12.10 17:45, schrieb chuck:
> in my scope provider i do something to retrieve elements of a
> crossreference...
> but it's possible to manually retrieve elements from ecore models in
> workspace? i mean... i'm building lists in scope provider and i need to
> add some of existing packages in ecore model in ws... i know how to
> filter... but do i have invoke default scope provider? thx for the
> perfect support :)
Re: retrieving crossreferences from external file [message #644805 is a reply to message #644656] Tue, 14 December 2010 09:50 Go to previous messageGo to next message
chuck  is currently offline chuck Friend
Messages: 160
Registered: July 2010
Senior Member
i try to explain:


public IScope scope_CallO_args(CallO o, EReference r) {

List union=new ArrayList();


EList<Package> list_packages=getRoot(o).getPackages();
for (PackageOp pop : getRoot(o).getPackages()) {
union.add(pop.getVar());
}

... here i would retrieve epackages in ecore models in workspace... this normally is execeuted when this scope s undefined....

}

it's more clear?

thx
Re: retrieving crossreferences from external file [message #645045 is a reply to message #644805] Wed, 15 December 2010 11:04 Go to previous messageGo to next message
chuck  is currently offline chuck Friend
Messages: 160
Registered: July 2010
Senior Member
chuck wrote on Tue, 14 December 2010 04:50
i try to explain:


public IScope scope_CallO_args(CallO o, EReference r) {

List union=new ArrayList();


EList<Package> list_packages=getRoot(o).getPackages();
for (PackageOp pop : getRoot(o).getPackages()) {
union.add(pop.getVar());
}

... here i would retrieve epackages in ecore models in workspace... this normally is execeuted when this scope s undefined....

}

it's more clear?

thx


this problem isn't for eclasses because i have reference to existing package.... but for package i don't have reference to access element...i don't know if there is a way to access to workspace ecore models..-.
Re: retrieving crossreferences from external file [message #645060 is a reply to message #645045] Wed, 15 December 2010 12:34 Go to previous message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Chuck,

sorry, I don't understand your problem. The default scope for your
reference to an EPackage will automatically return all visible EPackages
in the workspace. You'll only have to add the packages from the
registry, if you want to do this.

IScope parent = delegateGetScope(..); // all EPackages from the workspace
IScope result = createEPackageRegistryScope(parent, ...);

return result;

What did I miss?

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 15.12.10 12:04, schrieb chuck:
> chuck wrote on Tue, 14 December 2010 04:50
>> i try to explain:
>>
>>
>> public IScope scope_CallO_args(CallO o, EReference r) {
>>
>> List union=new ArrayList();
>>
>>
>> EList<Package> list_packages=getRoot(o).getPackages();
>> for (PackageOp pop : getRoot(o).getPackages()) {
>> union.add(pop.getVar());
>> }
>>
>> ... here i would retrieve epackages in ecore models in workspace...
>> this normally is execeuted when this scope s undefined....
>> }
>>
>> it's more clear?
>>
>> thx
>
>
> this problem isn't for eclasses because i have reference to existing
> package.... but for package i don't have reference to access element...i
> don't know if there is a way to access to workspace ecore models..-.
>
Previous Topic:Language allows for operator definition
Next Topic:model to text and comments
Goto Forum:
  


Current Time: Thu Mar 28 18:41:55 GMT 2024

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

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

Back to the top