Class JavaFxDialogService
java.lang.Object
dev.zemco.codegame.presentation.dialog.JavaFxDialogService
- All Implemented Interfaces:
IDialogService
Implementation of a service for presenting popup dialogs to the user using JavaFX.
They are presented in a separate modal window synchronously by blocking the calling
thread until
they are closed by the user.
For simple alerts (error and
information types), the JavaFX class Alert
with appropriate Alert.AlertType was used.
- Author:
- Erik Zemčík
- See Also:
-
Alert
-
Constructor Summary
ConstructorsConstructorDescriptionJavaFxDialogService(IAlertFactory alertFactory) Creates an instance ofJavaFxDialogServicethat presents popup dialogs to user using JavaFX. -
Method Summary
Modifier and TypeMethodDescriptionvoidshowErrorDialog(String title, String message) Displays an error alert dialog to the user.voidshowInformationDialog(String title, String message) Displays an information alert dialog to the user.
-
Constructor Details
-
JavaFxDialogService
Creates an instance ofJavaFxDialogServicethat presents popup dialogs to user using JavaFX.- Parameters:
alertFactory- source of alerts- Throws:
IllegalArgumentException- ifalertFactoryisnull
-
-
Method Details
-
showErrorDialog
Description copied from interface:IDialogServiceDisplays an error alert dialog to the user. Blocks the currentthreaduntil it is closed.- Specified by:
showErrorDialogin interfaceIDialogService- Parameters:
title- title of the dialogmessage- message of the dialog
-
showInformationDialog
Description copied from interface:IDialogServiceDisplays an information alert dialog to the user. Blocks the currentthreaduntil it is closed.- Specified by:
showInformationDialogin interfaceIDialogService- Parameters:
title- title of the dialogmessage- message of the dialog
-