java.lang.Object
one.jpro.platform.routing.popup.PopupAPI

public class PopupAPI extends Object
Provides utility methods for managing popups in a JPro application. This includes opening and closing popups, as well as showing a loading screen.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Object
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    closePopup(javafx.scene.Node popupNode)
    Closes the specified popup node.
    static javafx.scene.Node
    getPopup(javafx.scene.Node popupNode)
    Retrieves the popup node from a given node, if it exists.
    static javafx.scene.layout.Pane
    getPopupContext(javafx.scene.Node popup)
    Retrieves the popup context for a given popup node.
    static void
    openPopup(javafx.scene.layout.Pane popupContext, javafx.scene.Node popup)
    Opens a popup within the specified context.
    static <T> simplefx.experimental.parts.FXFuture<T>
    showLoadingScreen(javafx.scene.layout.Pane popupContext, simplefx.experimental.parts.FXFuture<T> fxFuture)
    Shows a loading screen on the specified popup context and binds it to the completion of a future.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • PopupAPI

      public PopupAPI()
  • Method Details

    • openPopup

      public static void openPopup(javafx.scene.layout.Pane popupContext, javafx.scene.Node popup)
      Opens a popup within the specified context.
      Parameters:
      popupContext - the pane that will serve as the context for the popup
      popup - the node representing the popup to be displayed
      Throws:
      RuntimeException - if popupContext is null
    • closePopup

      public static void closePopup(javafx.scene.Node popupNode)
      Closes the specified popup node.
      Parameters:
      popupNode - the popup node to be closed
    • showLoadingScreen

      public static <T> simplefx.experimental.parts.FXFuture<T> showLoadingScreen(javafx.scene.layout.Pane popupContext, simplefx.experimental.parts.FXFuture<T> fxFuture)
      Shows a loading screen on the specified popup context and binds it to the completion of a future.
      Type Parameters:
      T - the type of the result produced by the future
      Parameters:
      popupContext - the pane that will serve as the context for the loading screen
      fxFuture - the future whose completion will trigger the removal of the loading screen
      Returns:
      the FXFuture passed as an argument
      Throws:
      RuntimeException - if popupContext is null
    • getPopupContext

      public static javafx.scene.layout.Pane getPopupContext(javafx.scene.Node popup)
      Retrieves the popup context for a given popup node.
      Parameters:
      popup - the node for which to find the popup context
      Returns:
      the pane that serves as the context for the popup
    • getPopup

      public static javafx.scene.Node getPopup(javafx.scene.Node popupNode)
      Retrieves the popup node from a given node, if it exists.
      Parameters:
      popupNode - the node from which to retrieve the popup
      Returns:
      the node representing the popup, or the input node if no popup context is found