I am working on an Eclipse based RCP. We have a need to prevent one of the opened editors from being closed by the user.
The desired behavior is:
Oh yeah, and is this even possible?
Thanks, gk
You could use a org.eclipse.ui.ISaveablePart2, more specifically the method promptToSaveOnClose().
However, as said in this thread,
it will only be shown if the editor is dirty at the time it is closed.
See an example in this SaveableHelper.java source file.
See also the article Prevent that a RCP Editor is closed, which explains how this method works:

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With