java.lang.Object
no.ntnu.principes.service.NavigationService
Provides application-wide navigation capabilities using an event-based approach.
Centralizes screen transitions, modal dialogs, and navigation history management
without requiring direct references to UI controllers.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidback()Navigates back to the previous screen.static voidClears the entire navigation stack for a stage.static voidcloseModal(String modalId, ModalResult result) Closes a modal dialog with a result.static voidcloseScreen(String route) Closes a specific screen by its route name.static voidNavigates to a specified route.static voidNavigates to a route with additional parameters.static voidnavigate(NavigateEvent.NavigationPayload payload) Performs navigation using a pre-configured navigation payload.static voidOpens a modal dialog over the current screen.
-
Method Details
-
closeScreen
Closes a specific screen by its route name. Removes the screen from the navigation stack.- Parameters:
route- The route name of the screen to close
-
openModal
Opens a modal dialog over the current screen.- Parameters:
route- The route name of the modal to opencallBackId- An identifier to associate with modal results
-
closeModal
Closes a modal dialog with a result. The result can be processed by screens that are waiting for modal feedback.- Parameters:
modalId- The ID of the modal to closeresult- The result to return from the modal
-
clear
Clears the entire navigation stack for a stage. Removes all screens and returns to the initial state.- Parameters:
stageId- The ID of the stage to clear
-
back
public static void back()Navigates back to the previous screen. Removes the current screen from the navigation stack.