java.lang.Object
no.ntnu.principes.util.AlertUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidDisplays an error alert with a default title and the specified message.static voidDisplays an error alert with the specified title and message.static booleanChecks if alerts are currently enabled in the application.static voidsetEnabled(boolean enabled) Enables or disables the display of alert dialogs in the application.static voidDisplays a success alert with a default title and the specified message.static voidDisplays a success alert with the specified title and message.
-
Constructor Details
-
AlertUtil
public AlertUtil()
-
-
Method Details
-
success
Displays a success alert with the specified title and message.- Parameters:
title- The title of the alert dialogmessage- The content message to display
-
success
Displays a success alert with a default title and the specified message.- Parameters:
message- The content message to display
-
error
Displays an error alert with the specified title and message.- Parameters:
title- The title of the alert dialogmessage- The content message to display
-
error
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:
trueif alerts are enabled and will be displayed;falseotherwise
-