Module AM37

Class SingleChoiceListDialog

All Implemented Interfaces:
KeyEventListener
Direct Known Subclasses:
DetailedSingleChoiceListDialog

public class SingleChoiceListDialog
extends InputDialog
A dialog showing a list of elements; when the enter key is pressed, the currently selected item is triggered, causing it to return its value to the inputManager and this to be closed
  • Constructor Details

    • SingleChoiceListDialog

      public SingleChoiceListDialog​(java.lang.String title, java.lang.String message, Window caller, java.util.List<java.lang.String> options)
      Default constructor

      Creates a SimpleListChoiceDialog, which dimensions are adapted on the options provided; if other dialogs are already showing, the new dialog is created at an offset from the already existing one
      The console echo is disabled as soon as the Dialog is created

      Parameters:
      title - the dialog title
      message - the dialog message
      caller - the window which invoked this
      options - the options to show
    • SingleChoiceListDialog

      public SingleChoiceListDialog​(java.lang.String title, java.lang.String message, Window caller, java.util.List<java.lang.String> options, int width, int height, CursorPosition initCoord)
      Custom constructor

      Creates a SimpleListChoiceDialog, using custom if other dialogs are already showing, the new dialog is created at an offset from the already existing one
      The console echo is disabled as soon as the Dialog is created

      Parameters:
      title - the dialog title
      message - the dialog message
      caller - the window which invoked this
      options - the options to show
      initCoord - the initial coordinates
  • Method Details

    • width

      protected static int width​(java.util.List<java.lang.String> options)
      Determines the dialog width based on the number of options
      Parameters:
      options - the list of options
      Returns:
      the adapted dialog size