Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 326464

Summary: [xtext.gmf.glue-ConcurrentModifications] Support DiagramEditors changing EditorInputs
Product: [Modeling] TMF Reporter: Moritz Eysholdt <moritz.eysholdt>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: jan
Version: 1.0.1   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
xtext.gmf.glue: Support Changing Editor Inputs for DiagramEditors none

Description Moritz Eysholdt CLA 2010-09-28 16:48:10 EDT
If a DiagramEditor gets assigned a new EditorInput, it instantiates a new EditingDomain. However, the current implementation of ConcurrentModificationObserver does not react to these changes which means the old (and wrong) EditingDomain is continued to be observed.

In my use case the DiagramEditor's Input is changed because if the user opens a the editor he/she first sees a Eclipse Forms based UI from which he can select the model element he/she wants to edit in GMF. This selection causes to re-set the EditorInput.

I've fixed this issue by additionally listening to changes of the editor input and I'll attach the fix as a patch. Let's see if my use case is just to special or if this is useful for someone else.
Comment 1 Moritz Eysholdt CLA 2010-09-28 16:49:38 EDT
Created attachment 179788 [details]
xtext.gmf.glue: Support Changing Editor Inputs for DiagramEditors
Comment 2 Jan Koehnlein CLA 2010-09-29 04:14:54 EDT
Correct me if I am wrong, but I cannot find where you deregister/dispose the EditingDomainAdapter. As the editing domain's lifecycle could exceed the one of the editor, this is necessary.
Comment 3 Sven Efftinge CLA 2012-11-14 05:40:26 EST
see comment 2