-
- 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 ofchildren
but only shows one of them at a time. It shows a tab bar (typically at the top as a header) with thelabels
of itschildren
. The user can click on one of these tabs in order to see the actualcontent
of 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 youmake
theUiTab
closable
, it will remove itself aschild
from thisUiTabPanel
when 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 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.UiTab
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).UiTab
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
of(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 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
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
- 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
UiTab addTab(String text, UiRegularWidget child, int index)
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
UiTab 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).- 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
static UiTabPanel of()
- Returns:
- the new
UiTabPanel
.
-
of
static UiTabPanel of(UiTab... children)
- Parameters:
children
- theUiRegularWidget
s to add as children.- Returns:
- the new
UiTabPanel
.
-
-