public final void setOnResult(Consumer<ButtonType> onResult) {
    if (Objects.isNull(onResult)) {
      // set empty consumer instead to avoid NPE
      onResult = buttonType -> {
      };
    }
    this.onResult.set(onResult);
  }
Defines the action to perform when a button of the dialog was pressed.
The resulting {@link ButtonType} usually reflects the {@link Button} which was pressed in the
dialog.<br>
If the dialog is non-blocking and has been closed by pressing on the {@link GlassPane} or
{@link KeyCode#ESCAPE}, the result will be the {@link ButtonType} of
{@link Button#isCancelButton()} in the dialog.<br>
If there is no {@link Button#isCancelButton()}, the result will be {@link ButtonType#CANCEL}.
<br>If there is no {@link Button#isDefaultButton()} and there is only one {@link Button} in the
dialog, pressing {@link KeyCode#ENTER} will close the dialog with the result of
this {@link Button}.

@param onResult action to be performed
@implNote If {@code onResult} is null, an empty consumer will be set instead, to avoid
          throwing {@link NullPointerException} upon calling.
workbenchfx-core/src/main/java/com/dlsc/workbenchfx/model/WorkbenchDialog.java