public class XdevAuthenticationNavigator extends XdevNavigator
The view switching can be based e.g. on URI fragments containing the view name and parameters to the view. There are two types of parameters for views: an optional parameter string that is included in the fragment (may be bookmarkable).
Views can be explicitly registered or dynamically generated and listening to view changes is possible.
Note that XdevNavigator
is not a component itself but uses a
ViewDisplay
to update contents based on the state.
Navigator.ClassBasedViewProvider, Navigator.ComponentContainerViewDisplay, Navigator.EmptyView, Navigator.SingleComponentContainerViewDisplay, Navigator.StaticViewProvider, Navigator.UriFragmentManager
Constructor and Description |
---|
XdevAuthenticationNavigator(UI ui,
ComponentContainer container)
Creates a navigator that is tracking the active view using URI fragments
of the
Page containing the given UI and replacing the contents of
a ComponentContainer with the active view. |
XdevAuthenticationNavigator(UI ui,
NavigationStateManager stateManager,
ViewDisplay display)
Creates a navigator.
|
XdevAuthenticationNavigator(UI ui,
SingleComponentContainer container)
Creates a navigator that is tracking the active view using URI fragments
of the
Page containing the given UI and replacing the contents of
a SingleComponentContainer with the active view. |
XdevAuthenticationNavigator(UI ui,
ViewDisplay display)
Creates a navigator that is tracking the active view using URI fragments
of the
Page containing the given UI. |
Modifier and Type | Method and Description |
---|---|
String |
getLoginViewName() |
String |
getRedirectViewName() |
void |
navigateToLoginView()
Navigates to the login view URL set with
setLoginViewName(String) . |
void |
navigateToRedirectView()
Navigates to the redirect view URL set with
setRedirectViewName(String) . |
void |
setLoginViewName(String loginViewName) |
void |
setRedirectViewName(String redirectViewName) |
navigateTo
addProvider, addView, addView, addViewChangeListener, destroy, getCurrentView, getDisplay, getState, getUI, removeProvider, removeView, removeViewChangeListener, setErrorProvider, setErrorView, setErrorView
public XdevAuthenticationNavigator(UI ui, ComponentContainer container)
Page
containing the given UI and replacing the contents of
a ComponentContainer
with the active view.
All components of the container are removed each time before adding the
active View
. Views must implement Component
when using
this constructor.
Navigation is automatically initiated after UI.init()
 if a
navigator was created. If at a later point changes are made to the
navigator, navigator.navigateTo(navigator.getState())
may need to
be explicitly called to ensure the current view matches the navigation
state.
ui
- The UI to which this Navigator is attached.container
- The ComponentContainer whose contents should be replaced with
the active view on view changepublic XdevAuthenticationNavigator(UI ui, NavigationStateManager stateManager, ViewDisplay display)
When a custom navigation state manager is not needed, use one of the other constructors which use a URI fragment based state manager.
Navigation is automatically initiated after UI.init()
 if a
navigator was created. If at a later point changes are made to the
navigator, navigator.navigateTo(navigator.getState())
may need to
be explicitly called to ensure the current view matches the navigation
state.
ui
- The UI to which this Navigator is attached.stateManager
- The NavigationStateManager keeping track of the active view
and enabling bookmarking and direct navigationdisplay
- The ViewDisplay used to display the views handled by this
navigatorpublic XdevAuthenticationNavigator(UI ui, SingleComponentContainer container)
Page
containing the given UI and replacing the contents of
a SingleComponentContainer
with the active view.
Views must implement Component
when using this constructor.
Navigation is automatically initiated after UI.init()
 if a
navigator was created. If at a later point changes are made to the
navigator, navigator.navigateTo(navigator.getState())
may need to
be explicitly called to ensure the current view matches the navigation
state.
ui
- The UI to which this Navigator is attached.container
- The SingleComponentContainer whose contents should be replaced
with the active view on view changepublic XdevAuthenticationNavigator(UI ui, ViewDisplay display)
Page
containing the given UI.
Navigation is automatically initiated after UI.init()
 if a
navigator was created. If at a later point changes are made to the
navigator, navigator.navigateTo(navigator.getState())
may need to
be explicitly called to ensure the current view matches the navigation
state.
ui
- The UI to which this Navigator is attached.display
- The ViewDisplay used to display the views.public String getLoginViewName()
public void setLoginViewName(String loginViewName)
loginViewName
- the loginViewName to setpublic String getRedirectViewName()
public void setRedirectViewName(String redirectViewName)
redirectViewName
- the redirectViewName to setpublic void navigateToLoginView()
setLoginViewName(String)
.IllegalStateException
- if no login view is setpublic void navigateToRedirectView()
setRedirectViewName(String)
.IllegalStateException
- if no redirect view is set