Interface PopupButton

All Superinterfaces:
ActionsHolder, Component, Component.BelongToFrame, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, HasHtmlCaption, HasHtmlDescription, HasHtmlSanitizer, HasSubParts
All Known Implementing Classes:
PopupButtonImpl, RelatedEntitiesImpl

@StudioComponent(caption="PopupButton", category="Components", xmlElement="popupButton", icon="io/jmix/ui/icon/component/popupButton.svg", canvasTextProperty="caption", canvasBehaviour=POPUP_BUTTON, documentationURL="https://docs.jmix.io/jmix/%VERSION%/ui/vcl/components/popup-button.html") public interface PopupButton extends ActionsHolder, Component.HasCaption, Component.BelongToFrame, Component.HasIcon, Component.Focusable, HasHtmlCaption, HasHtmlDescription, HasHtmlSanitizer
A Button with a popup. The popup can contain actions or popup panel with custom content.
  • Field Details

  • Method Details

    • isPopupVisible

      boolean isPopupVisible()
      Returns:
      true if popup is opened
    • setPopupVisible

      void setPopupVisible(boolean popupVisible)
      Open or close popup panel.
      Parameters:
      popupVisible - whether open or close popup panel.
    • setMenuWidth

      @StudioProperty(type=SIZE) void setMenuWidth(@Nullable String width)
      Sets menu width.
      Parameters:
      width - new menu width
    • getMenuWidth

      float getMenuWidth()
      Returns:
      menu width
    • getMenuWidthSizeUnit

      SizeUnit getMenuWidthSizeUnit()
      Gets the menu width property units.
      Returns:
      units used in the menu width property.
    • isAutoClose

      boolean isAutoClose()
      Returns:
      whether to close menu automatically after action triggering or not
    • setAutoClose

      @StudioProperty(defaultValue="true") void setAutoClose(boolean autoClose)
      Sets menu automatic close after option click.
      Parameters:
      autoClose - whether to close menu automatically after action triggering or not
    • setShowActionIcons

      @StudioProperty(defaultValue="false") void setShowActionIcons(boolean showActionIcons)
      Sets show icons for action buttons
    • isShowActionIcons

      boolean isShowActionIcons()
      Returns show icons for action buttons
    • isTogglePopupVisibilityOnClick

      boolean isTogglePopupVisibilityOnClick()
      Returns:
      if sequential click on popup will toggle popup visibility
    • setTogglePopupVisibilityOnClick

      @StudioProperty(defaultValue="true") void setTogglePopupVisibilityOnClick(boolean togglePopupVisibilityOnClick)
      Sets sequential click on popup will toggle popup visibility.
      Parameters:
      togglePopupVisibilityOnClick - true if sequential click on popup should toggle popup visibility
    • getPopupOpenDirection

      PopupButton.PopupOpenDirection getPopupOpenDirection()
      Returns:
      opening direction for the popup
    • setPopupOpenDirection

      @StudioProperty(type=ENUMERATION, options={"BOTTOM_LEFT","BOTTOM_RIGHT","BOTTOM_CENTER"}) void setPopupOpenDirection(PopupButton.PopupOpenDirection direction)
      Sets opening direction for the popup.
      Parameters:
      direction - new direction
    • isClosePopupOnOutsideClick

      boolean isClosePopupOnOutsideClick()
      Returns:
      true if a click outside the popup closing the popup, otherwise - false
    • setClosePopupOnOutsideClick

      @StudioProperty(defaultValue="true") void setClosePopupOnOutsideClick(boolean closePopupOnOutsideClick)
      If set to true, clicking on outside the popup closes it. Note that this doesn't affect clicking on the button itself.
      Parameters:
      closePopupOnOutsideClick - whether to close popup on outside click
    • setPopupContent

      void setPopupContent(@Nullable Component popupContent)
      Sets custom inner content for the popup. Actions are ignored if a custom popup content is set.
      Parameters:
      popupContent - popup component.
    • getPopupContent

      @Nullable Component getPopupContent()
      Returns:
      popup content component
    • addPopupVisibilityListener

      Subscription addPopupVisibilityListener(Consumer<PopupButton.PopupVisibilityEvent> listener)