Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » How can I use self-defined model as EMF generated editors' input? How to handle the resource synchro
How can I use self-defined model as EMF generated editors' input? How to handle the resource synchro [message #220350] Mon, 02 March 2009 12:03 Go to next message
Allen Wang is currently offline Allen WangFriend
Messages: 28
Registered: July 2009
Junior Member
Hi,

I managed to build a multi-page editor following TopicMap example. Now I
need to use self-defined model (not GMFResource) as my EMF generated
editor input, how can I achieve this?

Let me explain this by code, in TopicMap example, we use
editingDomain.getResourceSet() as the EMF editor's input:

selectionEditorPart.setInput(editingDomain.getResourceSet()) ;

And now, I want to use TopicMap class as the input of the EMF editor in
order to let TopicMap as the root element of each editor viewer:

TopicMap topicMap =
(TopicMap)editingDomain.getResourceSet().getResources().get( 0).getContents().get(0);
selectionEditorPart.setInput(topicMap);

So I did this. At the beginning, this worked fine. But after you saved
the resource, you could not do any modifications in EMF editor or any
modifications can not be recorded. I guess that the resource is updated
after save and is not synchronized with the input of each EMF editor,
but I don't know the best practice how to resolve this problem.

Any suggestions? Thanks!

--
Hexise
Re: How can I use self-defined model as EMF generated editors' input?How to handle the resource sync [message #220938 is a reply to message #220350] Tue, 10 March 2009 13:52 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello hexise,

In GMF-generated code XXXDocumentProvider class is responsible for saving/loading
models you can try debugging it to see what's happening on save.

-----------------
Alex Shatalin
Previous Topic:link from derived class
Next Topic:Label based on referenced Nodes
Goto Forum:
  


Current Time: Mon Mar 08 13:35:56 GMT 2021

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

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

Back to the top