T
- the type of the component which implements the interfacepublic interface HasOrderedComponents<T extends Component> extends HasComponents
Modifier and Type | Method and Description |
---|---|
Stream<Component> |
getChildren()
Gets the child components of this component.
|
default Component |
getComponentAt(int index)
Returns the component at the given position.
|
default int |
getComponentCount()
Gets the number of children components.
|
default int |
indexOf(Component component)
Returns the index of the given component.
|
default void |
replace(Component oldComponent,
Component newComponent)
Replaces the component in the container with another one without changing
position.
|
add, add, addComponentAsFirst, addComponentAtIndex, remove, removeAll
isEnabled, setEnabled
getElement
default void replace(Component oldComponent, Component newComponent)
oldComponent
- the old component that will be replaced. Can be
null
, which will make the newComponent to be
added to the layout without replacing any othernewComponent
- the new component to be replaced. Can be null
,
which will make the oldComponent to be removed from the layout
without adding any otherdefault int indexOf(Component component)
component
- the component to look up, can not be null
default int getComponentCount()
default Component getComponentAt(int index)
index
- the position of the component, must be greater than or equals
to 0 and less than the number of children componentsIllegalArgumentException
- if the index is less than 0 or greater than or equals to the
number of children componentsgetComponentCount()
Stream<Component> getChildren()
Component.getChildren()
Copyright © 2020. All rights reserved.