public class PopupView extends AbstractComponent implements HasComponents
PopupView.Content
is
used to deliver contents to this component.Modifier and Type | Class and Description |
---|---|
static interface |
PopupView.Content
Used to deliver customized content-packages to the PopupView.
|
static class |
PopupView.PopupVisibilityEvent
This event is received by the PopupVisibilityListeners when the
visibility of the popup changes.
|
static interface |
PopupView.PopupVisibilityListener
Defines a listener that can receive a PopupVisibilityEvent when the
visibility of the popup changes.
|
HasComponents.ComponentAttachDetachNotifier, HasComponents.ComponentAttachEvent, HasComponents.ComponentAttachListener, HasComponents.ComponentDetachEvent, HasComponents.ComponentDetachListener
Component.ErrorEvent, Component.Event, Component.Focusable, Component.Listener
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener
Sizeable.Unit
DESIGN_ATTR_PLAIN_TEXT
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS
Constructor and Description |
---|
PopupView()
Deprecated.
|
PopupView(PopupView.Content content)
Creates a PopupView through the PopupView.Content interface.
|
PopupView(String small,
Component large)
A simple way to create a PopupPanel.
|
Modifier and Type | Method and Description |
---|---|
Registration |
addPopupVisibilityListener(PopupView.PopupVisibilityListener listener)
Add a listener that is called whenever the visibility of the popup is
changed.
|
void |
beforeClientResponse(boolean initial)
Called before the shared state and RPC invocations are sent to the
client.
|
protected static PopupView.Content |
createContent(String minimizedValue,
Component popupContent)
Creates a Content from given text representation and popup content.
|
void |
detach()
Notifies the connector that it is detached from its VaadinSession.
|
int |
getComponentCount()
Gets the number of contained components.
|
PopupView.Content |
getContent()
Returns the content-package for this PopupView.
|
protected PopupViewState |
getState()
Returns the shared state bean with information to be sent from the server
to the client.
|
protected PopupViewState |
getState(boolean markAsDirty)
Returns the shared state for this connector.
|
boolean |
isHideOnMouseOut()
Check if this popup will be hidden when the user takes the mouse cursor
out of the popup area.
|
boolean |
isPopupVisible()
Return whether the popup is visible.
|
Iterator<Component> |
iterator()
This class only contains other components when the popup is showing.
|
void |
readDesign(org.jsoup.nodes.Element design,
DesignContext designContext)
Reads the component state from the given design.
|
void |
removePopupVisibilityListener(PopupView.PopupVisibilityListener listener)
Deprecated.
As of 8.0, replaced by
Registration.remove() in the
registration object returned from
addPopupVisibilityListener(PopupVisibilityListener) . |
void |
setContent(PopupView.Content newContent)
This method will replace the current content of the panel with a new one.
|
void |
setHideOnMouseOut(boolean hideOnMouseOut)
Should the popup automatically hide when the user takes the mouse cursor
out of the popup area? If this is false, the user must click outside the
popup to close it.
|
void |
setPopupVisible(boolean visible)
Set the visibility of the popup.
|
void |
setVisible(boolean visible)
Sets the visibility of the component.
|
void |
writeDesign(org.jsoup.nodes.Element design,
DesignContext designContext)
Writes the component state to the given design.
|
addContextClickListener, addListener, addShortcutListener, addStyleName, attach, findAncestor, fireComponentErrorEvent, fireComponentEvent, focus, getActionManager, getCaption, getComponentError, getCustomAttributes, getData, getDebugId, getDescription, getErrorMessage, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isEnabled, isOrHasAncestor, isReadOnly, isRequiredIndicatorVisible, isResponsive, isVisible, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaption, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setDescription, setEnabled, setHeight, setHeight, setHeightUndefined, setIcon, setId, setLocale, setParent, setPrimaryStyleName, setReadOnly, setRequiredIndicatorVisible, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setWidth, setWidth, setWidthUndefined
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource, updateDiffstate
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
addListener, addStyleName, addStyleNames, attach, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isVisible, removeListener, removeStyleName, removeStyleNames, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setStyleName, setStyleName
addAttachListener, addDetachListener, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
getConnectorId
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthUndefined
forEach, spliterator
@Deprecated public PopupView()
PopupView(String, Component)
instead.public PopupView(String small, Component large)
PopupView(Content)
.small
- the minimal textual representation as HTMLlarge
- the full, Component-type representationpublic PopupView(PopupView.Content content)
content
- the PopupView.Content that contains the information for thisprotected static PopupView.Content createContent(String minimizedValue, Component popupContent)
minimizedValue
- text representation when popup is hiddenpopupContent
- popup contentpublic void setContent(PopupView.Content newContent) throws IllegalArgumentException
newContent
- PopupView.Content object containing new information for the
PopupViewIllegalArgumentException
- if the method is passed a null value, or if one of the
content methods returns nullpublic PopupView.Content getContent()
public void setPopupVisible(boolean visible)
visible
- public void beforeClientResponse(boolean initial)
ClientConnector
beforeClientResponse
in interface ClientConnector
beforeClientResponse
in class AbstractComponent
initial
- true
if the client-side connector will be created
and initialized after this method has been invoked.
false
if there is already an initialized
client-side connector.public boolean isPopupVisible()
public boolean isHideOnMouseOut()
public void setHideOnMouseOut(boolean hideOnMouseOut)
hideOnMouseOut
- public Iterator<Component> iterator()
iterator
in interface HasComponents
iterator
in interface Iterable<Component>
ComponentContainer.getComponentIterator()
public int getComponentCount()
public void readDesign(org.jsoup.nodes.Element design, DesignContext designContext)
Component
The component is responsible not only for updating its own state but also for ensuring that its children update their state based on the design.
It is assumed that the component is in its default state when this method is called. Reading should only take into consideration attributes specified in the design and not reset any unspecified attributes to their defaults.
This method must not modify the design.
readDesign
in interface Component
readDesign
in class AbstractComponent
design
- The element to obtain the state fromdesignContext
- The DesignContext instance used for parsing the designpublic void writeDesign(org.jsoup.nodes.Element design, DesignContext designContext)
Component
The component is responsible not only for writing its own state but also for ensuring that its children write their state to the design.
This method must not modify the component state.
writeDesign
in interface Component
writeDesign
in class AbstractComponent
design
- The element to write the component state to. Any previous
attributes or child nodes are not cleared.designContext
- The DesignContext instance used for writing the designprotected PopupViewState getState()
AbstractComponent
getState
in class AbstractComponent
protected PopupViewState getState(boolean markAsDirty)
AbstractClientConnector
getState
in class AbstractComponent
markAsDirty
- true if the connector should automatically be marked dirty,
false otherwiseAbstractClientConnector.getState()
public Registration addPopupVisibilityListener(PopupView.PopupVisibilityListener listener)
listener
- the listener to add, not nullPopupView.PopupVisibilityListener
,
PopupView.PopupVisibilityEvent
@Deprecated public void removePopupVisibilityListener(PopupView.PopupVisibilityListener listener)
Registration.remove()
in the
registration object returned from
addPopupVisibilityListener(PopupVisibilityListener)
.listener
- the listener to removePopupView.PopupVisibilityListener
,
addPopupVisibilityListener(PopupVisibilityListener)
public void detach()
AbstractClientConnector
The caller of this method is #setParent(ClientConnector)
if the
parent is in the session. When the parent is detached from the session it
is its responsibility to call ClientConnector.detach()
for each of its children.
The AbstractClientConnector.getSession()
and AbstractClientConnector.getUI()
methods might return
null
after this method is called.
detach
in interface ClientConnector
detach
in class AbstractComponent
public void setVisible(boolean visible)
Component
Visible components are drawn in the user interface, while invisible ones are not. The effect is not merely a cosmetic CSS change - no information about an invisible component will be sent to the client. The effect is thus the same as removing the component from its parent.
TextField readonly = new TextField("Read-Only"); readonly.setValue("You can't see this!"); readonly.setVisible(false); layout.addComponent(readonly);
A component is visible only if all of its parents are also visible. If a component is explicitly set to be invisible, changes in the visibility of its parents will not change the visibility of the component.
setVisible
in interface Component
setVisible
in class AbstractComponent
visible
- the boolean value specifying if the component should be
visible after the call or not.Component.isVisible()
Copyright © 2018 Vaadin Ltd. All rights reserved.