com.vaadin.addon.touchkit.ui
Class NavigationView

java.lang.Object
  extended by com.vaadin.server.AbstractClientConnector
      extended by com.vaadin.ui.AbstractComponent
          extended by com.vaadin.ui.AbstractComponentContainer
              extended by com.vaadin.addon.touchkit.ui.NavigationView
All Implemented Interfaces:
com.vaadin.event.MethodEventSource, com.vaadin.server.ClientConnector, com.vaadin.server.Sizeable, com.vaadin.shared.Connector, com.vaadin.ui.Component, com.vaadin.ui.ComponentContainer, com.vaadin.ui.HasComponents, com.vaadin.ui.HasComponents.ComponentAttachDetachNotifier, Serializable, Iterable<com.vaadin.ui.Component>

public class NavigationView
extends com.vaadin.ui.AbstractComponentContainer

The NavigationView is a component container which integrates well with the NavigationManager. It consists of a NavigationBar, a content area, and optionally a Toolbar.

The content area is scrollable (i.e. no need to use a Panel in it). The NavigationView is most commonly used with a NavigationManager which provides smooth forward/back animations.

In addition to the main content area (set with setContent(Component) ), a NavigationView can contain a secondary component which, by default, is positioned at the bottom of the layout. The secondary content is set with setToolbar(Component), and is usually a Toolbar.

See Also:
Serialized Form

Nested Class Summary
 
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
NavigationView()
          Constructs a NavigationView with an empty CssLayout as its content.
NavigationView(com.vaadin.ui.Component content)
          Constructs a NavigationView with the given content.
NavigationView(String caption)
          Constructs a NavigationView with the given caption and an empty CssLayout as its content.
NavigationView(String caption, com.vaadin.ui.Component content)
          Constructs a NavigationView with the given caption and content.
 
Method Summary
 void addComponent(com.vaadin.ui.Component c)
          Deprecated. use setContent or setToolbar instead
 String getCaption()
           
 int getComponentCount()
           
 Iterator<com.vaadin.ui.Component> getComponentIterator()
           
 com.vaadin.ui.Component getContent()
           
 com.vaadin.ui.Component getLeftComponent()
           
 NavigationBar getNavigationBar()
           
 NavigationManager getNavigationManager()
          Gets the @link NavigationManager in which this view is contained.
 com.vaadin.ui.Component getPreviousComponent()
           
 com.vaadin.ui.Component getRightComponent()
           
 int getScrollPosition()
           
 NavigationViewState getState()
           
 com.vaadin.ui.Component getToolbar()
           
 Iterator<com.vaadin.ui.Component> iterator()
           
protected  void onBecomingVisible()
          Called by NavigationManager when the view is about to become visible.
 void removeAllComponents()
          Removes the toolbar, and the current content (setting the content to an empty CssLayout).
 void removeComponent(com.vaadin.ui.Component c)
          The toolbar or content can be removed - other attempts will result in an IllegalArgumentException.
 void replaceComponent(com.vaadin.ui.Component oldComponent, com.vaadin.ui.Component newComponent)
          The main content and the toolbar can be replaced - other attempts will result in an IllegalArgumentException
 void setCaption(String caption)
           
 void setContent(com.vaadin.ui.Component c)
          Sets the main content of the NavigationView.
 void setLeftComponent(com.vaadin.ui.Component c)
          Sets the component in the navigation bar's left slot.
 void setPreviousComponent(com.vaadin.ui.Component component)
           
 void setRightComponent(com.vaadin.ui.Component c)
          Sets the component in the navigation bar's right slot.
 void setScrollPosition(int scrollPosition)
          Scrolls the view to the specified position.
 void setToolbar(com.vaadin.ui.Component toolbar)
          Sets the toolbar component, usually a Toolbar.
 
Methods inherited from class com.vaadin.ui.AbstractComponentContainer
addComponentAttachListener, addComponentDetachListener, addComponents, addListener, addListener, fireComponentAttachEvent, fireComponentDetachEvent, moveComponentsFrom, 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, getComponentError, getData, getDebugId, getDescription, getErrorMessage, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getState, getStyleName, getWidth, getWidthUnits, isConnectorEnabled, isEnabled, isImmediate, isReadOnly, isVisible, removeListener, removeShortcutListener, removeStyleName, 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, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isReadOnly, isVisible, removeListener, removeStyleName, 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

NavigationView

public NavigationView(com.vaadin.ui.Component content)
Constructs a NavigationView with the given content.

Parameters:
content -

NavigationView

public NavigationView()
Constructs a NavigationView with an empty CssLayout as its content.


NavigationView

