Module io.github.mmm.ui.api.core
Interface UiComposite<C extends UiWidget>
- Type Parameters:
C
- type of thechild widgets
.
- All Superinterfaces:
AttributeReadAttached
,AttributeReadEnabled
,AttributeReadId
,AttributeReadValid
,AttributeReadVisible
,AttributeWriteEnabled
,AttributeWriteId
,AttributeWriteReadOnly
,AttributeWriteTooltip
,AttributeWriteVisible
,EventSource<UiEvent,
,UiEventListener> UiWidget
- All Known Subinterfaces:
UiAbstractButtonContainer
,UiAbstractSplitPanel
,UiBorderPanel
,UiButtonPanel
,UiCollapsibleComposite<C>
,UiCollapsiblePanel
,UiFailureComposite<C>
,UiGridPanel
,UiGridRow
,UiHorizontalPanel
,UiHorizontalSplitPanel
,UiInputContainer<V>
,UiMutableComposite<C>
,UiMutablePanel
,UiMutableSingleComposite<C>
,UiRemovableComposite<C>
,UiResponsiveColumnPanel
,UiScrollPanel
,UiSingleComposite<C>
,UiSlot
,UiSwitchComposite<C>
,UiValuedComposite<C,
,V> UiVerticalPanel
,UiVerticalSplitPanel
- All Known Implementing Classes:
UiCustomComposite
,UiCustomEditorButtonPanel
,UiCustomGridPanel
,UiCustomMutableComposite
,UiCustomMutablePanel
,UiCustomMutableSingleComposite
,UiCustomRemovableComposite
,UiCustomScrollPanel
,UiCustomValuedComposite
,UiCustomVerticalPanel
UiWidget
that is composed out of child widgets
.- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptiongetChild
(int index) default C
default C
getChildById
(String id) int
int
getChildIndex
(C child) default C
getChildSibling
(C child, int offset) default C
getChildSibling
(C child, int offset, boolean wrap) default UiWidget
getDescendant
(String id) default long
default UiPropagation
default boolean
default boolean
isValid()
AUiComposite
is only valid if all its children are valid (recursive check).default void
reset()
Resets this widget recursively including its potentialchildren
to its original state.default boolean
This method sets thefocus
to this widget.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.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
-
getChildCount
int getChildCount()- Returns:
- the number of direct children contained in this widget.
-
getChild
- Parameters:
index
- is the index of the requested child. Should be in the range from0
to
.getChildCount()
- 1- Returns:
- the requested child or
null
if no such child exists. - See Also:
-
getChildById
-
getChildSibling
- Parameters:
child
- the currentchild
.offset
- the sibling offset - e.g.1
will get next sibling and-1
will get previous sibling.- Returns:
- the requested child sibling or
null
if no such child exists.
-
getChildSibling
- Parameters:
child
- the currentchild
.offset
- the sibling offset - e.g.1
will get next sibling and-1
will get previous sibling.wrap
- -true
to wrap in the list of children (jump from the last to the first and vice versa),false
otherwise (to returnnull
if the end or the start of the children has been exceeded).- Returns:
- the requested child sibling or
null
if no such child exists.
-
getChildIndex
-
getChild
-
getDescendant
-
getPropagation
- Returns:
- the
UiPropagation
indicating which properties of thisUiComposite
are propagated to thechildren
. A composite might be fully virtual and do not have a corresponding native widget. In such case it would returnUiPropagation.VISIBLE_AND_ENABLED
and if it get hidden or disabled, it has to propagate such state changes to their children.
-
setFocused
default boolean setFocused()Description copied from interface:UiWidget
This method sets thefocus
to this widget. In case of aUiComposite
it will set the focus to the first child capable of taking the focus.
NOTE:
You can only set the focus. To actually remove it, you need to set it in a different widget.- Specified by:
setFocused
in interfaceUiWidget
- Returns:
true
if the focus has been set successfully,false
otherwise. You can normally ignore the result. It is only relevant for composite widgets such as panels, that delegate the call recursively and may not contain any child that can take the focus.
-
isModified
default boolean isModified()- Specified by:
isModified
in interfaceUiWidget
- Returns:
true
if the value has been modified by the end-user via the UI since it has beenset programmatically
,false
otherwise. A modified widget is also called dirty. AUiComposite
is modified if one of itschildren
are modified. An immutable widget (e.g. aUiLabel
) will always returnfalse
here.
ATTENTION: If the end-user changes value of this widget via the UI then changes it back to itsoriginal value
it may still remainmodified
.
-
getModificationTimestamp
default long getModificationTimestamp()- Specified by:
getModificationTimestamp
in interfaceUiWidget
- Returns:
- the timestamp of the last change to this widget. Will be
-1
if it notmodified
.
-
isValid
default boolean isValid()Description copied from interface:UiWidget
AUiComposite
is only valid if all its children are valid (recursive check). An atomic widget that does not implementUiValidatableWidget
will always returntrue
here.- Specified by:
isValid
in interfaceAttributeReadValid
- Specified by:
isValid
in interfaceUiWidget
- Returns:
true
if valid (novalidation failure
is present),false
otherwise.- See Also:
-
reset
default void reset()Description copied from interface:UiWidget
Resets this widget recursively including its potentialchildren
to its original state.UiValidatableWidget
s will retain theiroriginal value
. Further,modified flags
are reset so all involved widgets will not bemodified
after calling this method.
-