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

Bug 437755

Summary: The message "Root element has been deleted..." should not appear when the editor is already closed
Product: [Modeling] Sirius Reporter: Nicolas Debeaupte <nicolas.debeaupte>
Component: CoreAssignee: Esteban DUGUEPEROUX <esteban.dugueperoux>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: esteban.dugueperoux, pierre-charles.david
Version: 1.0.0Keywords: triaged
Target Milestone: 2.0.0   
Hardware: PC   
OS: Windows XP   
Whiteboard: trivial
Bug Depends on:    
Bug Blocks: 439108    

Description Nicolas Debeaupte CLA 2014-06-19 11:34:33 EDT
When creating a diagram on a semantic element, then closing the diagram and removing the semantic element, the message "Root element has been deleted..." appears while the editor is closed.

The DialectEditorCloser should not call editorWillBeClosedInformationDialog if the editor is already closed
Comment 1 Esteban DUGUEPEROUX CLA 2014-06-25 11:09:48 EDT
Indeed if in a same EMF Command you remove a diagram and close its editor, the popup will appears.
https://git.eclipse.org/r/#/c/28981/ has been submited to Gerrit to fix that.
Comment 2 Esteban DUGUEPEROUX CLA 2014-06-26 04:54:20 EDT
Steps to reproduce :

1. Have an action similar to DeleteRepresentationAction but which call only "DialectUIManager.INSTANCE.closeEditor(editor, false);" before deleting the representation without calling "editingSession.detachEditor(editor);".
The "DialectUIManager.INSTANCE.closeEditor(editor, false);" call will dipose the editor in async and this dispose will call "IEditingSession.detachEditor(editor);"
2. Once the representation deletion command is executed, the DialectEditorCloser postcommit is called to execute its asyncExec to display the popup and close the editor, but before executing this asyncExec, the one from "DialectUIManager.INSTANCE.closeEditor(editor, false);" is executed to dispose the editor which calls "IEditingSession.detachEditor(editor);".

I have updated the gerrit change-set to indicate that a detached editor is equivalent to an closed editor. See https://git.eclipse.org/r/#/c/28981/3 .
Comment 3 Esteban DUGUEPEROUX CLA 2014-07-01 10:04:44 EDT
Fixed as 0fb4d19ba8c75f3f29e664f8799170770dcd4c7f .
Comment 4 Pierre-Charles David CLA 2014-10-27 06:51:50 EDT
Available in Sirius 2.0.0.