Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Reload objects after SAVE?
Reload objects after SAVE? [message #119061] Fri, 13 April 2007 09:18 Go to next message
Grzegorz Bialek is currently offline Grzegorz BialekFriend
Messages: 43
Registered: July 2009
Member
I try to migrate from Eclipse 3.2 and GMF1.0 (MT1.0) to new Eclipse 3.3M6
and GMF2.0M6 (MT1.1).
I discover a strange behavior of my application. After 'save' operation my
editors contains original saved objects but in my EditingDomain I have new
objects (reloaded). So after first save I can't change any objects anymore
(myobject.eResource() is null).
Anyone know how I do wrong migrating my project?

sorry for my English
Grzesiek
Re: Reload objects after SAVE? [message #119127 is a reply to message #119061] Fri, 13 April 2007 10:13 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Grzegorz,

Do you have any custom code in your generated application?

-----------------
Alex Shatalin
Re: Reload objects after SAVE? [message #119140 is a reply to message #119127] Fri, 13 April 2007 10:48 Go to previous messageGo to next message
Grzegorz Bialek is currently offline Grzegorz BialekFriend
Messages: 43
Registered: July 2009
Member
Yes I embed 'generated gmf' editor in multipage editor.

I have one EditingDomain for all pages so I extend generated
xxxDiagramEditor to return my editing domain from createEditingDomain().
After migration I also change createEditingDomain() in my
xxxDocumentProvider to return my editingDomain (method now get editingDomain
from editor, code attaching Adapter remains unchanged)

My editor listen to all modifications on OperationHistory. I check
ResourceUndoContext.getAffectedResources() on modification to set 'dirty
flag' (as in EXTLibraryEditor from emf.workspace.example) but after first
save only operations done In 'GMF page' returns resources, all other
operations returns empty set. I discover that after 'save' my EditingDomain
contains copy of original objects like I write before.

How I do wrong or what I must change to get correct behavior (from GMF 1.0 -
MT 1.0)?
Grzesiek



U
Re: Reload objects after SAVE? [message #119166 is a reply to message #119140] Fri, 13 April 2007 11:10 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Grzegorz,

You can debug generted DocumentProvider, but in general Editor Content will
be replaced by new one (all loaded EObjects unloaded + loaded once again
into the same ResourceSet) on receiving resourceChanged notification from
the Eclipse Resources. If you are saving diargam editor using ???DocumentProvider.doSaveDocument()
method corresponding notifications should be skipped. I suggest you to 1.
ensure you are saving your editor by calling ???DocumentProvider.doSave (called
from EditorPart.doSave()) 2. Ensure you are not wrapping this operation into
WorkspaceModifyOperation (in this case all the resources notifications will
arrive later).

-----------------
Alex Shatalin
Previous Topic:Link question
Next Topic:Regarding class GenericModelElementFilter
Goto Forum:
  


Current Time: Fri Jul 19 05:20:30 GMT 2024

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

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

Back to the top