Class Dialogs


  • public final class Dialogs
    extends java.lang.Object
    Static helpers that open modal dialogs as centered, bordered Form overlays; all methods must be called on the UI thread.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static OverlayHandle alert​(App app, java.lang.String message)
      Opens a modal alert showing a message with an OK button; closes on OK or ESC.
      static OverlayHandle confirm​(App app, java.lang.String message, java.lang.Runnable onYes)
      Opens a modal confirmation with Yes and No buttons; Yes runs the callback then closes, No or ESC just close.
      static OverlayHandle prompt​(App app, java.lang.String title, java.util.function.Consumer<java.lang.String> onSubmit)
      Opens a modal prompt with a title, a text field, and OK and Cancel buttons; OK or Enter in the field submits the entered text then closes, Cancel or ESC just close.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • alert

        public static OverlayHandle alert​(App app,
                                          java.lang.String message)
        Opens a modal alert showing a message with an OK button; closes on OK or ESC.
        Parameters:
        app - the application to open the overlay on
        message - the message to display
        Returns:
        the handle for the opened overlay
      • confirm

        public static OverlayHandle confirm​(App app,
                                            java.lang.String message,
                                            java.lang.Runnable onYes)
        Opens a modal confirmation with Yes and No buttons; Yes runs the callback then closes, No or ESC just close.
        Parameters:
        app - the application to open the overlay on
        message - the message to display
        onYes - the action run when Yes is chosen
        Returns:
        the handle for the opened overlay
      • prompt

        public static OverlayHandle prompt​(App app,
                                           java.lang.String title,
                                           java.util.function.Consumer<java.lang.String> onSubmit)
        Opens a modal prompt with a title, a text field, and OK and Cancel buttons; OK or Enter in the field submits the entered text then closes, Cancel or ESC just close.
        Parameters:
        app - the application to open the overlay on
        title - the title shown above the field
        onSubmit - the submit handler
        Returns:
        the handle for the opened overlay