Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8092713

[Dialogs] TextInput and Choice dialogs should compare result against ButtonData, not ButtonType

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 8u40
    • 8u40
    • javafx
    • None

      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.

            jgiles Jonathan Giles
            jgiles Jonathan Giles
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: