public interface ShadowElementCtrl
ShadowElement
Modifier and Type | Method and Description |
---|---|
void |
afterHostChildAdded(Component child,
int indexOfChild)
Called when a child is added to the host.
|
void |
afterHostChildRemoved(Component child)
Called when a child is removed to the host.
|
void |
beforeHostChildAdded(Component child,
Component insertBefore,
int indexOfInsertBefore)
Called before the host adding a child.
|
void |
beforeHostChildRemoved(Component child,
int indexOfChild)
Called before the host removing a child.
|
void |
beforeHostParentChanged(Component parent)
Called before the host changing the parent.
|
Component |
getFirstInsertion()
Returns the first component of its insertion range.
|
Component |
getLastInsertion()
Returns the last component of its insertion range.
|
Component |
getNextInsertion()
Returns the next insertion point, it may be a component, a shadow element, or null.
|
Component |
getPreviousInsertion()
Returns the previous insertion point, it may be a component, a shadow element, or null.
|
Component |
getShadowHostIfAny()
Return the shadow host from it or its ancestor, if any.
|
boolean |
isDynamicValue()
Returns whether the shadow element contains a dynamic value, it means the
shadow element cannot be destroyed after evaluated.
|
void |
onHostChildAdded(Component child)
Called when a child of a host is added into this shadow element.
|
void |
onHostChildRemoved(Component child)
Called when a child of a host is added into this shadow element.
|
java.lang.Object |
resolveVariable(Component child,
java.lang.String name,
boolean recurse)
Returns the variable associated with this base component or null if not found.
|
void |
setDynamicValue(boolean dynamicValue)
Sets whether the shadow element contains a dynamic value, if true means the
shadow element cannot be destroyed after evaluated, if false it will detect
its attribute automatically.
|
void |
setShadowHost(Component host,
Component insertBefore)
Sets the owner component that hosts this shadow element.
|
void setShadowHost(Component host, Component insertBefore)
host
- the host of the shadow elementinsertBefore
- a component or a shadow element to indicate where the
shadow's insertion point is added.void beforeHostChildRemoved(Component child, int indexOfChild)
child
- the child to be removed (never null)indexOfChild
- the index of the removed childvoid beforeHostParentChanged(Component parent)
parent
- the new parent. If null, it means detachment.void beforeHostChildAdded(Component child, Component insertBefore, int indexOfInsertBefore)
child
- the child to be added (never null).insertBefore
- another child component that the new child
will be inserted before it. If null, the new child will be the
last child.indexOfInsertBefore
- the index of the insertBefore, if any. Otherwise -1 is assumed.void afterHostChildAdded(Component child, int indexOfChild)
child
- the child has been added (never null).indexOfChild
- the index of the added child.void afterHostChildRemoved(Component child)
child
- the child has been added (never null).boolean isDynamicValue()
void setDynamicValue(boolean dynamicValue)
Default: false (auto detection)
Component getShadowHostIfAny()
java.lang.Object resolveVariable(Component child, java.lang.String name, boolean recurse)
Notice that it doesn't check any variable defined in
VariableResolver
(of Page.addVariableResolver(org.zkoss.xel.VariableResolver)
).
child
- the child component of the shadow hostrecurse
- whether to look up the parent shadow for the
existence of the variable.Component getNextInsertion()
Component getPreviousInsertion()
Component getFirstInsertion()
Component getLastInsertion()
void onHostChildAdded(Component child)
void onHostChildRemoved(Component child)
Copyright © 2005-2023 Potix Corporation. All Rights Reserved.