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 voidaddHistory(UiPlace place)protected abstract voiddoInit()<W extends UiRegularWidget>
AbstractUiController<W>getController(String id)UiPlacegetCurrentPlace()<W extends UiRegularWidget>
AbstractUiController<W>getRequiredController(String id)voidinit()Initializes this navigation manager and navigates to the initialUiPlace.protected AbstractUiController<?>navigateRecursive(UiPlace place, UiEmbedding embedding)voidnavigateTo(UiPlace place, boolean replace)Navigates to the givenUiPlace.protected voidnavigateTo(UiPlace place, UiNavigationMode mode, boolean programmatic)protected voidonEmbedded(UiEmbedding embedding, AbstractUiController<?> controller)Called fromAbstractUiController.embed(UiEmbedding, UiController)to registerUiControllers in their currentUiEmbeddings and hide previousUiControllers when replaced in thatslot.protected abstract voidreplaceHistory(UiPlace place)voidupdatePlace(UiPlace place)Replaces thecurrent placewith the givenUiPlacewithout 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:
getControllerin interfaceUiNavigationManager- Type Parameters:
W- type of theview.- Parameters:
id- theIDof the requestedUiController.- Returns:
- the requested
UiControllerornullif no suchUiControllerexists.
-
getRequiredController
public <W extends UiRegularWidget> AbstractUiController<W> getRequiredController(String id)
- Specified by:
getRequiredControllerin interfaceUiNavigationManager- Type Parameters:
W- type of theview.- Parameters:
id- theIDof 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:
getCurrentPlacein interfaceUiNavigationManager- Returns:
- the current
UiPlace. Will benulluntil initialized by firstnavigation.
-
navigateTo
public void navigateTo(UiPlace place, boolean replace)
Description copied from interface:UiNavigationManagerNavigates to the givenUiPlace.- Specified by:
navigateToin interfaceUiNavigationManager- 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.
-
navigateTo
protected void navigateTo(UiPlace place, UiNavigationMode mode, boolean programmatic)
- Parameters:
place- is theUiPlaceidentifying theUiControllerto open.mode- theUiNavigationMode.programmatic- theprogrammatic flag.- See Also:
UiNavigationManager.navigateTo(UiPlace)
-
addHistory
protected abstract void addHistory(UiPlace place)
- Parameters:
place- is theUiPlaceto add to the history.- See Also:
UiNavigationManager.navigateTo(UiPlace)
-
replaceHistory
protected abstract void replaceHistory(UiPlace place)
- Parameters:
place- is theUiPlaceto replace the current place in the history.- See Also:
UiNavigationManager.navigateTo(UiPlace)
-
updatePlace
public void updatePlace(UiPlace place)
Description copied from interface:UiNavigationManagerReplaces thecurrent placewith the givenUiPlacewithout creating a new entry in the navigation history.- Specified by:
updatePlacein interfaceUiNavigationManager- 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 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
AbstractUiControllerthat has beenshown.
-
onEmbedded
protected void onEmbedded(UiEmbedding embedding, AbstractUiController<?> controller)
Called fromAbstractUiController.embed(UiEmbedding, UiController)to registerUiControllers in their currentUiEmbeddings and hide previousUiControllers when replaced in thatslot.- Parameters:
embedding- theUiEmbedding.controller- theAbstractUiController.
-
-