-
- 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
UiSwitchCompositerepresenting a tab panel. It contains a number ofchildrenbut only shows one of them at a time. It shows a tab bar (typically at the top as a header) with thelabelsof itschildren. The user can click on one of these tabs in order to see the actualcontentof the according tab.
This design might look a little complicated but gives a lot more flexibility for setting and changing attributes of thetab. For convenience usage there is alsoaddTab(String, UiRegularWidget).
IMPORTANT: In case youmaketheUiTabclosable, it will remove itself aschildfrom thisUiTabPanelwhen the end-user closes it.- Since:
- 1.0.0
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default UiTabaddTab(String text, UiRegularWidget child)Adds the givenUiRegularWidgetas new tab (and the end of all existing tabs).
IMPORTANT: In case youmaketheUiTabclosable, it will remove itself aschildfrom thisUiTabPanelwhen the end-user closes it.UiTabaddTab(String text, UiRegularWidget child, int index)Adds the givenUiRegularWidgetas new tab at the givenindex.default UiTabaddTab(String text, Supplier<UiRegularWidget> childSupplier)Adds a new tab (and the end of all existing tabs) with the content provided lazily from the givenSupplier(when the tab is selected for the first time).UiTabaddTab(String text, Supplier<UiRegularWidget> childSupplier, int index)Adds a new tab at the givenindexwith the content provided lazily from the givenSupplier(when the tab is selected for the first time).static UiTabPanelof()static UiTabPanelof(UiTab... children)-
Methods inherited from interface io.github.mmm.ui.api.attribute.AttributeReadAttached
isAttached
-
Methods inherited from interface io.github.mmm.ui.api.attribute.AttributeReadId
getId
-
Methods inherited from interface io.github.mmm.ui.api.attribute.AttributeWriteId
setId
-
Methods inherited from interface io.github.mmm.ui.api.attribute.AttributeWriteTooltip
getTooltip, setTooltip
-
Methods inherited from interface io.github.mmm.event.EventSource
addListener, addListener, addWeakListener, removeListener
-
Methods inherited from interface io.github.mmm.ui.api.widget.composite.UiComposite
getChild, getChild, getChildById, getChildCount, getChildIndex, getChildSibling, getChildSibling, getDescendant, getModificationTimestamp, getPropagation, isModified, isValid, reset, setFocused
-
Methods inherited from interface io.github.mmm.ui.api.widget.composite.UiMutableComposite
addChild, addChild
-
Methods inherited from interface io.github.mmm.ui.api.widget.composite.UiRemovableComposite
removeChild, removeChild
-
Methods inherited from interface io.github.mmm.ui.api.widget.composite.UiSwitchComposite
getActiveChild, getActiveChildIndex, setActiveChild, setActiveChildId, setActiveChildIndex
-
Methods inherited from interface io.github.mmm.ui.api.widget.UiWidget
cast, dispose, getParent, getReadOnlyFixed, getStyles, isDisposed, isEnabled, isEnabled, isFocused, isReadOnly, isVisible, isVisible, setEnabled, setEnabled, setReadOnly, setReadOnlyFixed, setVisible, setVisible, validate, validate, validate, validateDown, validateUp
-
-
-
-
Method Detail
-
addTab
default UiTab addTab(String text, UiRegularWidget child)
Adds the givenUiRegularWidgetas new tab (and the end of all existing tabs).
IMPORTANT: In case youmaketheUiTabclosable, it will remove itself aschildfrom thisUiTabPanelwhen the end-user closes it.- Parameters:
text- the label that will be displayed to identify the tab.child- thetab content.- Returns:
- the
UiTabfor 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 givenSupplier(when the tab is selected for the first time).- Parameters:
text- the label that will be displayed to identify the tab.childSupplier- theSupplierprovidingthetab content. Allows lazy creation of the child when the tab is selected for the first time.- Returns:
- the
UiTabfor this tab.
-
addTab
UiTab addTab(String text, UiRegularWidget child, int index)
Adds the givenUiRegularWidgetas new tab at the givenindex.- Parameters:
text- the label that will be displayed to identify the tab.child- thetab content.index- is theindexwhere to insert the newUiTab.- Returns:
- the
UiTabfor this tab.
-
addTab
UiTab addTab(String text, Supplier<UiRegularWidget> childSupplier, int index)
Adds a new tab at the givenindexwith the content provided lazily from the givenSupplier(when the tab is selected for the first time).- Parameters:
text- the label that will be displayed to identify the tab.childSupplier- theSupplierprovidingthetab content. Allows lazy creation of the child when the tab is selected for the first time.index- is theindexwhere to insert the newUiTab.- Returns:
- the
UiTabfor 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- theUiRegularWidgets to add as children.- Returns:
- the new
UiTabPanel.
-
-