public NavigationView(String caption)
Constructs a NavigationView with the given caption and an empty CssLayout as its content.

Parameters:
caption - the caption

NavigationView

public NavigationView(String caption,
                      com.vaadin.ui.Component content)
Constructs a NavigationView with the given caption and content.

Parameters:
caption - the caption
content - the content
Method Detail

setContent

public void setContent(com.vaadin.ui.Component c)
Sets the main content of the NavigationView. If null, an empty CssLayout will be used.

Parameters:
c - the component to set as the content

getContent

public com.vaadin.ui.Component getContent()
Returns:
the content of the navigation view.

addComponent

@Deprecated
public void addComponent(com.vaadin.ui.Component c)
Deprecated. use setContent or setToolbar instead

Specified by:
addComponent in interface com.vaadin.ui.ComponentContainer
Overrides:
addComponent in class com.vaadin.ui.AbstractComponentContainer

removeComponent

public void removeComponent(com.vaadin.ui.Component c)
The toolbar or content can be removed - other attempts will result in an IllegalArgumentException. If the content is removed, an empty CssLayout is set as the content.

Specified by:
removeComponent in interface com.vaadin.ui.ComponentContainer
Overrides:
removeComponent in class com.vaadin.ui.AbstractComponentContainer

removeAllComponents

public void removeAllComponents()
Removes the toolbar, and the current content (setting the content to an empty CssLayout).

Specified by:
removeAllComponents in interface com.vaadin.ui.ComponentContainer
Overrides:
removeAllComponents in class com.vaadin.ui.AbstractComponentContainer

getNavigationBar

public NavigationBar getNavigationBar()
Returns:
the NavigationBar

setRightComponent

public void setRightComponent(com.vaadin.ui.Component c)
Sets the component in the navigation bar's right slot.

Parameters:
c - the component to set in the right slot.

getRightComponent

public com.vaadin.ui.Component getRightComponent()
Returns:
the component in the right slot of the navigation bar or null if not set

setLeftComponent

public void setLeftComponent(com.vaadin.ui.Component c)
Sets the component in the navigation bar's left slot. Most commonly this component slot is automatically populated by the NavigationView (a back button).

Parameters:
c - the component to set in the left slot.

getLeftComponent

public com.vaadin.ui.Component getLeftComponent()
Returns:
the component in the left slot of the navigation bar or null if not set

getPreviousComponent

public com.vaadin.ui.Component getPreviousComponent()
See Also:
NavigationBar.getPreviousView()

setPreviousComponent

public void setPreviousComponent(com.vaadin.ui.Component component)
See Also:
NavigationBar.setPreviousView(Component)

setCaption

public void setCaption(String caption)
Specified by:
setCaption in interface com.vaadin.ui.Component
Overrides:
setCaption in class com.vaadin.ui.AbstractComponent

getCaption

public String getCaption()
Specified by:
getCaption in interface com.vaadin.ui.Component
Overrides:
getCaption in class com.vaadin.ui.AbstractComponent

onBecomingVisible

protected void onBecomingVisible()
Called by NavigationManager when the view is about to become visible.


replaceComponent

public void replaceComponent(com.vaadin.ui.Component oldComponent,
                             com.vaadin.ui.Component newComponent)
The main content and the toolbar can be replaced - other attempts will result in an IllegalArgumentException


getComponentIterator

public Iterator<com.vaadin.ui.Component> getComponentIterator()
Specified by:
getComponentIterator in interface com.vaadin.ui.ComponentContainer
Overrides:
getComponentIterator in class com.vaadin.ui.AbstractComponentContainer

setToolbar

public void setToolbar(com.vaadin.ui.Component toolbar)
Sets the toolbar component, usually a Toolbar. If a previous toolbar is set, it is removed from the layout and forgotten.

Parameters:
toolbar - The component to put in the toolbar slot.

getToolbar

public com.vaadin.ui.Component getToolbar()
Returns:
The component in the toolbar slot or null if no toolbar has been set

getState

public NavigationViewState getState()
Overrides:
getState in class com.vaadin.ui.AbstractComponent

setScrollPosition

public void setScrollPosition(int scrollPosition)
Scrolls the view to the specified position.

Parameters:
scrollPosition - the position to scroll to (y coordinate).

getScrollPosition

public int getScrollPosition()
Returns:
The scroll position of the view.

getNavigationManager

public NavigationManager getNavigationManager()
Gets the @link NavigationManager in which this view is contained.

Returns:
the parent NavigationManager or null if not inside one.

getComponentCount

public int getComponentCount()

iterator

public Iterator<com.vaadin.ui.Component> iterator()


Copyright © 2014 Vaadin Ltd. All rights reserved.