Interface UiComposite<C extends UiWidget>

Type Parameters:
C - type of the child 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

public interface UiComposite<C extends UiWidget> extends UiWidget
Since:
1.0.0
  • Method Details

    • getChildCount

      int getChildCount()
      Returns:
      the number of direct children contained in this widget.
    • getChild

      C getChild(int index)
      Parameters:
      index - is the index of the requested child. Should be in the range from 0 to getChildCount() - 1.
      Returns:
      the requested child or null if no such child exists.
      See Also:
    • getChildById

      default C getChildById(String id)
      Searches the (first) child (non-recursive) with the given ID.
      Parameters:
      id - the ID of the given child.
      Returns:
      the child having the given ID or null if no such child exists.
    • getChildSibling

      default C getChildSibling(C child, int offset)
      Parameters:
      child - the current child.
      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

      default C getChildSibling(C child, int offset, boolean wrap)
      Parameters:
      child - the current child.
      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 return null 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

      int getChildIndex(C child)
      Parameters:
      child - the child to look for.
      Returns:
      the index of the given child or -1 if no such child exists.
    • getChild

      default C getChild(String id)
      Parameters:
      id - is the ID of the requested child.
      Returns:
      the child with the given id or null if no such child exists.
      See Also:
    • getDescendant

      default UiWidget getDescendant(String id)
      Parameters:
      id - is the ID of the requested child or descendant (recursive child of children).
      Returns:
      the child or descendant (recursive child of children) with the given id or null if no such child exists.
      See Also:
    • getPropagation

      default UiPropagation getPropagation()
      Returns:
      the UiPropagation indicating which properties of this UiComposite are propagated to the children. A composite might be fully virtual and do not have a corresponding native widget. In such case it would return UiPropagation.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 the focus to this widget. In case of a UiComposite 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 interface UiWidget
      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 interface UiWidget
      Returns:
      true if the value has been modified by the end-user via the UI since it has been set programmatically, false otherwise. A modified widget is also called dirty. A UiComposite is modified if one of its children are modified. An immutable widget (e.g. a UiLabel) will always return false here.
      ATTENTION: If the end-user changes value of this widget via the UI then changes it back to its original value it may still remain modified.
    • getModificationTimestamp

      default long getModificationTimestamp()
      Specified by:
      getModificationTimestamp in interface UiWidget
      Returns:
      the timestamp of the last change to this widget. Will be -1 if it not modified.
    • isValid

      default boolean isValid()
      Description copied from interface: UiWidget
      A UiComposite is only valid if all its children are valid (recursive check). An atomic widget that does not implement UiValidatableWidget will always return true here.
      Specified by:
      isValid in interface AttributeReadValid
      Specified by:
      isValid in interface UiWidget
      Returns:
      true if valid (no validation failure is present), false otherwise.
      See Also:
    • reset

      default void reset()
      Description copied from interface: UiWidget
      Resets this widget recursively including its potential children to its original state. UiValidatableWidgets will retain their original value. Further, modified flags are reset so all involved widgets will not be modified after calling this method.
      Specified by:
      reset in interface UiWidget