- 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
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 Summary
Modifier and TypeMethodDescriptiondefault UiTab
addTab
(String text, UiRegularWidget child) Adds the givenUiRegularWidget
as new tab (and the end of all existing tabs).
IMPORTANT: In case youmake
theUiTab
closable
, it will remove itself aschild
from thisUiTabPanel
when the end-user closes it.addTab
(String text, UiRegularWidget child, int index) Adds the givenUiRegularWidget
as new tab at the givenindex
.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).addTab
(String text, Supplier<UiRegularWidget> childSupplier, int index) Adds a new tab at the givenindex
with the content provided lazily from the givenSupplier
(when the tab is selected for the first time).static UiTabPanel
of()
static UiTabPanel
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 Details
-
addTab
Adds the givenUiRegularWidget
as new tab (and the end of all existing tabs).
IMPORTANT: In case youmake
theUiTab
closable
, it will remove itself aschild
from thisUiTabPanel
when the end-user closes it.- Parameters:
text
- the label that will be displayed to identify the tab.child
- thetab content
.- Returns:
- the
UiTab
for this tab.
-
addTab
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
- theSupplier
providing
thetab content
. Allows lazy creation of the child when the tab is selected for the first time.- Returns:
- the
UiTab
for this tab.
-
addTab
Adds the givenUiRegularWidget
as new tab at the givenindex
.- Parameters:
text
- the label that will be displayed to identify the tab.child
- thetab content
.index
- is theindex
where to insert the newUiTab
.- Returns:
- the
UiTab
for this tab.
-
addTab
Adds a new tab at the givenindex
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
- theSupplier
providing
thetab content
. Allows lazy creation of the child when the tab is selected for the first time.index
- is theindex
where to insert the newUiTab
.- Returns:
- the
UiTab
for this tab. It allows to change the title, set tooltip or image (icon), etc.
-
of
- Returns:
- the new
UiTabPanel
.
-
of
- Parameters:
children
- theUiRegularWidget
s to add as children.- Returns:
- the new
UiTabPanel
.
-