|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.vaadin.server.AbstractClientConnector com.vaadin.ui.AbstractComponent com.vaadin.ui.AbstractComponentContainer com.vaadin.addon.touchkit.ui.NavigationManager
public class NavigationManager
The NavigationManager is a non-visible component container that allows for
smooth navigation between components, or views. It support all components,
but back buttons are updated automatically only for NavigationView
s.
When a component is navigated to, it replaces the currently visible
component, which in turn is pushed on to the stack of previous views. One can
navigate backwards by calling navigateBack()
, in which case the
currently visible view is forgotten (still cached in case the user decides to
navigate to it again, see getNextComponent()
) and the previous view
is restored from the stack and made visible.
When used with NavigationView
s, NavigationBar
s and
NavigationButton
s, navigation is smooth and quite automatic.
Bootstrap the navigation by giving the NavigationManager
an initial
view, either by using the constructor NavigationManager(Component)
or by calling navigateTo(Component)
.
Nested Class Summary | |
---|---|
static class |
NavigationManager.NavigationEvent
A NavigationEvent is triggered when the user navigates forward or backward in the NavigationManager. |
static interface |
NavigationManager.NavigationListener
A NavigationListener is notified whenever a navigation event occurs. |
Nested classes/interfaces inherited from interface com.vaadin.ui.HasComponents |
---|
com.vaadin.ui.HasComponents.ComponentAttachDetachNotifier, com.vaadin.ui.HasComponents.ComponentAttachEvent, com.vaadin.ui.HasComponents.ComponentAttachListener, com.vaadin.ui.HasComponents.ComponentDetachEvent, com.vaadin.ui.HasComponents.ComponentDetachListener |
Nested classes/interfaces inherited from interface com.vaadin.ui.Component |
---|
com.vaadin.ui.Component.ErrorEvent, com.vaadin.ui.Component.Event, com.vaadin.ui.Component.Focusable, com.vaadin.ui.Component.Listener |
Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector |
---|
com.vaadin.server.ClientConnector.AttachEvent, com.vaadin.server.ClientConnector.AttachListener, com.vaadin.server.ClientConnector.ConnectorErrorEvent, com.vaadin.server.ClientConnector.DetachEvent, com.vaadin.server.ClientConnector.DetachListener |
Nested classes/interfaces inherited from interface com.vaadin.server.Sizeable |
---|
com.vaadin.server.Sizeable.Unit |
Field Summary |
---|
Fields inherited from interface com.vaadin.server.Sizeable |
---|
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS |
Constructor Summary | |
---|---|
NavigationManager()
Constructs a NavigationManager that is 100% wide and high. |
|
NavigationManager(com.vaadin.ui.Component c)
Constructs a NavigationManager that is 100% wide and high, and initially navigates to (shows) the given component. |
Method Summary | |
---|---|
void |
addNavigationListener(NavigationManager.NavigationListener listener)
Adds a navigation listener that is notified whenever a navigation event occurs. |
int |
getComponentCount()
|
Iterator<com.vaadin.ui.Component> |
getComponentIterator()
|
com.vaadin.ui.Component |
getCurrentComponent()
|
com.vaadin.ui.Component |
getNextComponent()
|
com.vaadin.ui.Component |
getPreviousComponent()
|
NavigationManagerSharedState |
getState()
|
Stack<com.vaadin.ui.Component> |
getViewStack()
Gets the view stack. |
boolean |
isMaintainBreadcrumb()
|
Iterator<com.vaadin.ui.Component> |
iterator()
|
void |
navigateBack()
Navigates backwards in history by popping the previous component off of the view stack and making it visible. |
void |
navigateTo(com.vaadin.ui.Component c)
Navigates to the given component, effectively making it the new visible component. |
void |
removeListener(NavigationManager.NavigationListener listener)
Removes a navigation listener. |
void |
replaceComponent(com.vaadin.ui.Component oldComponent,
com.vaadin.ui.Component newComponent)
This operation is not supported |
void |
setCurrentComponent(com.vaadin.ui.Component newCurrentComponent)
Sets the currently visible component in the NavigationManager. |
void |
setMaintainBreadcrumb(boolean maintainBreadcrumb)
Configures whether the NavigationManager maintains a breadcrumb of visited views automatically. |
void |
setNextComponent(com.vaadin.ui.Component nextComponent)
If the developer knows the next component where user is going to navigate, it can be set with this method. |
void |
setPreviousComponent(com.vaadin.ui.Component newPreviousComponent)
Replaces the topmost component in the history, forgetting the replaced component - i.e modifies the history. |
Methods inherited from class com.vaadin.ui.AbstractComponentContainer |
---|
addComponent, addComponentAttachListener, addComponentDetachListener, addComponents, addListener, addListener, fireComponentAttachEvent, fireComponentDetachEvent, moveComponentsFrom, removeAllComponents, removeComponent, removeComponentAttachListener, removeComponentDetachListener, removeListener, removeListener, setHeight, setWidth |
Methods inherited from class com.vaadin.ui.AbstractComponent |
---|
addListener, addShortcutListener, addStyleName, attach, beforeClientResponse, detach, findAncestor, fireComponentErrorEvent, fireComponentEvent, focus, getActionManager, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorMessage, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getState, getStyleName, getWidth, getWidthUnits, isConnectorEnabled, isEnabled, isImmediate, isReadOnly, isVisible, removeListener, removeShortcutListener, removeStyleName, setCaption, setComponentError, setData, setDebugId, setDescription, setEnabled, setHeight, setIcon, setId, setImmediate, setLocale, setParent, setPrimaryStyleName, setReadOnly, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth |
Methods inherited from class com.vaadin.server.AbstractClientConnector |
---|
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hasListeners, isAttached, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.vaadin.ui.Component |
---|
addListener, addStyleName, attach, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isReadOnly, isVisible, removeListener, removeStyleName, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setReadOnly, setStyleName, setVisible |
Methods inherited from interface com.vaadin.server.ClientConnector |
---|
addAttachListener, addDetachListener, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler |
Methods inherited from interface com.vaadin.shared.Connector |
---|
getConnectorId |
Methods inherited from interface com.vaadin.server.Sizeable |
---|
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setSizeFull, setSizeUndefined, setWidth |
Constructor Detail |
---|
public NavigationManager()
public NavigationManager(com.vaadin.ui.Component c)
Method Detail |
---|
public NavigationManagerSharedState getState()
getState
in class com.vaadin.ui.AbstractComponent
public Stack<com.vaadin.ui.Component> getViewStack()
Developers can override components in this stack if they want to manually modify the breadcrumb or e.g. release previous views for garbage collection.
isMaintainBreadcrumb()
public void navigateTo(com.vaadin.ui.Component c)
navigateBack()
is performed, otherwise the replaced
view (previously visible) is pushed onto the view stack.
c
- the view to navigate topublic void navigateBack()
getNextComponent()
in
case the user wishes to return to the same view.
public void setCurrentComponent(com.vaadin.ui.Component newCurrentComponent)
If the current component is already set it is overridden. If the previous component or the next component is of type NavigationView, their next and previous components will be automatically re-assigned.
newCurrentComponent
- the component to set as the currently visible component.public com.vaadin.ui.Component getCurrentComponent()
public void setPreviousComponent(com.vaadin.ui.Component newPreviousComponent)
newPreviousComponent
- the new previous componentpublic com.vaadin.ui.Component getPreviousComponent()
public void setNextComponent(com.vaadin.ui.Component nextComponent)
When navigating backwards, this is used to cache the views in case the user decides to return to the same view.
public com.vaadin.ui.Component getNextComponent()
setNextComponent(Component)
public void replaceComponent(com.vaadin.ui.Component oldComponent, com.vaadin.ui.Component newComponent)
UnsupportedOperationException
public Iterator<com.vaadin.ui.Component> getComponentIterator()
getComponentIterator
in interface com.vaadin.ui.ComponentContainer
getComponentIterator
in class com.vaadin.ui.AbstractComponentContainer
public void addNavigationListener(NavigationManager.NavigationListener listener)
listener
- the listener to add.public void removeListener(NavigationManager.NavigationListener listener)
listener
- the listener to remove.public boolean isMaintainBreadcrumb()
setMaintainBreadcrumb(boolean)
public void setMaintainBreadcrumb(boolean maintainBreadcrumb)
maintainBreadcrumb
- true if a breadcrumb should be maintainedpublic int getComponentCount()
public Iterator<com.vaadin.ui.Component> iterator()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |