Rather than have the following result converter:
dialog.setResultConverter((dialogButton) -> dialogButton == yourOkButton ? dialog.getEditor().getText() : null);
We should have the following:
setResultConverter((dialogButton) -> {
ButtonBar.ButtonData data = dialogButton == null ? null : dialogButton.getButtonData();
return data == ButtonBar.ButtonData.OK_DONE ? getSelectedItem() : null;
});
This allows for alternative ButtonTypes to be set that are OK_DONE ButtonData instances, rather than forcing the requirement to use the pre-defined ButtonType.OK button.
dialog.setResultConverter((dialogButton) -> dialogButton == yourOkButton ? dialog.getEditor().getText() : null);
We should have the following:
setResultConverter((dialogButton) -> {
ButtonBar.ButtonData data = dialogButton == null ? null : dialogButton.getButtonData();
return data == ButtonBar.ButtonData.OK_DONE ? getSelectedItem() : null;
});
This allows for alternative ButtonTypes to be set that are OK_DONE ButtonData instances, rather than forcing the requirement to use the pre-defined ButtonType.OK button.