Class UiUtils

java.lang.Object
net.minheur.potoflux.ui.UiUtils

public final class UiUtils extends Object
A utility class for UI related
  • Field Details

    • okButton

      public static final SmartSupplier<javafx.scene.control.ButtonType> okButton
      Button type preset for the OK action. Include traduction
    • confirmButton

      public static final SmartSupplier<javafx.scene.control.ButtonType> confirmButton
      Button type preset for the CONFIRM action. Include traduction
    • cancelButton

      public static final SmartSupplier<javafx.scene.control.ButtonType> cancelButton
      Button type preset for the CANCEL action. Include traduction
    • closeButton

      public static final SmartSupplier<javafx.scene.control.ButtonType> closeButton
      Button type preset for the CLOSE action. Include traduction
    • yesButton

      public static final SmartSupplier<javafx.scene.control.ButtonType> yesButton
      Button type preset for the YES action. Include traduction
    • noButton

      public static final SmartSupplier<javafx.scene.control.ButtonType> noButton
      Button type preset for the NO action. Include traduction
    • applyButton

      public static final SmartSupplier<javafx.scene.control.ButtonType> applyButton
      Button type preset for the APPLY action. Include traduction
    • finishButton

      public static final SmartSupplier<javafx.scene.control.ButtonType> finishButton
      Button type preset for the FINISH action. 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 an Alert to the user
      If LogicDelayedPopupsRegistry.isOpened() is true, meaning we are actually running the logic action runs, adds the alert to the delayed popup reg.
      Parameters:
      type - the Alert.AlertType of the alert
      message - what will be displayed in the main message area
      title - displayed in the alert's bar
      header - what is displayed in the upper area
      cssDir - path to the file containing the styles for the alert
      iconDir - path to the icon's file used as the header's graphic
    • showErrorPane

      public static void showErrorPane(String message)
      Displays an error pane
      Parameters:
      message - displayed to the user, actual error
    • showMessagePane

      public static void showMessagePane(String message)
      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 confirmation
      header - text displayed in the alert's header
      preciseType - 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 confirmation
      header - 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

      public static boolean showConfirmationDialog(String message)
      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 value
      title - of the dialog
      header - text displayed in the dialog's header
      content - text displayed as query
      iconDir - path to the icon file for the alert
      cssDir - path to the file containing the styles for the alert
      Returns:
      which item has been selected, or null if 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 value
      title - of the dialog
      header - text displayed in the dialog's header
      content - text displayed as query
      cssDir - path to the file containing the styles for the alert
      Returns:
      which item has been selected, or null if 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 value
      title - of the dialog
      header - text displayed in the dialog's header
      content - text displayed as query
      Returns:
      which item has been selected, or null if 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 of hideNode(Node)
      Parameters:
      node - component to enable