Class TextInputDialog

All Implemented Interfaces:
BasePane, Composite, Window

public class TextInputDialog extends DialogWindow
TextInputDialog is a modal text input dialog that prompts the user to enter a text string. The class supports validation and password masking. The builder class to help setup TextInputDialogs is TextInputDialogBuilder.
  • Field Details

  • Constructor Details

  • Method Details

    • onOK

      private void onOK()
    • onCancel

      private void onCancel()
    • showDialog

      public String showDialog(WindowBasedTextGUI textGUI)
      Description copied from class: DialogWindow
      Opens the dialog by showing it on the GUI and doesn't return until the dialog has been closed
      Overrides:
      showDialog in class DialogWindow
      Parameters:
      textGUI - Text GUI to add the dialog to
      Returns:
      Depending on the DialogWindow implementation, by default null
    • showDialog

      public static String showDialog(WindowBasedTextGUI textGUI, String title, String description, String initialContent)
      Shortcut for quickly showing a TextInputDialog
      Parameters:
      textGUI - GUI to show the dialog on
      title - Title of the dialog
      description - Description of the dialog
      initialContent - What content to place in the text box initially
      Returns:
      The string the user typed into the text box, or null if the dialog was cancelled
    • showNumberDialog

      public static BigInteger showNumberDialog(WindowBasedTextGUI textGUI, String title, String description, String initialContent)
      Shortcut for quickly showing a TextInputDialog that only accepts numbers
      Parameters:
      textGUI - GUI to show the dialog on
      title - Title of the dialog
      description - Description of the dialog
      initialContent - What content to place in the text box initially
      Returns:
      The number the user typed into the text box, or null if the dialog was cancelled
    • showPasswordDialog

      public static String showPasswordDialog(WindowBasedTextGUI textGUI, String title, String description, String initialContent)
      Shortcut for quickly showing a TextInputDialog with password masking
      Parameters:
      textGUI - GUI to show the dialog on
      title - Title of the dialog
      description - Description of the dialog
      initialContent - What content to place in the text box initially
      Returns:
      The string the user typed into the text box, or null if the dialog was cancelled