java.lang.Object
one.jpro.platform.routing.popup.PopupAPI
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidclosePopup(javafx.scene.Node popupNode) Closes the specified popup node.static javafx.scene.NodegetPopup(javafx.scene.Node popupNode) Retrieves the popup node from a given node, if it exists.static javafx.scene.layout.PanegetPopupContext(javafx.scene.Node popup) Retrieves the popup context for a given popup node.static voidopenPopup(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.
-
Field Details
-
POPUP_CONTEXT
-
-
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 popuppopup- the node representing the popup to be displayed- Throws:
RuntimeException- ifpopupContextis 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 screenfxFuture- the future whose completion will trigger the removal of the loading screen- Returns:
- the
FXFuturepassed as an argument - Throws:
RuntimeException- ifpopupContextis 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
-