public class Dialogs
extends java.lang.Object
| Constructor and Description |
|---|
Dialogs() |
| Modifier and Type | Method and Description |
|---|---|
static javafx.scene.control.ButtonType |
confirmDialog(javafx.scene.Node node,
java.lang.String header,
java.lang.String content,
javafx.scene.control.ButtonType... buttons)
Displays a confirmation dialog box.
|
static javafx.scene.control.ButtonType |
confirmDialog(javafx.scene.Node node,
java.lang.String header,
java.lang.String content,
javafx.scene.Node icon,
javafx.scene.control.ButtonType... buttons)
Displays a confirmation dialog box.
|
static javafx.scene.control.ButtonType |
confirmSaveDialog(javafx.scene.Node node,
java.lang.String fileName)
Displays a dialog box that provides the end user with an opportunity to save the current state
|
static void |
displayException(java.lang.String header,
java.lang.Throwable e,
javafx.scene.Node owner)
Displays a modal dialog box to shows details about an
Exception. |
static javafx.stage.Stage |
getStage(javafx.scene.Node node)
Returns the
Stage instance to which the provided Node is attached |
static void |
launchUrlInExternalBrowser(java.lang.String url)
Launch the system default browser to browse the provided URL
|
static void |
notifyError(java.lang.String title,
java.lang.Exception e,
javafx.geometry.Pos position,
javafx.scene.Node owner) |
static void |
notifyError(java.lang.String title,
java.lang.String message,
javafx.geometry.Pos position,
javafx.scene.Node owner)
Display an error notification
|
static void |
notifyException(java.lang.String header,
java.lang.Throwable e)
Display an error notification
|
static void |
notifyException(java.lang.String title,
java.lang.Throwable e,
javafx.scene.Node owner)
Display an error notification
|
static void |
notifyException(java.lang.Throwable e)
Display an error notification
|
static void |
notifyInfo(java.lang.String title,
java.lang.String message,
javafx.geometry.Pos position,
javafx.scene.Node owner)
Display an info notification
|
static void |
notifyWarning(java.lang.String title,
java.lang.String message,
javafx.geometry.Pos position,
javafx.scene.Node owner)
Display an warning notification
|
static void |
runOnFXThread(java.lang.Runnable r)
Ensures that the provided
Runnable is executed on the JavaFX application thread. |
static void |
setAlwaysOnTop(javafx.scene.control.Dialog dialog)
Forces the provided
Dialog to always appear on top of other windows. |
public static void notifyException(java.lang.Throwable e)
e - the exception to displaypublic static void notifyException(java.lang.String header,
java.lang.Throwable e)
header - the header text for the dialoge - the exception to displaypublic static void notifyException(java.lang.String title,
java.lang.Throwable e,
javafx.scene.Node owner)
title - the title for the notificatione - the exception to notifyowner - the node to which the notification is attachedpublic static void displayException(java.lang.String header,
java.lang.Throwable e,
javafx.scene.Node owner)
Exception.header - the header text for the dialoge - the exception to displayowner - the Node used to recover the stage the dialog should be linked topublic static void notifyError(java.lang.String title,
java.lang.String message,
javafx.geometry.Pos position,
javafx.scene.Node owner)
title - the title for the notificationmessage - the title for the notificationposition - the position for the notificationowner - the node to which the notification is attachedpublic static void notifyError(java.lang.String title,
java.lang.Exception e,
javafx.geometry.Pos position,
javafx.scene.Node owner)
public static void notifyWarning(java.lang.String title,
java.lang.String message,
javafx.geometry.Pos position,
javafx.scene.Node owner)
title - the title for the notificationmessage - the title for the notificationowner - the node to which the notification is attachedpublic static void notifyInfo(java.lang.String title,
java.lang.String message,
javafx.geometry.Pos position,
javafx.scene.Node owner)
title - the title for the notificationmessage - the title for the notificationowner - the node to which the notification is attachedpublic static javafx.stage.Stage getStage(javafx.scene.Node node)
Stage instance to which the provided Node is attachednode - the node to get the stage for.Stage instance to which the provided Node is attachedpublic static void launchUrlInExternalBrowser(java.lang.String url)
throws java.io.IOException,
java.net.URISyntaxException
url - a string that represent the url to point the browser atjava.io.IOException - if the default browser is not found or fails to be launchedjava.net.URISyntaxException - if the string could not be transform into a proper URIpublic static javafx.scene.control.ButtonType confirmSaveDialog(javafx.scene.Node node,
java.lang.String fileName)
node - the node to get the stage forfileName - the name of the file to saveButtonType for the button that was chosen by the userpublic static javafx.scene.control.ButtonType confirmDialog(javafx.scene.Node node,
java.lang.String header,
java.lang.String content,
javafx.scene.control.ButtonType... buttons)
node - a node attached to the stage to be used as the owner of the dialog.header - the header message for the dialog.content - the main message for the dialog.buttons - the ButtonType that should be displayed on the confirmation dialog.ButtonType corresponding to user's choice.public static javafx.scene.control.ButtonType confirmDialog(javafx.scene.Node node,
java.lang.String header,
java.lang.String content,
javafx.scene.Node icon,
javafx.scene.control.ButtonType... buttons)
node - a node attached to the stage to be used as the owner of the dialog.header - the header message for the dialog.content - the main message for the dialog.icon - the icon for the dialog.buttons - the ButtonType that should be displayed on the confirmation dialog.ButtonType corresponding to user's choice.public static void runOnFXThread(java.lang.Runnable r)
Runnable is executed on the JavaFX application thread.r - the Runnable to execute on the JavaFX application threadpublic static void setAlwaysOnTop(javafx.scene.control.Dialog dialog)
Dialog to always appear on top of other windows.dialog - the dialog to set always on top.Copyright © 2018 Frederic Thevenet. All rights reserved.