onBeforeClose

Called just before a voluntary close. Return CloseAction.DENY_CLOSE to override the close. Make sure to update your state such that the user can close the gui afterward.