Class AlertUtil

java.lang.Object
no.ntnu.principes.util.AlertUtil

public class AlertUtil extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    error(String message)
    Displays an error alert with a default title and the specified message.
    static void
    error(String title, String message)
    Displays an error alert with the specified title and message.
    static boolean
    Checks if alerts are currently enabled in the application.
    static void
    setEnabled(boolean enabled)
    Enables or disables the display of alert dialogs in the application.
    static void
    success(String message)
    Displays a success alert with a default title and the specified message.
    static void
    success(String title, String message)
    Displays a success alert with the specified title and message.

    Methods inherited from class java.lang.Object

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

    • AlertUtil

      public AlertUtil()
  • Method Details

    • success

      public static void success(String title, String message)
      Displays a success alert with the specified title and message.
      Parameters:
      title - The title of the alert dialog
      message - The content message to display
    • success

      public static void success(String message)
      Displays a success alert with a default title and the specified message.
      Parameters:
      message - The content message to display
    • error

      public static void error(String title, String message)
      Displays an error alert with the specified title and message.
      Parameters:
      title - The title of the alert dialog
      message - The content message to display
    • error

      public static void error(String message)
      Displays an error alert with a default title and the specified message.
      Parameters:
      message - The content message to display
    • setEnabled

      public static void setEnabled(boolean enabled)
      Enables or disables the display of alert dialogs in the application. When disabled, all alert dialogs will be suppressed and not shown to the user.
      Parameters:
      enabled - A boolean value indicating whether alerts should be enabled (true) or disabled (false)
    • isEnabled

      public static boolean isEnabled()
      Checks if alerts are currently enabled in the application.
      Returns:
      true if alerts are enabled and will be displayed; false otherwise