Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Opening a diagram with a model (EObject) input
Opening a diagram with a model (EObject) input [message #192000] Tue, 10 June 2008 21:45 Go to next message
Artun Subasi is currently offline Artun SubasiFriend
Messages: 20
Registered: July 2009
Junior Member
Hello,

I open the gmf generated graphical editors using the
xy.diagram.part.XyDiagramEditorUtil.openDiagram(..) method. It takes a
diagram resource file as input. I assume it reads the model and creates
a new corresponding EObject instance as its model. Can I somehow prevent
this new instantiation by giving a certain EObject as input (in addition
to the diagram resource)? I want the editor to work on an EObject with a
certain object identity.

Regards,
Artun
Re: Opening a diagram with a model (EObject) input [message #192059 is a reply to message #192000] Wed, 11 June 2008 10:11 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Artun,

One of the possible solutions is to plug in your own instances of EObjects
is to create and register own Resource.Factory implementation. This class
should be responsible for loading your model resources and filling this resource
with proper contents, so you can use your own EObject instances there.

-----------------
Alex Shatalin
Re: Opening a diagram with a model (EObject) input [message #192191 is a reply to message #192059] Wed, 11 June 2008 21:48 Go to previous message
Artun Subasi is currently offline Artun SubasiFriend
Messages: 20
Registered: July 2009
Junior Member
Alex,

I managed to use my own object using such a resource factory. However,
it caused a new problem for me.

After I close the editor, it disposes the EObject (the corresponding
EObject is set to null). I didn't track the reason, because probably it
is meant to be that way.

I believe, I will still have trouble even I solve this problem. What
happens if the model is changed by the editor and then the editor is
closed without saving. Probably I would have to undo all dirty changes
myself.

I wanted to use this concept to make the sychronization easier. But it
seems that is not the case. And I suppose it would be kind of 'hacking'
to use this concept for sychronization.

Artun

> Hello Artun,
>
> One of the possible solutions is to plug in your own instances of
> EObjects is to create and register own Resource.Factory implementation.
> This class should be responsible for loading your model resources and
> filling this resource with proper contents, so you can use your own
> EObject instances there.
>
> -----------------
> Alex Shatalin
>
>
Previous Topic:Displaying a GMF-Graph in an Eclipse Viewpart
Next Topic:Eclipse distro with just GMF runtime (not including Java JDT)
Goto Forum:
  


Current Time: Thu Apr 25 05:52:17 GMT 2024

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

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

Back to the top