Package org.zkoss.stateless.ui
Interface UiAgent
public interface UiAgent
Utilities to manipulate
IComponent to the client.
Note: All the operational APIs for IComponent must be run in an asynchronous update phase.
(aka. Execution.isAsyncUpdate(Page) will be true)
- Author:
- jumperchen
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumInsert Adjacent position forinsertAdjacentComponent(Locator, Position, IComponent) -
Method Summary
Modifier and TypeMethodDescription<I extends IComponent>
UiAgentappendChild(Locator locator, I newChild) Adds the specified child component as the last child to the current locator.static UiAgentReturns the current UiAgent if any.<I extends IComponent>
UiAgentinsertAdjacentComponent(Locator locator, UiAgent.Position position, I newChild) Inserts a given newChild at a givenUiAgent.Positionrelative to the locator component it is invoked upon.<I extends IComponent>
UiAgentinsertAfterBegin(Locator locator, I newChild) Inserts a given newChild just inside the locator before its first child.<I extends IComponent>
UiAgentinsertAfterEnd(Locator locator, I newChild) Inserts a given newChild after the locator itself.<I extends IComponent>
UiAgentinsertBefore(Locator locator, I newChild, int childIndex) Inserts the given newChild just inside the locator, before its n-th child.<I extends IComponent>
UiAgentinsertBeforeBegin(Locator locator, I newChild) Inserts a given newChild before the locator itself.<I extends IComponent>
UiAgentinsertBeforeEnd(Locator locator, I newChild) Inserts a given newChild just inside the locator after its last child.booleanReturns whether this execution of UiAgent is activated.static UiAgentof(org.zkoss.zk.ui.Execution execution) Returns a new UiAgent from the given execution, which is activated.ofAsync()Returns a new CompletableFuture that is asynchronously completed by retrieving a newUiAgentinstance in a CompletableFuture.Removes the given locator component.<I extends IComponent>
UiAgentreplaceChild(Locator locator, I newChild, int childIndex) Replaces the given newChild just inside the locator with its n-th child.<I extends IComponent>
UiAgentreplaceChildren(Locator locator) Removes the existing children of the given locator component.<I extends IComponent>
UiAgentreplaceChildren(Locator locator, I... children) Replaces the existing children of the given locator component with a specified new set of childrenIComponents.<I extends IComponent>
UiAgentreplaceChildren(Locator locator, List<I> children) Replaces the existing children of the given locator component with a specified new set of childrenIComponents.<I extends IComponent>
UiAgentreplaceWith(Locator locator, I newComp) Replaces the given locator component in the children list of its parent with a given newIComponent.runAsync(CheckedConsumer<UiAgent> consumer) Runs the given callback that is asynchronously completed by retrieving a newUiAgentinstance in a CompletableFuture.smartUpdate(Locator locator, SmartUpdater updater) A special smart update to update all the new data in the given updater.
-
Method Details
-
appendChild
Adds the specified child component as the last child to the current locator. -
insertBefore
Inserts the given newChild just inside the locator, before its n-th child. -
replaceChild
Replaces the given newChild just inside the locator with its n-th child. -
replaceWith
Replaces the given locator component in the children list of its parent with a given newIComponent. -
replaceChildren
Removes the existing children of the given locator component. -
replaceChildren
Replaces the existing children of the given locator component with a specified new set of childrenIComponents. -
replaceChildren
Replaces the existing children of the given locator component with a specified new set of childrenIComponents. -
insertAdjacentComponent
<I extends IComponent> UiAgent insertAdjacentComponent(Locator locator, UiAgent.Position position, I newChild) Inserts a given newChild at a givenUiAgent.Positionrelative to the locator component it is invoked upon. -
insertBeforeBegin
Inserts a given newChild before the locator itself. -
insertBeforeEnd
Inserts a given newChild just inside the locator after its last child. The same asappendChild(Locator, IComponent). -
insertAfterBegin
Inserts a given newChild just inside the locator before its first child. -
insertAfterEnd
Inserts a given newChild after the locator itself. -
smartUpdate
A special smart update to update all the new data in the given updater. -
remove
Removes the given locator component.- Parameters:
locator-
-
isActivated
boolean isActivated()Returns whether this execution of UiAgent is activated.- Returns:
-
runAsync
Runs the given callback that is asynchronously completed by retrieving a newUiAgentinstance in a CompletableFuture.Note: this doesn't support in cloud mode
-
ofAsync
CompletableFuture<UiAgent> ofAsync()Returns a new CompletableFuture that is asynchronously completed by retrieving a newUiAgentinstance in a CompletableFuture.Note: this doesn't support in cloud mode
-
of
Returns a new UiAgent from the given execution, which is activated. -
getCurrent
Returns the current UiAgent if any.
-