Package org.zkoss.stateless.ui
Interface IReplacer<T extends IComponent>
public interface IReplacer<T extends IComponent>
An IComponent replacer to replace the descendant from the root component.
- Author:
- jumperchen
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a new component tree from each replacement.<I extends IComponent<?>>
IReplacer<T>replace(I source, I target) Replaces the given immutable component with a given newIComponentin the descendant of the root.<I extends IComponent<?>>
IReplacer<T>replaceById(String source, CheckedFunction<I, I> targetFunction) Replaces the given source with a given newIComponentin the descendant of the root.replaceById(String source, IComponent<?> target) Replaces the given source with a given newIComponentin the descendant of the root.
-
Method Details
-
replaceById
Replaces the given source with a given newIComponentin the descendant of the root.- Parameters:
source- The source to indicate the replaced sourcetarget- The new component for replacement. If null, it means to remove the replaced source.
-
replaceById
<I extends IComponent<?>> IReplacer<T> replaceById(String source, CheckedFunction<I, I> targetFunction) Replaces the given source with a given newIComponentin the descendant of the root.- Parameters:
source- The source to indicate the replaced sourcetargetFunction- The replacement function by passing the result of the source and returning the new replacement. If null, it means to remove the replaced source.
-
replace
Replaces the given immutable component with a given newIComponentin the descendant of the root.- Parameters:
source- The old component to indicate the replaced sourcetarget- The new component for replacement. If null, it means to remove the replaced source.
-
build
T build()Builds a new component tree from each replacement.
-