Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Diagram Editor doesn't close when file is deleted
Diagram Editor doesn't close when file is deleted [message #689566] Mon, 27 June 2011 20:58 Go to next message
Brian Fitzpatrick is currently offline Brian FitzpatrickFriend
Messages: 500
Registered: July 2009
Senior Member
Hi all...

I've only just recently started diving into some of the gooey goodness of Graphiti and have run into a small problem I haven't found an example for yet.

I have an open diagram in an editor that extends org.eclipse.graphiti.ui.editor.DiagramEditor. When I delete the file that's open, the editor should close as is done with other editor types in Eclipse.

I looked at implementing a solution similar to what's described here for MultiPageEditor, but obviously there's no AbstractTextEditor#handleEditorInputChanged() method to override.

Is there another 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.

Thanks in advance for any help and guidance here.

--Fitz

[Updated on: Mon, 27 June 2011 20:58]

Report message to a moderator

Re: Diagram Editor doesn't close when file is deleted [message #689794 is a reply to message #689566] Tue, 28 June 2011 11:22 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Graphiti has an ElementDeleteListener in place that cares about closing the
editor when the diagram resource (file) is deleted. It works for the
tutorial and the other test editors we have. If this does not work for you
it sounds like a bug. Do you have an example how to reproduce?

Michael

"Brian Fitzpatrick" schrieb im Newsbeitrag
news:iuaqbh$g3g$1@news.eclipse.org...

Hi all...

I've only just recently started diving into some of the gooey goodness of
Graphiti and have run into a small problem I haven't found an example for
yet.

I have an open diagram in an editor that extends
org.eclipse.graphiti.ui.editor.DiagramEditor. When I delete the file that's
open, the editor should close as is done with other editor types in Eclipse.

I looked at implementing a solution similar to what's
http://www.eclipse.org/forums/index.php/m/335942/, but obviously there's no
AbstractTextEditor#handleEditorInputChanged() method to override.

Is there another 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.

Thanks in advance for any help and guidance here.

--Fitz
Re: Diagram Editor doesn't close when file is deleted [message #689907 is a reply to message #689794] Tue, 28 June 2011 15:15 Go to previous messageGo to next message
Brian Fitzpatrick is currently offline Brian FitzpatrickFriend
Messages: 500
Registered: July 2009
Senior Member
Interesting. Ok, so it seems that for some reason we're never falling into the listener when we have the file deleted...

This is for the BPMN2 Visual Editor, which is coming to Eclipse soon... (https://github.com/imeikas/BPMN2-Editor-for-Eclipse/wiki)

I haven't been able to duplicate it using the samples, so I suspect that there's something in the code itself. We're extending the DiagramEditor class, so I'm wondering if there's a method we need to extend or a setting we're missing somewhere in there....

If you want to look at the code, it's all in git - you'll need the BPMN2 model (http://git.eclipse.org/c/bpmn2/) and the BPMN2 editor (git://github.com/imeikas/BPMN2-Editor-for-Eclipse).

The org.eclipse.bpmn2.modeler.ui.editor.BPMN2Editor class is in the org.eclipse.bpmn2.modeler.ui plug-in.

Any and all observations you may have would be great - as I'm a bit lost. Smile

Thank you!

--Fitz
Re: Diagram Editor doesn't close when file is deleted [message #690819 is a reply to message #689907] Thu, 30 June 2011 08:43 Go to previous messageGo to next message
Tim Kaiser is currently offline Tim KaiserFriend
Messages: 118
Registered: July 2009
Senior Member
Hi,

if i delete the file which actually contains the diagram
(in the .bpmn2 folder) the editor is closed properly.

So from the framework side it seems to be ok.

If you want the editor to be closed on model file deletion
you would have to implement a functionality yourself
or delete the diagram file automatically if the model file is deleted.

What do you think?

Best, Tim
Re: Diagram Editor doesn't close when file is deleted [message #691465 is a reply to message #689566] Fri, 01 July 2011 14:05 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

There is a related problem with file renaming: the example diagram editor will close if you try to rename its file while the editor is open.

Is this a known issue?
Re: Diagram Editor doesn't close when file is deleted [message #692324 is a reply to message #691465] Mon, 04 July 2011 07:55 Go to previous message
Tim Kaiser is currently offline Tim KaiserFriend
Messages: 118
Registered: July 2009
Senior Member
The issue is not known please file a bugzilla....
Previous Topic:Incorrect behaviour of DiagramEditorBehavior when two instances of editor share same editing domain
Next Topic:Connections anchored to Connections?
Goto Forum:
  


Current Time: Thu Apr 18 13:48:21 GMT 2024

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

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

Back to the top