Interface SelectionDialogBuilder<T>

Type Parameters:
T - the value type
All Superinterfaces:
DialogBuilder<SelectionDialogBuilder<T>>

public interface SelectionDialogBuilder<T> extends DialogBuilder<SelectionDialogBuilder<T>>
A builder for a selection dialog.
  • Method Details

    • defaultSelection

      SelectionDialogBuilder<T> defaultSelection(T defaultSelection)
      Parameters:
      defaultSelection - the item selected by default
      Returns:
      this SelectionDialogBuilder instance
      Throws:
      IllegalArgumentException - in case the selection values do not contain the default selection item
    • defaultSelection

      SelectionDialogBuilder<T> defaultSelection(Collection<T> defaultSelection)
      Parameters:
      defaultSelection - the items selected by default
      Returns:
      this SelectionDialogBuilder instance
      Throws:
      IllegalArgumentException - in case the selection values do not contain the default selection items
    • allowEmptySelection

      SelectionDialogBuilder<T> allowEmptySelection(boolean allowEmptySelection)
      Parameters:
      allowEmptySelection - if true then the dialog accepts an empty selection, default false
      Returns:
      this SelectionDialogBuilder instance
    • dialogSize

      SelectionDialogBuilder<T> dialogSize(Dimension dialogSize)
      Parameters:
      dialogSize - the preferred dialog size
      Returns:
      this SelectionDialogBuilder instance
    • selectSingle

      Optional<T> selectSingle()
      Returns:
      the selected value, Optional.empty() if none was selected
      Throws:
      CancelException - in case the user cancelled
    • select

      Collection<T> select()
      Returns:
      the selected values, an empty Collection if none was selected
      Throws:
      CancelException - in case the user cancelled