Getting EObject from an URI [message #1830568] |
Wed, 29 July 2020 09:08  |
Eclipse User |
|
|
|
Hello Everyone,
I'm beginner in EMF frameworks and tools. I have an Editor which takes URIEditorInput, for displaying an EMF model data.
So, I convert an EObject to URI using the API EcoreUtil.getURI(EObject) and create an URIEditorInput and pass it for opening the editor.
Now, I'm need in need of accessing the EObject inside the Editor instance.
so, How can I convert the URI to an EObject? I analyzed a bit and found that there is a resource API to fetch the EObject (Resource.getEObject(String uriFragment)). But, I'm unable to find an API to fetch Resource from the URI.
can someone please advice a way to convert URI to it's corresponding EObject?
Thanks,
Pal
|
|
|
|
|
|
|
Re: Getting EObject from an URI [message #1830585 is a reply to message #1830575] |
Wed, 29 July 2020 12:51   |
Eclipse User |
|
|
|
Well, an editor ought to have support for undo/redo and such things, so you'd probably be best off to start with the generated editor and then customize it. In any case, you can generate the editor and look at how it's implemented for guidance.
|
|
|
|
Powered by
FUDForum. Page generated in 0.06255 seconds