|
Re: Open Dialog if close RCP [message #542490 is a reply to message #542376] |
Fri, 25 June 2010 05:36 |
Daniel Krügler Messages: 853 Registered: July 2009 |
Senior Member |
|
|
On 24.06.2010 18:13, budili wrote:
> Hallo,
>
> i want open a fileDialog, if i closed the application about the X at the
> top (on the right side).
> I have a application, and if the user want close the application, i want
> pop my special dialog , who can save the data. My special dialog is a
> command (extend from AbstractHandler).
> It is possible to use my command, if the application will closed?
You should override the preShutdown method of your WorkbenchAdvisor
and should then programmatically invoke your command via the
IHandlerService - see either of
http://wiki.eclipse.org/Platform_Command_Framework
http://blog.eclipse-tips.com/2009/01/commands-part-4-misc-it ems.html
http://www.vogella.de/articles/EclipseRCP/article.html
how this can be done. A return value of false will prevent the
workbench from closing. Note: You emphasize that you want to do this
(only?), if the application is closed via the special system button.
I'm not sure that you can discriminate this. The above mention method
will be called either way, e.g. also if closed via "Exit" or Alt+F4.
HTH & Greetings from Bremen,
Daniel Krügler
|
|
|
|
Powered by
FUDForum. Page generated in 0.03191 seconds