Community
Participate
Working Groups
With the editor open, delete the bpmn2 file. The editor should exit gracefully. Brian Fitzpatrick added a comment - 27/Jun/11 5:01 PM Have posted an article in the Graphiti Forum to see if I can get some details on how to fix this. I looked at implementing a solution similar to what's described here (http://www.eclipse.org/forums/index.php/m/335942/) for MultiPageEditor, but obviously there's no AbstractTextEditor#handleEditorInputChanged() method to override. It seems there's a Diagram Resource Set Listener in the DiagramEditorInternal class, but it's private and I don't see a good way to hook into that mechanism. Hopefully one of the kind souls in the Graphiti Forums will have an answer.
Sounds like we'd need some kind of a resource listener to listen for model file deletion and see if there's an associated bpmn diagram open. Definitely something to look into for this release.
BTW, the forum post was here: http://www.eclipse.org/forums/index.php/m/689907/#msg_689907 But it didn't propose anything specific. Something to explore further.
Sounds like a plan. And maybe this resource listener could watch for renames as well - see https://bugs.eclipse.org/bugs/show_bug.cgi?id=366194
*** Bug 370709 has been marked as a duplicate of this bug. ***
Fixed. File move/rename is handled the same way as a delete, i.e. the editor is simply closed.
Just tested this again and the problem is back. Probably has to do with the multipage editor enhancement.
Created attachment 219540 [details] Deleting bpmn2 file not closing the editor bug fix proposal Hi, Please have a look at the fix proposal attached. Let me know your feedback. Thanks Deepak
Hi Deepak, and thanks for the patch. Unfortunately I didn't get a chance to include it in this week's build, but I'll take a look at this next week.
Applied patch. I've also rearranged the logic a bit to check if the diagram file (the "hidden" one that we create in a ".bpmn" folder for Graphiti Diagrams) has been deleted. When I tested with Graphiti 0.9.0 the editor did not close when this file was deleted. Now it will close, leaving the model file unaffected. Deepak, please test to verify this is fixed, then close this BZ. Thanks!