Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Navigating from an EObjectNode to its EObject
Navigating from an EObjectNode to its EObject [message #1713275] Mon, 02 November 2015 22:44 Go to next message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 438
Registered: March 2011
Senior Member
I need to access the EObject that corresponds to an EObjectNode in the outline view. More specifically, I'm creating an action handler executed when the user right-clicks on an outline node. In the handler I have access to the EObjectNode, but I need the actual EObject used to create it. How can I navigate from the EObjectNode to the EObject?
Re: Navigating from an EObjectNode to its EObject [message #1713282 is a reply to message #1713275] Tue, 03 November 2015 05:01 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14716
Registered: July 2009
Senior Member
The EObjectNode has and uri?!?
you may leverage IURIEditorOpener


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Navigating from an EObjectNode to its EObject [message #1713380 is a reply to message #1713282] Tue, 03 November 2015 16:41 Go to previous messageGo to next message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 438
Registered: March 2011
Senior Member
Thanks. I see that EObjectNode has getEObjectURI and getEObject(Resource). But what I don't understand is this: if the user is seeing the outline it's because the model is in memory, so why go through the URI or the Resource? Why doesn't EObjectNode have a direct reference to the EObject in memory?
Re: Navigating from an EObjectNode to its EObject [message #1713390 is a reply to message #1713380] Tue, 03 November 2015 18:28 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14716
Registered: July 2009
Senior Member
What do you mean by navigating? I asumed go to it in the editor

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Navigating from an EObjectNode to its EObject [message #1713391 is a reply to message #1713390] Tue, 03 November 2015 18:30 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14716
Registered: July 2009
Senior Member
And i cannot answer why this was done this way

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Navigating from an EObjectNode to its EObject [message #1713414 is a reply to message #1713390] Tue, 03 November 2015 21:29 Go to previous message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 438
Registered: March 2011
Senior Member
I mean navigate programmatically, in the sense that I need to obtain the EObject instance that was used to create the EObjectNode in the outline view.
Previous Topic:Xtext 2.9 as a service
Next Topic:Set indention between squared brackets
Goto Forum:
  


Current Time: Fri Sep 20 01:27:29 GMT 2024

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

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

Back to the top