Interface Accordion

All Superinterfaces:
Component, Component.BelongToFrame, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, ComponentContainer, HasComponents, HasContextHelp, HasHtmlCaption, HasHtmlDescription, HasHtmlSanitizer
All Known Implementing Classes:
AccordionImpl

@StudioComponent(caption="Accordion", category="Containers", xmlElement="accordion", icon="io/jmix/ui/icon/container/accordion.svg", canvasBehaviour=CONTAINER, containerType=ACCORDION, documentationURL="https://docs.jmix.io/jmix/%VERSION%/ui/vcl/containers/accordion.html") public interface Accordion extends ComponentContainer, Component.BelongToFrame, Component.HasCaption, Component.HasIcon, Component.Focusable, HasContextHelp, HasHtmlCaption, HasHtmlDescription, HasHtmlSanitizer
An accordion is a component similar to a TabSheet, but with a vertical orientation and the selected component presented between tabs.
  • Field Details

  • Method Details

    • addTab

      Accordion.Tab addTab(String name, Component component)
      Adds a new tab to the component.
      Parameters:
      name - id of the new tab
      component - a component that will be the content of the new tab
      Returns:
      the new tab
    • addLazyTab

      Accordion.Tab addLazyTab(String name, org.dom4j.Element descriptor, ComponentLoader loader)
      INTERNAL. Adds a new lazy tab to the component.
    • removeTab

      void removeTab(String name)
      Removes tab.
      Parameters:
      name - id of the tab to remove
    • removeAllTabs

      void removeAllTabs()
      Removes all tabs.
    • getSelectedTab

      @Nullable Accordion.Tab getSelectedTab()
      Gets selected tab. May be null if the accordion does not contain tabs at all.
    • setSelectedTab

      void setSelectedTab(Accordion.Tab tab)
      Sets selected tab.
      Parameters:
      tab - tab instance
    • setSelectedTab

      void setSelectedTab(String name)
      Sets selected tab.
      Parameters:
      name - tab id
    • getTab

      @Nullable Accordion.Tab getTab(String name)
      Gets tab with the provided id.
      Parameters:
      name - tab id
      Returns:
      tab instance
    • getTabComponent

      Component getTabComponent(String name)
      Gets a component that is a content of the tab.
      Parameters:
      name - tab id
      Returns:
      tab content
    • getTabs

      Gets all tabs.
    • isTabCaptionsAsHtml

      boolean isTabCaptionsAsHtml()
      Returns:
      true if the tab captions are rendered as HTML, false if rendered as plain text
    • setTabCaptionsAsHtml

      @StudioProperty(defaultValue="false") void setTabCaptionsAsHtml(boolean tabCaptionsAsHtml)
      Sets whether HTML is allowed in the tab captions.
      Parameters:
      tabCaptionsAsHtml - true if the tab captions are rendered as HTML, false if rendered as plain text
    • addSelectedTabChangeListener

      Subscription addSelectedTabChangeListener(Consumer<Accordion.SelectedTabChangeEvent> listener)
      Adds a listener that will be notified when a selected tab is changed.