In #7, an inquiry was made regarding the availability of an option to prevent menu closure. As this feature was not previously included, I have incorporated it into this pull request.
Two new onClose methods have been introduced to MenuContentsEvents, each equipped with a supplier to provide a MenuCloseResult. This new MenuCloseResult encompasses two enum constants: KEEP_OPEN and CLOSE, whose purposes are self-explanatory.
When returning the enum constant KEEP_OPEN prior to handling unregister logic (the default behavior), the menu will simply reopen with the same cache, pagination pages, events, etc. If KEEP_OPEN is returned after handling unregister logic, the menu will reopen with all settings restored to their initial state.
The existing onClose event methods remain intact and do not necessitate a return of MenuCloseResult. They will function equivalently to returning CLOSE in the new event methods.
In #7, an inquiry was made regarding the availability of an option to prevent menu closure. As this feature was not previously included, I have incorporated it into this pull request.
Two new onClose methods have been introduced to
MenuContentsEvents
, each equipped with a supplier to provide a MenuCloseResult. This newMenuCloseResult
encompasses two enum constants:KEEP_OPEN
andCLOSE
, whose purposes are self-explanatory.When returning the enum constant
KEEP_OPEN
prior to handling unregister logic (the default behavior), the menu will simply reopen with the same cache, pagination pages, events, etc. IfKEEP_OPEN
is returned after handling unregister logic, the menu will reopen with all settings restored to their initial state.The existing onClose event methods remain intact and do not necessitate a return of MenuCloseResult. They will function equivalently to returning
CLOSE
in the new event methods.