Class Alerts

java.lang.Object
it.univr.wordautomata.alerts.Alerts

public class Alerts extends Object
The Alerts class provides utility methods for displaying different types of alert dialogs.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static javafx.scene.control.Alert
    createAlert(javafx.scene.control.Alert.AlertType type, javafx.scene.Scene scene, String title, String header, String body, javafx.scene.control.ButtonType... buttons)
    Creates an alert dialog with the specified type, scene, title, header, body, and buttons.
    static boolean
    showConfirmationDialog(javafx.scene.Scene scene, String title, String body)
    Displays a confirmation dialog with the specified title and body.
    static void
    showErrorDialog(javafx.scene.Scene scene, String title, String body, boolean showAndWait)
    Displays an error dialog with the specified title and body.
    static void
    showErrorDialog(javafx.scene.Scene scene, String title, String header, String body, boolean showAndWait)
    Displays an error dialog with the specified title, header, and body.
    static void
    showInformationDialog(javafx.scene.Scene scene, String title, String body)
    Displays an information dialog with the specified title and body.
    static void
    showInformationDialog(javafx.scene.Scene scene, String title, String header, String body)
    Displays an information dialog with the specified title, header, and body.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Alerts

      public Alerts()
  • Method Details

    • showConfirmationDialog

      public static boolean showConfirmationDialog(javafx.scene.Scene scene, String title, String body)
      Displays a confirmation dialog with the specified title and body.
      Parameters:
      scene - the scene to which the dialog belongs
      title - the title of the dialog
      body - the body text of the dialog
      Returns:
      true if the user clicks the "Yes" button, false otherwise
    • showInformationDialog

      public static void showInformationDialog(javafx.scene.Scene scene, String title, String body)
      Displays an information dialog with the specified title and body.
      Parameters:
      scene - the scene to which the dialog belongs
      title - the title of the dialog
      body - the body text of the dialog
    • showInformationDialog

      public static void showInformationDialog(javafx.scene.Scene scene, String title, String header, String body)
      Displays an information dialog with the specified title, header, and body.
      Parameters:
      scene - the scene to which the dialog belongs
      title - the title of the dialog
      header - the header text of the dialog
      body - the body text of the dialog
    • showErrorDialog

      public static void showErrorDialog(javafx.scene.Scene scene, String title, String body, boolean showAndWait)
      Displays an error dialog with the specified title and body.
      Parameters:
      scene - the scene to which the dialog belongs
      title - the title of the dialog
      body - the body text of the dialog
      showAndWait - true if the dialog should be shown and wait for user input, false otherwise
    • showErrorDialog

      public static void showErrorDialog(javafx.scene.Scene scene, String title, String header, String body, boolean showAndWait)
      Displays an error dialog with the specified title, header, and body.
      Parameters:
      scene - the scene to which the dialog belongs
      title - the title of the dialog
      header - the header text of the dialog
      body - the body text of the dialog
      showAndWait - true if the dialog should be shown and wait for user input, false otherwise
    • createAlert

      public static javafx.scene.control.Alert createAlert(javafx.scene.control.Alert.AlertType type, javafx.scene.Scene scene, String title, String header, String body, javafx.scene.control.ButtonType... buttons)
      Creates an alert dialog with the specified type, scene, title, header, body, and buttons.
      Parameters:
      type - the type of the alert dialog
      scene - the scene to which the dialog belongs
      title - the title of the dialog
      header - the header text of the dialog
      body - the body text of the dialog
      buttons - the buttons to be displayed in the dialog
      Returns:
      the created alert dialog