Package io.github.mmm.ui.api.controller
Interface UiNavigationManager
-
- All Superinterfaces:
io.github.mmm.event.EventSource<UiNavigationEvent,UiNavigationEventListener>
public interface UiNavigationManager extends io.github.mmm.event.EventSource<UiNavigationEvent,UiNavigationEventListener>
Interface to manageUiControllers.- Since:
- 1.0.0
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static UiNavigationManagerget()<W extends io.github.mmm.ui.api.widget.UiRegularWidget>
UiController<W>getController(String id)UiPlacegetCurrentPlace()default <W extends io.github.mmm.ui.api.widget.UiRegularWidget>
UiController<W>getRequiredController(String id)UiPlacenavigateBack()This method navigates back in the history to theUiPlacethat has been visited before.UiPlacenavigateForward()This method navigates forward in the history.default voidnavigateTo(UiPlace place)Navigates to the givenUiPlace.voidnavigateTo(UiPlace place, boolean replace)Navigates to the givenUiPlace.voidupdatePlace(UiPlace place)Replaces thecurrent placewith the givenUiPlacewithout creating a new entry in the navigation history.
-
-
-
Method Detail
-
getController
<W extends io.github.mmm.ui.api.widget.UiRegularWidget> UiController<W> getController(String id)
- Type Parameters:
W- type of theview.- Parameters:
id- theIDof the requestedUiController.- Returns:
- the requested
UiControllerornullif no suchUiControllerexists.
-
getRequiredController
default <W extends io.github.mmm.ui.api.widget.UiRegularWidget> UiController<W> getRequiredController(String id)
- Type Parameters:
W- type of theview.- Parameters:
id- theIDof the requestedUiController.- Returns:
- the requested
UiController. - Throws:
io.github.mmm.base.exception.ObjectNotFoundException- if noUiControllerexists with the givenid.
-
getCurrentPlace
UiPlace getCurrentPlace()
- Returns:
- the current
UiPlace. Will benulluntil initialized by firstnavigation.
-
navigateBack
UiPlace navigateBack()
This method navigates back in the history to theUiPlacethat has been visited before. In a web-application this can also be triggered by pressing the back button.- Returns:
- the new
UiPlacethat we just navigated back to. Will benullif there is no history left.
-
navigateForward
UiPlace navigateForward()
This method navigates forward in the history. AfternavigateBack()was invoked, this method will go to theUiPlacethat has been visited before the invocation ofnavigateBack(). In a web-application this can also be triggered by pressing the forward button.- Returns:
- the new
UiPlacethat we just navigated forward to. Will benullif we are already at the end of the history and nothing is left to navigate forward.
-
navigateTo
default void navigateTo(UiPlace place)
Navigates to the givenUiPlace.- Parameters:
place- is theUiPlaceidentifying theUiControllerto open.
-
navigateTo
void navigateTo(UiPlace place, boolean replace)
Navigates to the givenUiPlace.- Parameters:
place- is theUiPlaceidentifying theUiControllerto open.replace- - iftruethecurrent placewill be replaced with the givenUiPlace,falseotherwise (default). Replacing is e.g. helpful forUiControllers that do logical decisions and only redirect to the actualUiPlace.
-
updatePlace
void updatePlace(UiPlace place)
Replaces thecurrent placewith the givenUiPlacewithout creating a new entry in the navigation history.- Parameters:
place- the updatedUiPlace. Currently theIDof thecurrent placemay not change. This is only to updateparameters. E.g. if you want to represent the selection of a master-detail dialog in the location (URL) you can use aparameter. This method allows to update theUiPlaceand therefore the location without adding it to the history sonavigateBack()navigating back} is not replaying the entire history of the end-users selection what is typically undesired.
-
get
static UiNavigationManager get()
- Returns:
- the instance of this
UiNavigationManager.
-
-