Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Generic access for QualifiedName
Generic access for QualifiedName [message #786665] Mon, 30 January 2012 17:33 Go to next message
Benjamin Schwertfeger is currently offline Benjamin SchwertfegerFriend
Messages: 53
Registered: July 2009
Member
Hi,
I try to write information of elements inside a xtext resource to the user and track changes while the file is edited. To identify the element I would like to use qualified names. Is there a way to access qualified names of elements in an open xtext editor without being part of the editor (Knowing the used module/Injector)?

The Access and ProjectDescriptions could work if the elements are exported and the file is saved, but is perhaps slow and not my preferred way.

Thanks,
Benjamin
Re: Generic access for QualifiedName [message #787176 is a reply to message #786665] Tue, 31 January 2012 08:44 Go to previous messageGo to next message
Meinte Boersma is currently offline Meinte BoersmaFriend
Messages: 434
Registered: July 2009
Location: Leiden, Netherlands
Senior Member
The runtime module for the non-UI plug-in binds IQualifiedNameProvider to a concrete instance that is used to compute all qualified names, including those in the other classes you mention. The computation of the Index (i.e., exported objects) can be time-consuming but once it's done, querying it is not slow at all.

Re: Generic access for QualifiedName [message #787193 is a reply to message #786665] Tue, 31 January 2012 08:58 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Benjamin,

please note that qualified names are not necessarily unique thus
tracking changes that way may be ambigious.

You could try to obtain the resource service provider for the containing
resource of the EObject and ask that one for the IQualifiedNameProvider.

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

Am 30.01.12 18:33, schrieb Benjamin Schwertfeger:
> Hi,
> I try to write information of elements inside a xtext resource to the
> user and track changes while the file is edited. To identify the element
> I would like to use qualified names. Is there a way to access qualified
> names of elements in an open xtext editor without being part of the
> editor (Knowing the used module/Injector)?
>
> The Access and ProjectDescriptions could work if the elements are
> exported and the file is saved, but is perhaps slow and not my preferred
> way.
>
> Thanks,
> Benjamin
Re: Generic access for QualifiedName [message #787425 is a reply to message #787193] Tue, 31 January 2012 15:09 Go to previous message
Benjamin Schwertfeger is currently offline Benjamin SchwertfegerFriend
Messages: 53
Registered: July 2009
Member
Thanks,
the resource service provider was exactly what I was looking for. The qualified name is only an additional tracking mechanism, but a very nice way to name the element.
Previous Topic:Xtend whitespace in templates
Next Topic:Access a reference's feature
Goto Forum:
  


Current Time: Fri Apr 26 16:42:50 GMT 2024

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

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

Back to the top