com.vaadin.addon.touchkit.ui
Class Popover

java.lang.Object
  extended by com.vaadin.server.AbstractClientConnector
      extended by com.vaadin.ui.AbstractComponent
          extended by com.vaadin.ui.AbstractSingleComponentContainer
              extended by com.vaadin.ui.Panel
                  extended by com.vaadin.ui.Window
                      extended by com.vaadin.addon.touchkit.ui.Popover
All Implemented Interfaces:
com.vaadin.event.Action.Container, com.vaadin.event.Action.Notifier, com.vaadin.event.ConnectorEventListener, com.vaadin.event.FieldEvents.BlurNotifier, com.vaadin.event.FieldEvents.FocusNotifier, com.vaadin.event.MethodEventSource, com.vaadin.server.ClientConnector, com.vaadin.server.Scrollable, com.vaadin.server.Sizeable, com.vaadin.server.VariableOwner, com.vaadin.shared.Connector, com.vaadin.ui.Component, com.vaadin.ui.Component.Focusable, com.vaadin.ui.HasComponents, com.vaadin.ui.HasComponents.ComponentAttachDetachNotifier, com.vaadin.ui.LegacyComponent, com.vaadin.ui.SingleComponentContainer, Serializable, Iterable<com.vaadin.ui.Component>, EventListener

public class Popover
extends com.vaadin.ui.Window

The Popover is a modal sub window suitable for mobile devices. It is often used to quickly display more options or small form related to an action. Popover does not support dragging or resizing by the end user.

An example of a typical use case would be the following: In a mobile mail application when you hit an icon, you'll see a Popover with actions: "Reply", "Forward" and "Print". E.g. on the iPad the actions would be shown next to the touched icon so they are close to the users finger (the related button can be set with showRelativeTo(Component)), while on smaller screens (e.g. the iPhone) this kind of UI element fills the whole width of the screen.

A Popover can also be made full screen with AbstractComponent.setSizeFull(). In this case, all borders will be hidden and the window will block all other content of the main window. Using a full screen subwindow, instead of changing the whole content of the main window may cause a slightly faster return to the original view.

Finally, on a pad-sized device, if the window is not full screen nor related to a component, it will be completely undecorated by default, allowing the content to dictate the look.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.vaadin.ui.Window
com.vaadin.ui.Window.CloseEvent, com.vaadin.ui.Window.CloseListener, com.vaadin.ui.Window.CloseShortcut, com.vaadin.ui.Window.ResizeEvent, com.vaadin.ui.Window.ResizeListener, com.vaadin.ui.Window.WindowModeChangeEvent, com.vaadin.ui.Window.WindowModeChangeListener
 
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
 
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
 
Field Summary
 
Fields inherited from class com.vaadin.ui.Window
closeShortcut
 
Fields inherited from class com.vaadin.ui.Panel
actionManager
 
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
Popover()
          Constructs a new Popover.
Popover(com.vaadin.ui.ComponentContainer content)
          Constructs a new Popover with the given content.
 
Method Summary
 void addComponent(com.vaadin.ui.Button b)
          A convenience method that adds a button to the bottom of the popover's content.
 void beforeClientResponse(boolean initial)
           
 PopoverState getState()
           
 void removeFromParent()
          Removes the popover from the UI.
 void setClosable(boolean closable)
          Sets whether the Popover is automatically closed when the user clicks (taps) outside of it.
 void showRelativeTo(com.vaadin.ui.Component relatedComponent)
          This method will add the Popover to the top level window so that it is aligned below or on top of the given component, unless this is a small screen device, e.g a smart phone.
 
