Interface InputDialogBuilder<T>

All Superinterfaces:
DialogBuilder<InputDialogBuilder<T>>

public interface InputDialogBuilder<T> extends DialogBuilder<InputDialogBuilder<T>>
Displays the component from a given component value in a dialog and returns the value if the user accepts the input.
  • Method Details

    • caption

      InputDialogBuilder<T> caption(String caption)
      Parameters:
      caption - the label caption
      Returns:
      this builder instance
    • valid

      A StateObserver indicating whether the input is valid, this state controls the enabled state of the OK button. Overrides validator(Predicate).
      Parameters:
      valid - a StateObserver indicating whether the input value is valid
      Returns:
      this builder instance
    • validator

      InputDialogBuilder<T> validator(Predicate<T> validator)
      Sets the valid(StateObserver) according to the given predicate.
      Parameters:
      validator - the valididator predicate
      Returns:
      this builder instance
    • show

      void show(Predicate<T> closeDialog)
      Shows the input dialog and calls closeDialog with the current input when OK is pressed, closing the dialog if the predicate returns true.
      Parameters:
      closeDialog - called with the current input to determine if the the dialog should be closed
    • show

      T show()
      Shows the input dialog and returns the value if the user presses OK
      Returns:
      the value from the component value if the user accepts the input
      Throws:
      CancelException - in case the user cancels