Class Utils
java.lang.Object
ai.tutor.cab302exceptionalhandlers.Utils.Utils
General utility class for helper methods
- Author:
- Mason M.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Optional
<javafx.scene.control.ButtonType> showConfirmAlert
(String message) Displays a confirmation alert dialog with the specified message and returns the user's choice.static void
showErrorAlert
(String message) Displays an error alert dialog with the specified message.static void
showInfoAlert
(String message) Displays an information alert dialog with the specified message.static void
showWarningAlert
(String message) Displays a warning alert dialog with the specified message.static boolean
validateNullOrEmpty
(String value) Validates if a string is null or empty (after trimming whitespace).
-
Method Details
-
validateNullOrEmpty
Validates if a string is null or empty (after trimming whitespace).- Parameters:
value
- The string to validate.- Returns:
- True if the string is null or empty, false otherwise.
-
showErrorAlert
Displays an error alert dialog with the specified message.- Parameters:
message
- The error message to display.
-
showInfoAlert
Displays an information alert dialog with the specified message.- Parameters:
message
- The informational message to display.
-
showWarningAlert
Displays a warning alert dialog with the specified message.- Parameters:
message
- The warning message to display.
-
showConfirmAlert
Displays a confirmation alert dialog with the specified message and returns the user's choice.- Parameters:
message
- The confirmation message to display.- Returns:
- An
Optional
containing theButtonType
clicked by the user (e.g., OK, Cancel).
-