Class ListSelectDialogBuilder<T>

    • Field Detail

      • content

        private final java.util.List<T> content
      • canCancel

        private boolean canCancel
    • Constructor Detail

      • ListSelectDialogBuilder

        public ListSelectDialogBuilder()
        Default constructor
    • Method Detail

      • setListBoxSize

        public ListSelectDialogBuilder<T> setListBoxSize​(TerminalSize listBoxSize)
        Sets the size of the list box in the dialog, scrollbars will be used if there is not enough space to draw all items. If set to null, the dialog will ask for enough space to be able to draw all items.
        Parameters:
        listBoxSize - Size of the list box in the dialog
        Returns:
        Itself
      • getListBoxSize

        public TerminalSize getListBoxSize()
        Size of the list box in the dialog or null if the dialog will ask for enough space to draw all items
        Returns:
        Size of the list box in the dialog or null if the dialog will ask for enough space to draw all items
      • setCanCancel

        public ListSelectDialogBuilder<T> setCanCancel​(boolean canCancel)
        Sets if the dialog can be cancelled or not (default: true)
        Parameters:
        canCancel - If true, the user has the option to cancel the dialog, if false there is no such button in the dialog
        Returns:
        Itself
      • isCanCancel

        public boolean isCanCancel()
        Returns true if the dialog can be cancelled once it's opened
        Returns:
        true if the dialog can be cancelled once it's opened
      • addListItem

        public ListSelectDialogBuilder<T> addListItem​(T item)
        Adds an item to the list box at the end
        Parameters:
        item - Item to add to the list box
        Returns:
        Itself
      • addListItems

        @SafeVarargs
        public final ListSelectDialogBuilder<T> addListItems​(T... items)
        Adds a list of items to the list box at the end, in the order they are passed in
        Parameters:
        items - Items to add to the list box
        Returns:
        Itself
      • getListItems

        public java.util.List<T> getListItems()
        Returns a copy of the list of items in the list box
        Returns:
        Copy of the list of items in the list box