| [news.eclipse.tools.emf] Re: Access EcoreModel instance |
Hi Ed!
Maybe one model is already opened.
Hmm, weird ;)
Cheers harkon
Ed Merks wrote:
Harkon,
Comments below.
harkon wrote:You haven't talked about making modifications yet, so I'm missing the connection or a step as to why the display needs refreshing.Hi everybody...
I encountered a problem in accessing an instance of a Ecore modell residing in my workspace of Eclipse.
Situation: I want to access an Ecore Modell from a newly created Plugin existing in the current Eclipse instance. This can be done via an URL file based. if I now open die URL I can access the content and everything is fine.
Now if an Ecore Model editor is open in the same time the model won't be updated immediately. I have to refresh the display.All generated editors implement IEditingDomainProvider so you can cast the editor to that, get the editing domain, and from that you have access to the resource set in which all the resources being edited are kept.
Question: The Ecore Model Editor owns a Ecore Model reference itself (EObject root node). How can I access this root node of the opened Ecore Model Editor?The background is: I want to alter the content of an Ecore model via EMF techniques and whenever a change was registered the EMF fires various events about this update and the Ecore Model Editor changes its display "on the fly".Be sure to use the command stack of the editing domain to make all your changes so that the editor can undo the changes and knows that it's dirty and needs to save.Now if I change the model from another Eclipse Plugin via this root node instance of the opened Ecore Model Editor I can "see" the changes in the moment they happen...
I hope I made myself clear enough that some one could help me ;)
Cheers harkon