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 Classes
    Modifier and Type
    Class
    Description
    class 
    This event is received by the PopupVisibilityListeners when the visibility of the popup changes.
    static interface 
    Defines 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.ClickShortcut

    Nested classes/interfaces inherited from class com.vaadin.server.AbstractClientConnector

    com.vaadin.server.AbstractClientConnector.IncorrectConcurrentAccessHandler

    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.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.Listener

    Nested classes/interfaces inherited from interface com.vaadin.ui.Component.HasContextHelp

    com.vaadin.ui.Component.HasContextHelp.ContextHelpIconClickEvent, com.vaadin.ui.Component.HasContextHelp.ContextHelpIconClickListener

    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.server.Sizeable

    com.vaadin.server.Sizeable.Unit
  • Field Summary

    Fields inherited from class com.vaadin.ui.Button

    clickShortcut

    Fields inherited from class com.vaadin.ui.AbstractComponent

    componentErrorProvider, DESIGN_ATTR_PLAIN_TEXT, requiredError

    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

    Constructors
    Constructor
    Description
     
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.vaadin.shared.Registration
    addComponentAttachListener(com.vaadin.ui.HasComponents.ComponentAttachListener listener)
     
    com.vaadin.shared.Registration
    addComponentDetachListener(com.vaadin.ui.HasComponents.ComponentDetachListener listener)
     
    com.vaadin.shared.Registration
    Add a listener that is called whenever the visibility of the popup is changed.
    int
     
    com.vaadin.ui.Component
     
    com.vaadin.ui.Alignment
    Gets popup's opening direction.
     
    boolean
    Is visibility of the popup toggled on a button click?
    boolean
    Is a click outside the popup closing the popup or not?
    boolean
    Checks if the popup is visible.
    Iterator<com.vaadin.ui.Component>
     
    void
    removeComponentAttachListener(com.vaadin.ui.HasComponents.ComponentAttachListener listener)
    Deprecated.
    void
    removeComponentDetachListener(com.vaadin.ui.HasComponents.ComponentDetachListener listener)
    Deprecated.
    void
    Deprecated.
    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.
    void
    setClosePopupOnOutsideClick(boolean closePopupOnOutsideClick)
    If true, clicking on outside the popup closes it.
    void
    setComponent(com.vaadin.ui.Component component)
    Deprecated.
    void
    setContent(com.vaadin.ui.Component content)
     
    void
    setDirection(com.vaadin.ui.Alignment direction)
    Sets opening direction for the popup.
    protected void
    setPopupPositionComponent(com.vaadin.ui.Component component)
     
    void
    setPopupVisible(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, writeDesign

    Methods inherited from class com.vaadin.ui.AbstractFocusable

    addBlurListener, addFocusListener, focus, getTabIndex, setTabIndex

    Methods 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, setWidthUndefined

    Methods 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, updateDiffstate

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.vaadin.event.Action.ShortcutNotifier

    addShortcutListener, removeShortcutListener

    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.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, writeDesign

    Methods inherited from interface com.vaadin.shared.Connector

    getConnectorId

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator

    Methods 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

      public PopupButton(String caption)
  • Method Details

    • iterator

      public Iterator<com.vaadin.ui.Component> iterator()
      Specified by:
      iterator in interface com.vaadin.ui.HasComponents
      Specified by:
      iterator in interface Iterable<com.vaadin.ui.Component>
    • 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 public void setComponent(com.vaadin.ui.Component component)
      Deprecated.
      Set 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:
      getContent in interface com.vaadin.ui.SingleComponentContainer
    • setContent

      public void setContent(com.vaadin.ui.Component content)
      Specified by:
      setContent in interface com.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 are Alignment.BOTTOM_LEFT, Alignment.BOTTOM_CENTER and Alignment.BOTTOM_RIGHT. Default is Alignment.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.
      See Also:
    • 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 public void removePopupVisibilityListener(PopupButton.PopupVisibilityListener listener)
      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:
      getComponentCount in interface com.vaadin.ui.SingleComponentContainer
    • getState

      public PopupButtonState getState()
      Overrides:
      getState in class com.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:
      addComponentAttachListener in interface com.vaadin.ui.HasComponents.ComponentAttachDetachNotifier
    • removeComponentAttachListener

      @Deprecated public void removeComponentAttachListener(com.vaadin.ui.HasComponents.ComponentAttachListener listener)
      Deprecated.
      Specified by:
      removeComponentAttachListener in interface com.vaadin.ui.HasComponents.ComponentAttachDetachNotifier
    • addComponentDetachListener

      public com.vaadin.shared.Registration addComponentDetachListener(com.vaadin.ui.HasComponents.ComponentDetachListener listener)
      Specified by:
      addComponentDetachListener in interface com.vaadin.ui.HasComponents.ComponentAttachDetachNotifier
    • removeComponentDetachListener

      @Deprecated public void removeComponentDetachListener(com.vaadin.ui.HasComponents.ComponentDetachListener listener)
      Deprecated.
      Specified by:
      removeComponentDetachListener in interface com.vaadin.ui.HasComponents.ComponentAttachDetachNotifier