Methods inherited from class com.vaadin.ui.Window
addBlurListener, addCloseListener, addFocusListener, addListener, addListener, addListener, addListener, addResizeListener, addWindowModeChangeListener, bringToFront, center, changeVariables, close, fireClose, fireResize, fireWindowWindowModeChange, focus, getAssistiveDescription, getAssistivePostfix, getAssistivePrefix, getAssistiveRole, getPositionX, getPositionY, getState, getTabStopBottomAssistiveText, getTabStopTopAssistiveText, getWindowMode, isClosable, isDraggable, isModal, isResizable, isResizeLazy, isTabStopEnabled, paintContent, removeBlurListener, removeCloseListener, removeCloseShortcut, removeFocusListener, removeListener, removeListener, removeListener, removeListener, removeResizeListener, removeWindowModeChangeListener, setAssistiveDescription, setAssistivePostfix, setAssistivePrefix, setAssistiveRole, setCloseShortcut, setDraggable, setModal, setParent, setPositionX, setPositionY, setResizable, setResizeLazy, setTabStopBottomAssistiveText, setTabStopEnabled, setTabStopTopAssistiveText, setWindowMode
 
Methods inherited from class com.vaadin.ui.Panel
addAction, addActionHandler, addClickListener, addListener, getActionManager, getScrollLeft, getScrollTop, getTabIndex, removeAction, removeActionHandler, removeAllActionHandlers, removeClickListener, removeListener, setCaption, setScrollLeft, setScrollTop, setTabIndex
 
Methods inherited from class com.vaadin.ui.AbstractSingleComponentContainer
addComponentAttachListener, addComponentDetachListener, fireComponentAttachEvent, fireComponentDetachEvent, getComponentCount, getContent, iterator, removeComponentAttachListener, removeComponentDetachListener, removeFromParent, setContent, setHeight, setWidth
 
Methods inherited from class com.vaadin.ui.AbstractComponent
addListener, addShortcutListener, addStyleName, attach, detach, findAncestor, fireComponentErrorEvent, fireComponentEvent, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorMessage, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isConnectorEnabled, isEnabled, isImmediate, isReadOnly, isVisible, removeListener, removeShortcutListener, removeStyleName, setComponentError, setData, setDebugId, setDescription, setEnabled, setHeight, setIcon, setId, setImmediate, setLocale, 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.LegacyComponent
markAsDirty
 
Methods inherited from interface com.vaadin.server.VariableOwner
isEnabled, isImmediate
 
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, setPrimaryStyleName, setReadOnly, setStyleName, setVisible
 
Methods inherited from interface com.vaadin.server.ClientConnector
addAttachListener, addDetachListener, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, 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, setHeight, setSizeFull, setSizeUndefined, setWidth, setWidth
 

Constructor Detail

Popover

public Popover()
Constructs a new Popover. By default, the Popover is modal. This is usually the most sensible approach on devices.


Popover

public Popover(com.vaadin.ui.ComponentContainer content)
Constructs a new Popover with the given content.

Parameters:
content - the content for the popover.
Method Detail

beforeClientResponse

public void beforeClientResponse(boolean initial)
Specified by:
beforeClientResponse in interface com.vaadin.server.ClientConnector
Overrides:
beforeClientResponse in class com.vaadin.ui.AbstractComponent

getState

public PopoverState getState()
Overrides:
getState in class com.vaadin.ui.Window

showRelativeTo

public void showRelativeTo(com.vaadin.ui.Component relatedComponent)
This method will add the Popover to the top level window so that it is aligned below or on top of the given component, unless this is a small screen device, e.g a smart phone. By default, an arrow pointing to the given related component will be shown.

On a small screen device, a 100% wide overlay will slide in from the bottom or top depending on the given related components position (in an attempt to leave the related component visible, though this is not guaranteed).

Parameters:
relatedComponent - the component next to which the popover is shown.

setClosable

public void setClosable(boolean closable)
Sets whether the Popover is automatically closed when the user clicks (taps) outside of it. Note that no close button is displayed by default, so some other way to close the window must be arranged if set to false.

Overrides:
setClosable in class com.vaadin.ui.Window
Parameters:
closable - true to allow the user to close the Popover by tapping outside of it

removeFromParent

public void removeFromParent()
Removes the popover from the UI.


addComponent

public void addComponent(com.vaadin.ui.Button b)
A convenience method that adds a button to the bottom of the popover's content.

Parameters:
b - the button to add.


Copyright © 2014 Vaadin Ltd. All rights reserved.