Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » How to recreate transient model and view objects?
How to recreate transient model and view objects? [message #525794] Wed, 07 April 2010 19:52 Go to next message
Swavek  is currently offline Swavek Friend
Messages: 20
Registered: March 2010
Junior Member
I have a node figure which has input, output and data ports sticking out on three sides. The figure that owns them will support two types of connections. One for connecting input & output ports on figures. Another connection type will be made between a data port and data source figure. Data source figures don't need ports because there can only be one connection to them. I decided to create transient data port semantic model objects and notational objects for them. I used the idea of ports from the LED example.

My problem is that after adding a figure with data port and saving the file I can no longer open it The data ports are marked as 'transient, volatile' in the ecore model and therefore they are not saved in the semantic model file, but they are stored in the notational view file (diagram file). That is why I am getting exceptions when trying to restore them - there is no semantic data port object corresponding to data port notational object.

So I decided to recreate the semantic objects in a ResourceHandler registered inside a generated MyResourceFactoryImpl. The handler gets called and I create the semantic objects, however the view objects are already created because if I understand it, the diagram file is read first and then the references to the semantic model objects are resolved by reading the semantic file.

My first question is then should the data ports notational objects be stored in the notational view file? I noticed that there are persistent and transient notational view objects. Right now the data port notational objects are saved.

How do I make them transient? BTW, most of my code is generated using GMF dashboard so I assumed wrongly that if the semantic model object is marked transient then the corresponding notational object will also be transient.

My second question is there a recommended place for connecting the transient semantic objects to notational objects? Should I do this in the ResourceHandler.postLoad method or somewhere else?

Thank you
Re: How to recreate transient model and view objects? [message #1652456 is a reply to message #525794] Thu, 05 March 2015 22:10 Go to previous message
Jimmy Lu is currently offline Jimmy LuFriend
Messages: 11
Registered: October 2014
Junior Member
I ran into the same problem recently. Did you manage to solve it?
Previous Topic:Adding a node between connections
Next Topic:Adding GMF editor to multipage editor
Goto Forum:
  


Current Time: Sat Jul 27 09:53:00 GMT 2024

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

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

Back to the top