Package net.minheur.potoflux.ui
Class UiUtils
java.lang.Object
net.minheur.potoflux.ui.UiUtils
A utility class for UI related
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SmartSupplier<javafx.scene.control.ButtonType>Button type preset for theAPPLYaction.static final SmartSupplier<javafx.scene.control.ButtonType>Button type preset for theCANCELaction.static final SmartSupplier<javafx.scene.control.ButtonType>Button type preset for theCLOSEaction.static final SmartSupplier<javafx.scene.control.ButtonType>Button type preset for theCONFIRMaction.static final SmartSupplier<javafx.scene.control.ButtonType>Button type preset for theFINISHaction.static final SmartSupplier<javafx.scene.control.ButtonType>Button type preset for theNOaction.static final SmartSupplier<javafx.scene.control.ButtonType>Button type preset for theOKaction.static final SmartSupplier<javafx.scene.control.ButtonType>Button type preset for theYESaction. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidhideNode(@NotNull javafx.scene.Node node) Hides a node, and also makes sure it isn't managed so it don't take empty roomstatic voidshowAlert(javafx.scene.control.Alert.AlertType type, String message, String title, String header, @Nullable String cssDir, @Nullable String iconDir) Show anAlertto the user
IfLogicDelayedPopupsRegistry.isOpened()istrue, meaning we are actually running the logic action runs, adds the alert to the delayed popup reg.static booleanshowConfirmationDialog(String message) Displays a confirmation dialogstatic booleanshowConfirmationDialog(javafx.scene.Node content) Displays a confirmation dialogstatic booleanshowConfirmationDialog(javafx.scene.Node content, @Nullable String header) Displays a confirmation dialogstatic booleanshowConfirmationDialog(javafx.scene.Node content, @Nullable String header, javafx.scene.control.Alert.AlertType preciseType) Displays a confirmation dialogstatic voidshowErrorPane(String message) Displays an error panestatic <R> RshowInputDialog(@NotNull R[] options, int defaultIndex, @Nullable String title, @Nullable String header, @Nullable String content) Displays an input dialogstatic <R> RshowInputDialog(@NotNull R[] options, int defaultIndex, @Nullable String title, @Nullable String header, @Nullable String content, @Nullable String iconDir, @Nullable String cssDir) Displays an input dialogstatic <R> RshowInputDialog(@NotNull R[] options, int defaultIndex, @Nullable String title, @Nullable String header, @Nullable String content, String cssDir) Displays an input dialogstatic voidshowMessagePane(String message) Displays an information panestatic voidshowNode(@NotNull javafx.scene.Node node) Show a node, used to invert action ofhideNode(Node)
-
Field Details
-
okButton
Button type preset for theOKaction. Include traduction -
confirmButton
Button type preset for theCONFIRMaction. Include traduction -
cancelButton
Button type preset for theCANCELaction. Include traduction -
closeButton
Button type preset for theCLOSEaction. Include traduction -
yesButton
Button type preset for theYESaction. Include traduction -
noButton
Button type preset for theNOaction. Include traduction -
applyButton
Button type preset for theAPPLYaction. Include traduction -
finishButton
Button type preset for theFINISHaction. Include traduction
-
-
Method Details
-
showAlert
public static void showAlert(javafx.scene.control.Alert.AlertType type, String message, String title, String header, @Nullable @Nullable String cssDir, @Nullable @Nullable String iconDir) Show anAlertto the user
IfLogicDelayedPopupsRegistry.isOpened()istrue, meaning we are actually running the logic action runs, adds the alert to the delayed popup reg.- Parameters:
type- theAlert.AlertTypeof the alertmessage- what will be displayed in the main message areatitle- displayed in the alert's barheader- what is displayed in the upper areacssDir- path to the file containing the styles for the alerticonDir- path to the icon's file used as the header's graphic
-
showErrorPane
Displays an error pane- Parameters:
message- displayed to the user, actual error
-
showMessagePane
Displays an information pane- Parameters:
message- displayed to the user, actual info
-
showConfirmationDialog
public static boolean showConfirmationDialog(javafx.scene.Node content, @Nullable @Nullable String header, @Nullable javafx.scene.control.Alert.AlertType preciseType) Displays a confirmation dialog- Parameters:
content- message node to display as confirmationheader- text displayed in the alert's headerpreciseType- if specified, overrides the Alert.AlertType.CONFIRMATION default value- Returns:
- weather the user confirmed
-
showConfirmationDialog
public static boolean showConfirmationDialog(javafx.scene.Node content, @Nullable @Nullable String header) Displays a confirmation dialog- Parameters:
content- message node to display as confirmationheader- text displayed in the alert's header- Returns:
- weather the user confirmed
-
showConfirmationDialog
public static boolean showConfirmationDialog(javafx.scene.Node content) Displays a confirmation dialog- Parameters:
content- message node to display as confirmation- Returns:
- weather the user confirmed
-
showConfirmationDialog
Displays a confirmation dialog- Parameters:
message- text to display as confirmation- Returns:
- weather the user confirmed
-
showInputDialog
@Nullable public static <R> R showInputDialog(@NotNull @NotNull R[] options, int defaultIndex, @Nullable @Nullable String title, @Nullable @Nullable String header, @Nullable @Nullable String content, @Nullable @Nullable String iconDir, @Nullable @Nullable String cssDir) Displays an input dialog- Type Parameters:
R- type of the input. This type gets returned and the options are also of this type- Parameters:
options- array of options that the user can choose from.defaultIndex- index on what we can find the default selected valuetitle- of the dialogheader- text displayed in the dialog's headercontent- text displayed as queryiconDir- path to the icon file for the alertcssDir- path to the file containing the styles for the alert- Returns:
- which item has been selected, or
nullif the user canceled
-
showInputDialog
public static <R> R showInputDialog(@NotNull @NotNull R[] options, int defaultIndex, @Nullable @Nullable String title, @Nullable @Nullable String header, @Nullable @Nullable String content, String cssDir) Displays an input dialog- Type Parameters:
R- type of the input. This type gets returned and the options are also of this type- Parameters:
options- array of options that the user can choose from.defaultIndex- index on what we can find the default selected valuetitle- of the dialogheader- text displayed in the dialog's headercontent- text displayed as querycssDir- path to the file containing the styles for the alert- Returns:
- which item has been selected, or
nullif the user canceled
-
showInputDialog
public static <R> R showInputDialog(@NotNull @NotNull R[] options, int defaultIndex, @Nullable @Nullable String title, @Nullable @Nullable String header, @Nullable @Nullable String content) Displays an input dialog- Type Parameters:
R- type of the input. This type gets returned and the options are also of this type- Parameters:
options- array of options that the user can choose from.defaultIndex- index on what we can find the default selected valuetitle- of the dialogheader- text displayed in the dialog's headercontent- text displayed as query- Returns:
- which item has been selected, or
nullif the user canceled
-
hideNode
public static void hideNode(@NotNull @NotNull javafx.scene.Node node) Hides a node, and also makes sure it isn't managed so it don't take empty room- Parameters:
node- component to disable
-
showNode
public static void showNode(@NotNull @NotNull javafx.scene.Node node) Show a node, used to invert action ofhideNode(Node)- Parameters:
node- component to enable
-