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

Bug 355644

Summary: Editor does not close when resource is deleted
Product: [SOA] BPMN2Modeler Reporter: Robert Brodt <bbrodt>
Component: UIAssignee: Robert Brodt <bbrodt>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: rand.singh
Version: 0.0.1Flags: bbrodt: iplog+
Target Milestone: 0.0.1-M1   
Hardware: PC   
OS: Windows 7   
URL: https://issues.jboss.org/browse/JBPM-3137
Whiteboard:
Attachments:
Description Flags
Deleting bpmn2 file not closing the editor bug fix proposal none

Description Robert Brodt CLA 2011-08-24 06:12:24 EDT
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.
Comment 1 Brian Fitzpatrick CLA 2011-12-09 15:40:39 EST
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.
Comment 2 Brian Fitzpatrick CLA 2011-12-09 15:42:09 EST
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.
Comment 3 Robert Brodt CLA 2011-12-09 15:43:38 EST
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
Comment 4 Robert Brodt CLA 2012-03-01 10:05:51 EST
*** Bug 370709 has been marked as a duplicate of this bug. ***
Comment 5 Robert Brodt CLA 2012-03-08 12:03:16 EST
Fixed. File move/rename is handled the same way as a delete, i.e. the editor is simply closed.
Comment 6 Robert Brodt CLA 2012-05-02 10:48:50 EDT
Just tested this again and the problem is back. Probably has to do with the multipage editor enhancement.
Comment 7 Deepak G CLA 2012-08-03 12:46:36 EDT
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
Comment 8 Robert Brodt CLA 2012-08-03 19:18:26 EDT
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.
Comment 9 Robert Brodt CLA 2012-08-08 09:17:19 EDT
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!