Class AbstractDialogBuilder<B,T extends DialogWindow>

java.lang.Object
com.googlecode.lanterna.gui2.dialogs.AbstractDialogBuilder<B,T>
Type Parameters:
B - The real type of the builder class
T - Type of dialog this builder is building
Direct Known Subclasses:
ActionListDialogBuilder, DirectoryDialogBuilder, FileDialogBuilder, ListSelectDialogBuilder, TextInputDialogBuilder

public abstract class AbstractDialogBuilder<B,T extends DialogWindow> extends Object
Abstract class for dialog building, containing much shared code between different kinds of dialogs
  • Field Details

    • title

      protected String title
    • description

      protected String description
    • extraWindowHints

      protected Set<Window.Hint> extraWindowHints
  • Constructor Details

    • AbstractDialogBuilder

      public AbstractDialogBuilder(String title)
      Default constructor for a dialog builder
      Parameters:
      title - Title to assign to the dialog
  • Method Details

    • setTitle

      public B setTitle(String title)
      Changes the title of the dialog
      Parameters:
      title - New title
      Returns:
      Itself
    • getTitle

      public String getTitle()
      Returns the title that the built dialog will have
      Returns:
      Title that the built dialog will have
    • setDescription

      public B setDescription(String description)
      Changes the description of the dialog
      Parameters:
      description - New description
      Returns:
      Itself
    • getDescription

      public String getDescription()
      Returns the description that the built dialog will have
      Returns:
      Description that the built dialog will have
    • setExtraWindowHints

      public B setExtraWindowHints(Set<Window.Hint> extraWindowHints)
      Assigns a set of extra window hints that you want the built dialog to have
      Parameters:
      extraWindowHints - Window hints to assign to the window in addition to the ones the builder will put
      Returns:
      Itself
    • getExtraWindowHints

      public Set<Window.Hint> getExtraWindowHints()
      Returns the list of extra window hints that will be assigned to the window when built
      Returns:
      List of extra window hints that will be assigned to the window when built
    • self

      protected abstract B self()
      Helper method for casting this to type parameter B
      Returns:
      this as B
    • buildDialog

      protected abstract T buildDialog()
      Builds the dialog according to the builder implementation
      Returns:
      New dialog object
    • build

      public final T build()
      Builds a new dialog following the specifications of this builder
      Returns:
      New dialog built following the specifications of this builder