Class PopupButton
java.lang.Object
com.vaadin.server.AbstractClientConnector
com.vaadin.ui.AbstractComponent
com.vaadin.ui.AbstractFocusable
com.vaadin.ui.Button
io.jmix.ui.widget.addon.popupbutton.PopupButton
- All Implemented Interfaces:
com.vaadin.event.Action.ShortcutNotifier,com.vaadin.event.ContextClickEvent.ContextClickNotifier,com.vaadin.event.FieldEvents.BlurNotifier,com.vaadin.event.FieldEvents.FocusNotifier,com.vaadin.event.MethodEventSource,com.vaadin.server.ClientConnector,com.vaadin.server.Sizeable,com.vaadin.shared.Connector,com.vaadin.ui.Component,com.vaadin.ui.Component.Focusable,com.vaadin.ui.Component.HasContextHelp,com.vaadin.ui.HasComponents,com.vaadin.ui.HasComponents.ComponentAttachDetachNotifier,com.vaadin.ui.SingleComponentContainer,Serializable,Iterable<com.vaadin.ui.Component>
- Direct Known Subclasses:
JmixPopupButton
public class PopupButton
extends com.vaadin.ui.Button
implements com.vaadin.ui.SingleComponentContainer
A
Button with a popup. The popup can contain any Vaadin
Components and @{link ComponentContainer}s.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassThis event is received by the PopupVisibilityListeners when the visibility of the popup changes.static interfaceDefines a listener that can receive a PopupVisibilityEvent when the visibility of the popup changes.Nested classes/interfaces inherited from class com.vaadin.ui.Button
com.vaadin.ui.Button.ClickEvent, com.vaadin.ui.Button.ClickListener, com.vaadin.ui.Button.ClickShortcutNested classes/interfaces inherited from class com.vaadin.server.AbstractClientConnector
com.vaadin.server.AbstractClientConnector.IncorrectConcurrentAccessHandlerNested 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.DetachListenerNested 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.HasContextHelp, com.vaadin.ui.Component.ListenerNested classes/interfaces inherited from interface com.vaadin.ui.Component.HasContextHelp
com.vaadin.ui.Component.HasContextHelp.ContextHelpIconClickEvent, com.vaadin.ui.Component.HasContextHelp.ContextHelpIconClickListenerNested 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.ComponentDetachListenerNested classes/interfaces inherited from interface com.vaadin.server.Sizeable
com.vaadin.server.Sizeable.Unit -
Field Summary
Fields inherited from class com.vaadin.ui.Button
clickShortcutFields inherited from class com.vaadin.ui.AbstractComponent
componentErrorProvider, DESIGN_ATTR_PLAIN_TEXT, requiredErrorFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.shared.RegistrationaddComponentAttachListener(com.vaadin.ui.HasComponents.ComponentAttachListener listener) com.vaadin.shared.RegistrationaddComponentDetachListener(com.vaadin.ui.HasComponents.ComponentDetachListener listener) com.vaadin.shared.RegistrationAdd a listener that is called whenever the visibility of the popup is changed.intcom.vaadin.ui.Componentcom.vaadin.ui.AlignmentGets popup's opening direction.getState()booleanIs visibility of the popup toggled on a button click?booleanIs a click outside the popup closing the popup or not?booleanChecks if the popup is visible.Iterator<com.vaadin.ui.Component>iterator()voidremoveComponentAttachListener(com.vaadin.ui.HasComponents.ComponentAttachListener listener) Deprecated.voidremoveComponentDetachListener(com.vaadin.ui.HasComponents.ComponentDetachListener listener) Deprecated.voidDeprecated.voidsetButtonClickTogglesPopupVisibility(boolean buttonClickTogglesPopupVisibility) If true, clicking the button toggles visibility of the popup: a visible popup will be hidden, and an invisible popup will be shown.voidsetClosePopupOnOutsideClick(boolean closePopupOnOutsideClick) If true, clicking on outside the popup closes it.voidsetComponent(com.vaadin.ui.Component component) Deprecated.voidsetContent(com.vaadin.ui.Component content) voidsetDirection(com.vaadin.ui.Alignment direction) Sets opening direction for the popup.protected voidsetPopupPositionComponent(com.vaadin.ui.Component component) voidsetPopupVisible(boolean popupVisible) Shows or hides popup.Methods inherited from class com.vaadin.ui.Button
addClickListener, click, fireClick, fireClick, getCustomAttributes, getIconAlternateText, getState, isDisableOnClick, isHtmlContentAllowed, readDesign, removeClickListener, removeClickShortcut, setClickShortcut, setDisableOnClick, setHtmlContentAllowed, setIcon, setIconAlternateText, writeDesignMethods inherited from class com.vaadin.ui.AbstractFocusable
addBlurListener, addFocusListener, focus, getTabIndex, setTabIndexMethods inherited from class com.vaadin.ui.AbstractComponent
addContextClickListener, addContextHelpIconClickListener, addListener, addShortcutListener, addStyleName, attach, beforeClientResponse, detach, ensureContextHelpInitialized, findAncestor, fireComponentErrorEvent, fireComponentEvent, fireContextHelpClick, getActionManager, getCaption, getComponentError, getComponentErrorProvider, getContextHelpText, getData, getDebugId, getDescription, getErrorMessage, getHeight, getHeightUnits, getIcon, getId, getJTestId, getLocale, getParent, getPrimaryStyleName, getRequiredError, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isContextHelpTextHtmlEnabled, isEnabled, isOrHasAncestor, isReadOnly, isRequiredIndicatorVisible, isResponsive, isVisible, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaption, setCaptionAsHtml, setComponentError, setComponentErrorProvider, setContextHelpText, setContextHelpTextHtmlEnabled, setData, setDebugId, setDescription, setDescription, setEnabled, setHeight, setHeight, setHeightFull, setHeightUndefined, setIcon, setId, setJTestId, setLocale, setParent, setPrimaryStyleName, setReadOnly, setRequiredError, setRequiredIndicatorVisible, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth, setWidth, setWidthFull, setWidthUndefinedMethods inherited from class com.vaadin.server.AbstractClientConnector
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getIncorrectConcurrentAccessHandler, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setConnectorResource, setErrorHandler, setIncorrectConcurrentAccessHandler, setResource, updateDiffstateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.event.Action.ShortcutNotifier
addShortcutListener, removeShortcutListenerMethods 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, setErrorHandlerMethods inherited from interface com.vaadin.ui.Component
addListener, addStyleName, addStyleNames, attach, getCaption, getDescription, getIcon, getId, getJTestId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isVisible, readDesign, removeListener, removeStyleName, removeStyleNames, setCaption, setEnabled, setIcon, setId, setJTestId, setParent, setPrimaryStyleName, setStyleName, setStyleName, setVisible, writeDesignMethods inherited from interface com.vaadin.shared.Connector
getConnectorIdMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface com.vaadin.server.Sizeable
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeightFull, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull, setWidthUndefined
-
Constructor Details
-
PopupButton
public PopupButton() -
PopupButton
-
-
Method Details
-
iterator
-
setPopupVisible
public void setPopupVisible(boolean popupVisible) Shows or hides popup.- Parameters:
popupVisible- if true, popup is set to visible, otherwise popup is hidden.
-
isPopupVisible
public boolean isPopupVisible()Checks if the popup is visible.- Returns:
- true, if popup is visible, false otherwise.
-
setComponent
Deprecated.UsesetContent(Component)insteadSet the content component of the popup.- Parameters:
component- the component to be displayed in the popup.
-
getContent
@Nullable public com.vaadin.ui.Component getContent()- Specified by:
getContentin interfacecom.vaadin.ui.SingleComponentContainer
-
setContent
public void setContent(com.vaadin.ui.Component content) - Specified by:
setContentin interfacecom.vaadin.ui.SingleComponentContainer
-
getDirection
public com.vaadin.ui.Alignment getDirection()Gets popup's opening direction. -
setDirection
public void setDirection(@Nullable com.vaadin.ui.Alignment direction) Sets opening direction for the popup. At the moment only support values areAlignment.BOTTOM_LEFT,Alignment.BOTTOM_CENTERandAlignment.BOTTOM_RIGHT. Default isAlignment.BOTTOM_RIGHT. -
isButtonClickTogglesPopupVisibility
public boolean isButtonClickTogglesPopupVisibility()Is visibility of the popup toggled on a button click?- See Also:
-
setButtonClickTogglesPopupVisibility
public void setButtonClickTogglesPopupVisibility(boolean buttonClickTogglesPopupVisibility) If true, clicking the button toggles visibility of the popup: a visible popup will be hidden, and an invisible popup will be shown. Default is true.- See Also:
-
isClosePopupOnOutsideClick
public boolean isClosePopupOnOutsideClick()Is a click outside the popup closing the popup or not?- See Also:
-
setClosePopupOnOutsideClick
public void setClosePopupOnOutsideClick(boolean closePopupOnOutsideClick) If true, clicking on outside the popup closes it. Note that this doesn't affect clicking on the button itself. Default is true. -
addPopupVisibilityListener
public com.vaadin.shared.Registration addPopupVisibilityListener(PopupButton.PopupVisibilityListener listener) Add a listener that is called whenever the visibility of the popup is changed.- Parameters:
listener- the listener to add- See Also:
-
removePopupVisibilityListener
Deprecated.Removes a previously added listener, so that it no longer receives events when the visibility of the popup changes.- Parameters:
listener- the listener to remove- See Also:
-
getComponentCount
public int getComponentCount()- Specified by:
getComponentCountin interfacecom.vaadin.ui.SingleComponentContainer
-
getState
- Overrides:
getStatein classcom.vaadin.ui.Button
-
setPopupPositionComponent
protected void setPopupPositionComponent(com.vaadin.ui.Component component) -
addComponentAttachListener
public com.vaadin.shared.Registration addComponentAttachListener(com.vaadin.ui.HasComponents.ComponentAttachListener listener) - Specified by:
addComponentAttachListenerin interfacecom.vaadin.ui.HasComponents.ComponentAttachDetachNotifier
-
removeComponentAttachListener
@Deprecated public void removeComponentAttachListener(com.vaadin.ui.HasComponents.ComponentAttachListener listener) Deprecated.- Specified by:
removeComponentAttachListenerin interfacecom.vaadin.ui.HasComponents.ComponentAttachDetachNotifier
-
addComponentDetachListener
public com.vaadin.shared.Registration addComponentDetachListener(com.vaadin.ui.HasComponents.ComponentDetachListener listener) - Specified by:
addComponentDetachListenerin interfacecom.vaadin.ui.HasComponents.ComponentAttachDetachNotifier
-
removeComponentDetachListener
@Deprecated public void removeComponentDetachListener(com.vaadin.ui.HasComponents.ComponentDetachListener listener) Deprecated.- Specified by:
removeComponentDetachListenerin interfacecom.vaadin.ui.HasComponents.ComponentAttachDetachNotifier
-
setContent(Component)instead