Class StatefulElement
- Since:
- 6.2.0
- Version:
- 1.0.0
- Author:
- UltiTools Team
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.ultikits.ultitools.abstracts.gui.declarative.core.ComponentElement
getChildren, performRebuildMethods inherited from class com.ultikits.ultitools.abstracts.gui.declarative.core.Element
addChild, assignContext, canUpdate, clearDirty, getContext, getParent, getWidget, isDirty, isMounted, markChildNeedsBuild, markNeedsBuild, setRootBuildScheduler, toString, updateChild, updateChildren
-
Field Details
-
_state
-
-
Constructor Details
-
StatefulElement
-
-
Method Details
-
mount
Description copied from class:ElementMounts this Element into the tree.Called the first time the Element is inserted into the tree. Subclasses should perform initialization work here and mount their child Elements.
CR-01 (T-05-62 / #371): every
mount(Element)override in this codebase callssuper.mount(parent)before doing its own work (mounting children, running the firstperformRebuild(), etc.) -- this base method is therefore the single choke point through which the ENTIRE mounting recursion passes, one call per Element, regardless of subtype:ContainerElement/GridViewElement.mountChildren()mounting each child throughupdateChildren()andupdateChild(), and themount()->performRebuild()->updateChild()->mount()cascadeStatelessElement/StatefulElementdrive when composing a child Widget for the first time. Checking the depth HERE, rather than separately in every subclass's own mounting method, guards the mount recursion exactly once per node without needing to duplicate the check at each override.update()/unmount()'s own recursions need no separate guard: they only ever walk a subtree whose depth was already validated here when it was first mounted, so they can never exceedRenderDepthGuard.MAX_DEPTHwithout first passing through an unguardedmount()call -- which this check closes.- Overrides:
mountin classComponentElement- Parameters:
parent- the parent Element, or null if this is the root Element
-
update
Description copied from class:ElementUpdates this Element with a new Widget.Called when the Widget rebuilds. Subclasses should update their reference to the Widget and perform any necessary updates.
-
unmount
public void unmount()Description copied from class:ElementRemoves this Element from the tree.Called when the Element is no longer needed. Subclasses should perform cleanup work here and unmount their child Elements.
- Overrides:
unmountin classComponentElement
-
getState
-
build
Description copied from class:ComponentElementBuilds the child Widget.- Specified by:
buildin classComponentElement- Returns:
- the child Widget
-