diff options
-rw-r--r-- | src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/Helper.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/Helper.java b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/Helper.java index 077c57a..17d2019 100644 --- a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/Helper.java +++ b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/controller/Helper.java @@ -6,8 +6,19 @@ import javafx.scene.control.ButtonType; class Helper { + private static final String ALERT_TITLE_VALIDATION_ERROR = "Validierungsfehler"; + private static final String ALERT_TITLE_SERVICE_EXCEPTION = "Fehler"; + private Helper() {} // SonarLint insisted to create a private constructor to hide the public one + static void showValidationErrorAlertAndWait(String message) { + showAlertWithOkButtonAndWait(AlertType.ERROR, ALERT_TITLE_VALIDATION_ERROR, message); + } + + static void showServiceExceptionAlertAndWait(String message) { + showAlertWithOkButtonAndWait(AlertType.ERROR, ALERT_TITLE_SERVICE_EXCEPTION, message); + } + static void showAlertWithOkButtonAndWait( AlertType alertType, String headerText, String contentText) { Alert alert = new Alert(alertType, contentText, ButtonType.OK); |