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 manageUiController
s.- Since:
- 1.0.0
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static UiNavigationManager
get()
<W extends io.github.mmm.ui.api.widget.UiRegularWidget>
UiController<W>getController(String id)
UiPlace
getCurrentPlace()
default <W extends io.github.mmm.ui.api.widget.UiRegularWidget>
UiController<W>getRequiredController(String id)
UiPlace
navigateBack()
This method navigates back in the history to theUiPlace
that has been visited before.UiPlace
navigateForward()
This method navigates forward in the history.default void
navigateTo(UiPlace place)
Navigates to the givenUiPlace
.void
navigateTo(UiPlace place, boolean replace)
Navigates to the givenUiPlace
.void
updatePlace(UiPlace place)
Replaces thecurrent place
with the givenUiPlace
without 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
- theID
of the requestedUiController
.- Returns:
- the requested
UiController
ornull
if no suchUiController
exists.
-
getRequiredController
default <W extends io.github.mmm.ui.api.widget.UiRegularWidget> UiController<W> getRequiredController(String id)
- Type Parameters:
W
- type of theview
.- Parameters:
id
- theID
of the requestedUiController
.- Returns:
- the requested
UiController
. - Throws:
io.github.mmm.base.exception.ObjectNotFoundException
- if noUiController
exists with the givenid
.
-
getCurrentPlace
UiPlace getCurrentPlace()
- Returns:
- the current
UiPlace
. Will benull
until initialized by firstnavigation
.
-
navigateBack
UiPlace navigateBack()
This method navigates back in the history to theUiPlace
that has been visited before. In a web-application this can also be triggered by pressing the back button.- Returns:
- the new
UiPlace
that we just navigated back to. Will benull
if there is no history left.
-
navigateForward
UiPlace navigateForward()
This method navigates forward in the history. AfternavigateBack()
was invoked, this method will go to theUiPlace
that has been visited before the invocation ofnavigateBack()
. In a web-application this can also be triggered by pressing the forward button.- Returns:
- the new
UiPlace
that we just navigated forward to. Will benull
if 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 theUiPlace
identifying theUiController
to open.
-
navigateTo
void navigateTo(UiPlace place, boolean replace)
Navigates to the givenUiPlace
.- Parameters:
place
- is theUiPlace
identifying theUiController
to open.replace
- - iftrue
thecurrent place
will be replaced with the givenUiPlace
,false
otherwise (default). Replacing is e.g. helpful forUiController
s that do logical decisions and only redirect to the actualUiPlace
.
-
updatePlace
void updatePlace(UiPlace place)
Replaces thecurrent place
with the givenUiPlace
without creating a new entry in the navigation history.- Parameters:
place
- the updatedUiPlace
. Currently theID
of thecurrent place
may 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 theUiPlace
and 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
.
-
-