|
Re: Preventing a form or page being closed [message #1286984 is a reply to message #1277923] |
Mon, 07 April 2014 05:09  |
Eclipse User |
|
|
|
Hi Dominic,
sorry for the late response.
Yes, you can intercept the close event. Below, there is an example which shows a "Yes/No" dialog when the user wants to close the form. If the user selects "Yes" the form closes, if the user selects "No" the form stays open:
@Override
public void doClose() throws ProcessingException {
int result = MessageBox.showYesNoMessage("Close", "Close", "Do you really want to close the form?");
if (result == MessageBox.YES_OPTION) {
super.doClose();
}
else {
//do nothing
}
}
Basically, you need to override
public void doClose() throws ProcessingException
in your AbstractForm
(I wanted to attach an image, however the Eclipse Forum does not let me do so )
Hope this helps,
Best regards
Matthias
|
|
|
Powered by
FUDForum. Page generated in 0.06868 seconds