|
Re: EMF multi page editor input and resource synchronize question? [message #427877 is a reply to message #427858] |
Tue, 03 March 2009 12:21 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Comments below.
hexise wrote:
> Hi,
>
> I managed to build a multi-page editor following GMF TopicMap example.
> Now I need to use self-defined model (not GMFResource) as my EMF
> generated editor input, how can I achieve this?
>
Just do it. :-P
> 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);
>
That seems good.
> 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.
It sounds like perhaps the save is causing your resource's objects to be
turned into proxies. That shouldn't be the case except if some other
editor change the underlying resource external to the editor.
> I guess that the resource is updated
> after save and is not synchronized with the input of each EMF editor,
>
I guess so, but in the generated EMF editor, that shouldn't happen. The
resource delta processing knows which resources were saved and ignores
those expected deltas.
> but I on't know the best practice how to resolve this problem.
>
You could listen for changes to the contents of the resource and call
setInput again with the new contents. But it sounds to me like you have
some bogus resource delta processing happening...
> Any suggestions? Thanks!
>
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.04197 seconds