how to get resource set from non-gef editor [message #147783] |
Fri, 24 August 2007 15:51 |
Eclipse User |
|
|
|
Originally posted by: slorenc.infogix.com
In my application I have separate domain model and diagram model resources.
The domain model represents a project and diagram is a visual representation
of this project. In my project I have control objects and sources objects.
The control and source objects have specialized editors. My diagram editor
and specialized editors occupy pages within a multi-page editor.
When I open a project the multipage editor opens up. I can have multiple
project editors open at the same time. Since I support undo I need separate
editing domain for each project.
What I need to do is to pass the control object to be edited by the
specialized editors. I read about the uri fragments and that's how I think
I will identify the individual control to the specialized editor. I will
pass the fragment via IEditorInput derived object. But fragment will do me
no good if I can't get at resource which contains the object identified by
this fragment. I know I can get resource from resource set and resource set
from editing domain but after looking through this newsgroup and looking
through the code I can't figure out how to get to the transactional editing
domain ( and then resourceSet and finally resource) from the specialized
editor which is not a graphical editor (not GMF editor). When I am opening
the specialized editors I could pass the editing domain via editor input,
but according to the documentation editor input should be lighweight so
passing the whole transactionaleditingdomain is probably not a good idea.
I could pass it directly to the editor after it is constructed, but was
wondering if there is a prescribed way to get at the particular editing
domain from anywhere in the code. I have seen a registry for editing
domains but also comments that this class is not intended to be used by
clients.
I noticed that editing domains have ids but this id is the same for all
projects that I open. Since resource have unique URIs I assume that if I
pass the URI of the domain resource I would be able to retrieve a resource
from somewhere, then get the resourceSEt and ultimately domain.
Is accessing resource, resourceSet or domain possible from non-gmf code?
Thanks,
Swavek
|
|
|
Powered by
FUDForum. Page generated in 0.04160 seconds