Package com.tonic.vellum.widget
Class Dialogs
- java.lang.Object
-
- com.tonic.vellum.widget.Dialogs
-
public final class Dialogs extends java.lang.ObjectStatic 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 OverlayHandlealert(App app, java.lang.String message)Opens a modal alert showing a message with an OK button; closes on OK or ESC.static OverlayHandleconfirm(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 OverlayHandleprompt(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.
-
-
-
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 onmessage- 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 onmessage- the message to displayonYes- 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 ontitle- the title shown above the fieldonSubmit- the submit handler- Returns:
- the handle for the opened overlay
-
-