Interface StackNavigable
- All Known Implementing Classes:
AdminDashboardController, AdminUsersManagmentController, LoginController, ResetPasswordController, RootController, UserHomeController
public interface StackNavigable
Provides stack-based navigation (push, replace, pop) for controllers
that manage content within a
StackPane.
Implementing controllers can use this interface to dynamically load and swap FXML views in a StackPane without tightly coupling to the root layout.
Example usage:
controller.setStackHost(rootStackPane);
controller.push("some-view.fxml");
controller.pop();
- Since:
- 2026-02-21
- Version:
- 1.0
- Author:
- @ZouariOmar (zouariomar20@gmail.com)
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionjavafx.scene.layout.StackPaneReturns the StackPane hosting dynamic views.default voidpop()Pop the top view from the stack and restore the stage title of the view now on top (if it implementsStageTitled).default <T> voidPushes a new FXML view without a controller initializer.default <T> voidPush a new FXML view onto the stack.default voidReplace the current view with a new FXML.default <T> voidReplace the current view with a new FXML.default voidsetStackHost(javafx.scene.layout.StackPane host) Injects the StackPane host.default voidsetStatusProvider(StatusMessageProvider provider) Injects the status message provider.
-
Method Details
-
getStackHost
javafx.scene.layout.StackPane getStackHost()Returns the StackPane hosting dynamic views.- Returns:
- the stack host that contains dynamic views
-
setStackHost
default void setStackHost(javafx.scene.layout.StackPane host) Injects the StackPane host.- Parameters:
host- stack host used for navigation
-
setStatusProvider
Injects the status message provider.- Parameters:
provider- provider used to display status messages
-
push
-
push
Pushes a new FXML view without a controller initializer.- Type Parameters:
T- type of controller- Parameters:
fxml- path to FXML
-
replace
Replace the current view with a new FXML.- Parameters:
fxml- path to FXML
-
replace
-
pop
default void pop()Pop the top view from the stack and restore the stage title of the view now on top (if it implementsStageTitled).
-