Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Stop editor from closing without saving
Stop editor from closing without saving [message #463925] Tue, 20 February 2007 09:46 Go to next message
Eclipse UserFriend
Hi,

when an editor is dirty and the user closes it, he get asked if he wants
to save or not or if he wants to cancel. For my editor i want, that under
certain cirumstances (marked within the editor) the user is not allowed to
close the editor WITHOUT saving. So either the "no"-button in the above
dialog has to be invisible, or i should be able to capture the close-event
bevore it happens and cancel it. How can i achive that?

Any help is much appreciated. Thanks!
Christoph
Re: Stop editor from closing without saving [message #463943 is a reply to message #463925] Tue, 20 February 2007 13:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: lamont_gilbert.rigidsoftware.com

On Tue, 20 Feb 2007 14:46:36 +0000, Christoph wrote:

> Hi,
>
> when an editor is dirty and the user closes it, he get asked if he wants
> to save or not or if he wants to cancel. For my editor i want, that under
> certain cirumstances (marked within the editor) the user is not allowed to
> close the editor WITHOUT saving. So either the "no"-button in the above
> dialog has to be invisible, or i should be able to capture the close-event
> bevore it happens and cancel it. How can i achive that?
>
> Any help is much appreciated. Thanks! Christoph

I hate to say this as I know its not the answer you are looking for.
However, I think you should not do this. You are playing bad with the
user and users can get quite frustrated when simple things are not allowed
to happen in a timely fashion.

I tried before to block the closing. its painful and error prone for me.
Re: Stop editor from closing without saving [message #463954 is a reply to message #463925] Wed, 21 February 2007 05:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: diebosto.fi.vupv.es

christoph.hilmes@gebit-ms.de (Christoph) wrote in
news:6d6697d8038a9825fc529f1587f1cc99$1@www.eclipse.org:

> Hi,
>
> when an editor is dirty and the user closes it, he get asked if he
> wants to save or not or if he wants to cancel. For my editor i want,
> that under certain cirumstances (marked within the editor) the user is
> not allowed to close the editor WITHOUT saving. So either the
> "no"-button in the above dialog has to be invisible, or i should be
> able to capture the close-event bevore it happens and cancel it. How
> can i achive that?
>
> Any help is much appreciated. Thanks!
> Christoph
>

I'm not quite sure if this would work to you but i think this might
help:
override the "dirty" state of the editor so that it's never dirty, and
react to hidden part events of the editor to create the dialog you like
the most
Re: Stop editor from closing without saving [message #463976 is a reply to message #463925] Wed, 21 February 2007 10:25 Go to previous message
Eclipse UserFriend
this looks like another post ... use ISaveablePart2

Later,
PW
Previous Topic:3-view layout. Ratio override.
Next Topic:Embedding Editors in Views
Goto Forum:
  


Current Time: Mon Mar 17 08:30:14 EDT 2025

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

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

Back to the top