java.lang.Object
bayern.steinbrecher.javaUtility.DialogUtility
public final class DialogUtility
extends java.lang.Object
-
Field Summary
Fields Modifier and Type Field Description static intSIZEWidth/height of the alert type identifying icon. -
Method Summary
Modifier and Type Method Description static @NotNull javafx.scene.control.AlertcreateConfirmationAlert(javafx.scene.control.Alert.AlertType alertType, @NotNull java.lang.String... args)Creates anAlertwith given settings.static @NotNull javafx.scene.control.AlertcreateErrorAlert(@NotNull java.lang.String... args)static @NotNull javafx.scene.control.AlertcreateInfoAlert(@NotNull java.lang.String... args)static @NotNull javafx.scene.control.AlertcreateInteractiveAlert(javafx.scene.control.Alert.AlertType type, @Nullable java.lang.String message, @NotNull javafx.scene.control.ButtonType... buttons)static @NotNull javafx.scene.control.AlertcreateMessageAlert(@Nullable java.lang.String message, @NotNull java.lang.String... args)static @NotNull javafx.scene.control.AlertcreateStacktraceAlert(@NotNull java.lang.Throwable cause, @NotNull java.lang.String... args)static @NotNull javafx.scene.control.AlertcreateWarningAlert(@NotNull java.lang.String... args)static @NotNull java.util.Optional<javafx.scene.control.ButtonType>showAndWait(@NotNull javafx.scene.control.Alert alert)
-
Field Details
-
SIZE
public static final int SIZEWidth/height of the alert type identifying icon.- See Also:
- Constant Field Values
-
-
Method Details
-
createConfirmationAlert
@NotNull public static @NotNull javafx.scene.control.Alert createConfirmationAlert(@NotNull javafx.scene.control.Alert.AlertType alertType, @NotNull @NotNull java.lang.String... args) throws DialogCreationExceptionCreates anAlertwith given settings.- Parameters:
alertType- The type of the alert.args- The arguments containing the content, title and the header. NOTE: The order is important. If you specify less elements or an element isnullthese elements will have the default value according toAlert. If you specify more elements they will be ignored.- Returns:
- The created
Alert. - Throws:
DialogCreationException- Thrown if the creation of the dialog got interrupted on the JavaFX main application thread or if the internal dialog creation process is erroneous.
-
createInteractiveAlert
@NotNull public static @NotNull javafx.scene.control.Alert createInteractiveAlert(@NotNull javafx.scene.control.Alert.AlertType type, @Nullable @Nullable java.lang.String message, @NotNull @NotNull javafx.scene.control.ButtonType... buttons) throws DialogCreationException- Throws:
DialogCreationException
-
createStacktraceAlert
@NotNull public static @NotNull javafx.scene.control.Alert createStacktraceAlert(@NotNull @NotNull java.lang.Throwable cause, @NotNull @NotNull java.lang.String... args) throws DialogCreationException- Throws:
DialogCreationException
-
createWarningAlert
@NotNull public static @NotNull javafx.scene.control.Alert createWarningAlert(@NotNull @NotNull java.lang.String... args) throws DialogCreationException- Throws:
DialogCreationException
-
createErrorAlert
@NotNull public static @NotNull javafx.scene.control.Alert createErrorAlert(@NotNull @NotNull java.lang.String... args) throws DialogCreationException- Throws:
DialogCreationException
-
createInfoAlert
@NotNull public static @NotNull javafx.scene.control.Alert createInfoAlert(@NotNull @NotNull java.lang.String... args) throws DialogCreationException- Throws:
DialogCreationException
-
createMessageAlert
@NotNull public static @NotNull javafx.scene.control.Alert createMessageAlert(@Nullable @Nullable java.lang.String message, @NotNull @NotNull java.lang.String... args) throws DialogCreationException- Throws:
DialogCreationException
-
showAndWait
@NotNull public static @NotNull java.util.Optional<javafx.scene.control.ButtonType> showAndWait(@NotNull @NotNull javafx.scene.control.Alert alert)
-