Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Asking for confirmation before closing an editor
Asking for confirmation before closing an editor [message #1745655] Fri, 14 October 2016 06:49
Vlad Acretoaie is currently offline Vlad AcretoaieFriend
Messages: 93
Registered: April 2014

TL;DR: I don't know how to present the user with a confirmation dialog before closing the CompareEditor defined by EMF Compare.

More details:

I have a relatively simple use case that I'd like to accommodate: asking the user to confirm they wish to close an editor after they have pressed the close (x) button on the workbench window.

I have determined from other threads on this forum (e.g. that attaching an IPartListener to the window won't help, since its partClosed() method will only be invoked after the window has been closed.

The recommended solution is to implement the ISaveablePart2 interface in the part the user is closing. However, I cannot do this, since the part comes from a plugin. In particular, it is the CompareEditor defined by EMF Compare. So I cannot add any additional interfaces to it. Or, if I somehow can, I don't know how to (extending the class doesn't look like an option, since it is instantiated by another EMF Compare class and not directly by my code).

Another suggestion I saw ( is to use an IPerspectiveListener2 instead of the IPartListener, since this listener will be notified before the part is actually closed. However, I still don't know how to abort closing the part from within this listener. Is this even possible?

Thanks in advance,
Previous Topic:Different Splash Progress Bar on Product Build vs Self-Hosted Launch
Next Topic:Strategy for fixing installation for buildship upgrade problem?
Goto Forum:

Current Time: Tue Nov 13 04:20:31 GMT 2018

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

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

Back to the top