Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Prevent Editor from Closing
Prevent Editor from Closing [message #462395] Mon, 29 January 2007 05:02 Go to next message
JT is currently offline JTFriend
Messages: 9
Registered: July 2009
Junior Member
Hi, I would like to know how I can prevent an editor from closing. That is
to say, editor should not be closeable at all. Thanks.
Re: Prevent Editor from Closing [message #462423 is a reply to message #462395] Mon, 29 January 2007 13:46 Go to previous messageGo to next message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
I believe that if the Editor implements ISaveablePart2 and then overrides the promptToSaveOnClose() such that it returns CANCEL then the editor part won't be closed.

This will be called when the workspace is closing down too, and I'm not sure what would happen in that situation. You may want to use IWorkbench.isClosing() to determine whether you return YES or CANCEL.

Alex.
Re: Prevent Editor from Closing [message #462488 is a reply to message #462423] Tue, 30 January 2007 01:33 Go to previous messageGo to next message
JT is currently offline JTFriend
Messages: 9
Registered: July 2009
Junior Member
Hi Alex,

Thanks, this worked wonderfully if there was unasaved data, otherwise the
editor closes still. Is there any other way to get around this?

Alex Blewitt wrote:

> I believe that if the Editor implements ISaveablePart2 and then overrides
the promptToSaveOnClose() such that it returns CANCEL then the editor part
won't be closed.

> This will be called when the workspace is closing down too, and I'm not sure
what would happen in that situation. You may want to use
IWorkbench.isClosing() to determine whether you return YES or CANCEL.

> Alex.
Re: Prevent Editor from Closing [message #462542 is a reply to message #462488] Tue, 30 January 2007 13:53 Go to previous message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
You could also override isDirty() to return true, I guess.

Alex.
Previous Topic:Reusing workbench messages
Next Topic:Help System Problem on Some Machines When RCP App is Installed.
Goto Forum:
  


Current Time: Sat Sep 14 12:28:28 GMT 2024

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

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

Back to the top