Interface UiTabPanel

All Superinterfaces:
AttributeReadAttached, AttributeReadEnabled, AttributeReadId, AttributeReadValid, AttributeReadVisible, AttributeWriteEnabled, AttributeWriteId, AttributeWriteReadOnly, AttributeWriteTooltip, AttributeWriteVisible, io.github.mmm.event.EventSource<UiEvent,UiEventListener>, UiComposite<UiTab>, UiMutableComposite<UiTab>, UiNativeWidget, UiRegularWidget, UiRemovableComposite<UiTab>, UiSwitchComposite<UiTab>, UiWidget

public interface UiTabPanel extends UiSwitchComposite<UiTab>, UiRegularWidget, UiNativeWidget
UiSwitchComposite representing a tab panel. It contains a number of children but only shows one of them at a time. It shows a tab bar (typically at the top as a header) with the labels of its children. The user can click on one of these tabs in order to see the actual content of the according tab.
This design might look a little complicated but gives a lot more flexibility for setting and changing attributes of the tab. For convenience usage there is also addTab(String, UiRegularWidget).
IMPORTANT: In case you make the UiTab closable, it will remove itself as child from this UiTabPanel when the end-user closes it.
Since:
1.0.0
  • Method Details

    • addTab

      default UiTab addTab(String text, UiRegularWidget child)
      Adds the given UiRegularWidget as new tab (and the end of all existing tabs).
      IMPORTANT: In case you make the UiTab closable, it will remove itself as child from this UiTabPanel when the end-user closes it.
      Parameters:
      text - the label that will be displayed to identify the tab.
      child - the tab content.
      Returns:
      the UiTab for this tab.
    • addTab

      default UiTab addTab(String text, Supplier<UiRegularWidget> childSupplier)
      Adds a new tab (and the end of all existing tabs) with the content provided lazily from the given Supplier (when the tab is selected for the first time).
      Parameters:
      text - the label that will be displayed to identify the tab.
      childSupplier - the Supplier providing the tab content. Allows lazy creation of the child when the tab is selected for the first time.
      Returns:
      the UiTab for this tab.
    • addTab

      UiTab addTab(String text, UiRegularWidget child, int index)
      Adds the given UiRegularWidget as new tab at the given index.
      Parameters:
      text - the label that will be displayed to identify the tab.
      child - the tab content.
      index - is the index where to insert the new UiTab.
      Returns:
      the UiTab for this tab.
    • addTab

      UiTab addTab(String text, Supplier<UiRegularWidget> childSupplier, int index)
      Adds a new tab at the given index with the content provided lazily from the given Supplier (when the tab is selected for the first time).
      Parameters:
      text - the label that will be displayed to identify the tab.
      childSupplier - the Supplier providing the tab content. Allows lazy creation of the child when the tab is selected for the first time.
      index - is the index where to insert the new UiTab.
      Returns:
      the UiTab for this tab. It allows to change the title, set tooltip or image (icon), etc.
    • of

      static UiTabPanel of()
      Returns:
      the new UiTabPanel.
    • of

      static UiTabPanel of(UiTab... children)
      Parameters:
      children - the UiRegularWidgets to add as children.
      Returns:
      the new UiTabPanel.