Package io.github.mmm.ui.spi.controller
Class AbstractUiNavigationManager
- java.lang.Object
-
- io.github.mmm.event.AbstractEventSource<UiNavigationEvent,UiNavigationEventListener>
-
- io.github.mmm.ui.spi.controller.AbstractUiNavigationManager
-
- All Implemented Interfaces:
EventSource<UiNavigationEvent,UiNavigationEventListener>
,UiNavigationManager
- Direct Known Subclasses:
AbstractUiNavigationManagerImpl
public abstract class AbstractUiNavigationManager extends AbstractEventSource<UiNavigationEvent,UiNavigationEventListener> implements UiNavigationManager
Abstract base implementation ofUiNavigationManager
.- Since:
- 1.0.0
-
-
Constructor Summary
Constructors Constructor Description AbstractUiNavigationManager()
The constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
addHistory(UiPlace place)
protected abstract void
doInit()
<W extends UiRegularWidget>
AbstractUiController<W>getController(String id)
UiPlace
getCurrentPlace()
<W extends UiRegularWidget>
AbstractUiController<W>getRequiredController(String id)
void
init()
Initializes this navigation manager and navigates to the initialUiPlace
.protected AbstractUiController<?>
navigateRecursive(UiPlace place, UiEmbedding embedding)
void
navigateTo(UiPlace place, boolean replace)
Navigates to the givenUiPlace
.protected void
navigateTo(UiPlace place, UiNavigationMode mode, boolean programmatic)
protected void
onEmbedded(UiEmbedding embedding, AbstractUiController<?> controller)
Called fromAbstractUiController.embed(UiEmbedding, UiController)
to registerUiController
s in their currentUiEmbedding
s and hide previousUiController
s when replaced in thatslot
.protected abstract void
replaceHistory(UiPlace place)
void
updatePlace(UiPlace place)
Replaces thecurrent place
with the givenUiPlace
without creating a new entry in the navigation history.-
Methods inherited from class io.github.mmm.event.AbstractEventSource
addListener, fireEvent, getEventAdapter, hasListeners, removeListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.github.mmm.event.EventSource
addListener, addListener, addWeakListener, removeListener
-
Methods inherited from interface io.github.mmm.ui.api.controller.UiNavigationManager
navigateBack, navigateForward, navigateTo
-
-
-
-
Method Detail
-
getController
public <W extends UiRegularWidget> AbstractUiController<W> getController(String id)
- Specified by:
getController
in interfaceUiNavigationManager
- Type Parameters:
W
- type of theview
.- Parameters:
id
- theID
of the requestedUiController
.- Returns:
- the requested
UiController
ornull
if no suchUiController
exists.
-
getRequiredController
public <W extends UiRegularWidget> AbstractUiController<W> getRequiredController(String id)
- Specified by:
getRequiredController
in interfaceUiNavigationManager
- Type Parameters:
W
- type of theview
.- Parameters:
id
- theID
of the requestedUiController
.- Returns:
- the requested
UiController
.
-
init
public final void init()
Initializes this navigation manager and navigates to the initialUiPlace
.
-
doInit
protected abstract void doInit()
- See Also:
init()
-
getCurrentPlace
public UiPlace getCurrentPlace()
- Specified by:
getCurrentPlace
in interfaceUiNavigationManager
- Returns:
- the current
UiPlace
. Will benull
until initialized by firstnavigation
.
-
navigateTo
public void navigateTo(UiPlace place, boolean replace)
Description copied from interface:UiNavigationManager
Navigates to the givenUiPlace
.- Specified by:
navigateTo
in interfaceUiNavigationManager
- 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
.
-
navigateTo
protected void navigateTo(UiPlace place, UiNavigationMode mode, boolean programmatic)
- Parameters:
place
- is theUiPlace
identifying theUiController
to open.mode
- theUiNavigationMode
.programmatic
- theprogrammatic flag
.- See Also:
UiNavigationManager.navigateTo(UiPlace)
-
addHistory
protected abstract void addHistory(UiPlace place)
- Parameters:
place
- is theUiPlace
to add to the history.- See Also:
UiNavigationManager.navigateTo(UiPlace)
-
replaceHistory
protected abstract void replaceHistory(UiPlace place)
- Parameters:
place
- is theUiPlace
to replace the current place in the history.- See Also:
UiNavigationManager.navigateTo(UiPlace)
-
updatePlace
public void updatePlace(UiPlace place)
Description copied from interface:UiNavigationManager
Replaces thecurrent place
with the givenUiPlace
without creating a new entry in the navigation history.- Specified by:
updatePlace
in interfaceUiNavigationManager
- 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 soUiNavigationManager.navigateBack()
navigating back} is not replaying the entire history of the end-users selection what is typically undesired.
-
navigateRecursive
protected AbstractUiController<?> navigateRecursive(UiPlace place, UiEmbedding embedding)
- Parameters:
place
- theUiPlace
.embedding
- the optionalUiEmbedding
.- Returns:
- the
AbstractUiController
that has beenshown
.
-
onEmbedded
protected void onEmbedded(UiEmbedding embedding, AbstractUiController<?> controller)
Called fromAbstractUiController.embed(UiEmbedding, UiController)
to registerUiController
s in their currentUiEmbedding
s and hide previousUiController
s when replaced in thatslot
.- Parameters:
embedding
- theUiEmbedding
.controller
- theAbstractUiController
.
-
-