Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Showing dialog window before closing the view
Showing dialog window before closing the view [message #641669] Fri, 26 November 2010 16:02 Go to next message
Julian  is currently offline Julian Friend
Messages: 5
Registered: November 2010
Junior Member
Hi all,
I one of my view in eclipse RCP application i have a variable representing if any changes were done.
Before leaving the window (by clicking X of that view) I would like to show simple message window yes/now with question if the user really want to close that view. Where should I make kind of listener or are there any ready function?
kindly regards
julian
Re: Showing dialog window before closing the view [message #641891 is a reply to message #641669] Mon, 29 November 2010 07:21 Go to previous messageGo to next message
Daniel Krügler is currently offline Daniel KrüglerFriend
Messages: 853
Registered: July 2009
Senior Member
On 11/26/2010 17:02, Julian wrote:
> Hi all,
> I one of my view in eclipse RCP application i have a variable
> representing if any changes were done.
> Before leaving the window (by clicking X of that view) I would like to
> show simple message window yes/now with question if the user really want
> to close that view. Where should I make kind of listener or are there
> any ready function?
> kindly regards
> julian

Just override WorkbenchAdvisor#preShutdown which returns a boolean. Here
you can do anything necessary (like opening a dialog) to let the user
decide, whether (s)he really wants to exit the application. Just return
false, if no exit is wanted.

HTH & Greetings from Bremen,

Daniel Krügler
Re: Showing dialog window before closing the view [message #641896 is a reply to message #641669] Mon, 29 November 2010 08:06 Go to previous messageGo to next message
Julian  is currently offline Julian Friend
Messages: 5
Registered: November 2010
Junior Member
Yes, that's working but for whole window of application, but I was looking for something for only one view.
Re: Showing dialog window before closing the view [message #641898 is a reply to message #641896] Mon, 29 November 2010 08:13 Go to previous messageGo to next message
Daniel Krügler is currently offline Daniel KrüglerFriend
Messages: 853
Registered: July 2009
Senior Member
On 11/29/2010 09:06, Julian wrote:
> Yes, that's working but for whole window of application, but I was
> looking for something for only one view.

Oops, sorry, I misread. Have you considered to let your view implement
ISaveablePart?

HTH & Greetings from Bremen,

Daniel Krügler
Re: Showing dialog window before closing the view [message #641918 is a reply to message #641669] Mon, 29 November 2010 09:24 Go to previous message
Julian  is currently offline Julian Friend
Messages: 5
Registered: November 2010
Junior Member
thanks, that solution is perfect
Previous Topic:Disable Tree item
Next Topic:Setting input on default perspective
Goto Forum:
  


Current Time: Sat Apr 20 02:52:14 GMT 2024

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

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

Back to the top