public final WorkbenchDialogBuilder onResult(Consumer<ButtonType> onResult) {
      this.onResult = onResult;
      return this;
    }
Defines the action to perform when a button of the dialog was pressed.

@param onResult action to be performed
@return builder for chaining
@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