Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Preventing a form or page being closed
Preventing a form or page being closed [message #1277923] Wed, 26 March 2014 16:51 Go to next message
Dominic Hanlan is currently offline Dominic HanlanFriend
Messages: 98
Registered: July 2009
Member
Is there a form of veto on page or forms being closed or of hiding the close icon?

Regards
Re: Preventing a form or page being closed [message #1286984 is a reply to message #1277923] Mon, 07 April 2014 09:09 Go to previous message
Matthias Nick is currently offline Matthias NickFriend
Messages: 197
Registered: August 2013
Senior Member
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 Sad )

Hope this helps,
Best regards
Matthias
Previous Topic:Multiline text in colum
Next Topic:Using @ColumnData(SdkColumnCommand.IGNORE)
Goto Forum:
  


Current Time: Tue Mar 19 03:57:08 GMT 2024

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

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

Back to the top