java.lang.Object
page.codeberg.friedolyn.gui.Popup
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidShows an alert popup and waits for the user to close it.static voidShows an alert popup.static booleanShows a confirmation popup.static booleanconfirm(@NonNull String title, @NonNull String header, @NonNull String content, @NonNull String confirm, @NonNull String cancel) Shows a confirmation popup with a custom confirm and cancel button text.static voidShows an informational popup that does not require user interaction.private static voidpopup(javafx.scene.control.Alert.AlertType type, @NonNull String title, @NonNull String header, @NonNull String content, boolean wait) Shows a popup of a givenAlert.AlertType.
-
Constructor Details
-
Popup
public Popup()
-
-
Method Details
-
alert
-
alert
public static void alert(@NonNull @NonNull String title, @NonNull @NonNull String header, @NonNull @NonNull String content, boolean wait) Shows an alert popup.- Parameters:
title- Title of the popupheader- Headline of the popupcontent- description text of the popupwait- whether to wait for the user to close the popup
-
confirm
-
confirm
public static boolean confirm(@NonNull @NonNull String title, @NonNull @NonNull String header, @NonNull @NonNull String content, @NonNull @NonNull String confirm, @NonNull @NonNull String cancel) Shows a confirmation popup with a custom confirm and cancel button text.- Parameters:
title- Title of the popupheader- Headline of the popupcontent- Description text of the popupconfirm- Text of the confirm button. If the user clicks this button, the method returns true.cancel- Text of the cancel button. If the user clicks this button, the method returns false.- Returns:
- true if the user clicked the confirm button, false if the user clicked the cancel button
- See Also:
-
info
public static void info(@NonNull @NonNull String title, @NonNull @NonNull String header, @NonNull @NonNull String content) Shows an informational popup that does not require user interaction. Does not wait for the user to close.- Parameters:
title- Title of the popupheader- Headline of the popupcontent- Description text of the popup
-
popup
private static void popup(@NonNull javafx.scene.control.Alert.AlertType type, @NonNull @NonNull String title, @NonNull @NonNull String header, @NonNull @NonNull String content, boolean wait) Shows a popup of a givenAlert.AlertType.- Parameters:
type- the AlertTypetitle- the title of the popupheader- the headline of the popupcontent- the description text of the popup
-