Package org.zkoss.zuti.zul
Class TemplateBasedShadowElement
- java.lang.Object
-
- org.zkoss.zk.ui.AbstractComponent
-
- org.zkoss.zk.ui.HtmlShadowElement
-
- org.zkoss.zuti.zul.TemplateBasedShadowElement
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,Component,AfterCompose,Scope,ShadowElement,ShadowElementCtrl,ComponentCtrl
public abstract class TemplateBasedShadowElement extends HtmlShadowElement
A template based skeleton class- Since:
- 8.0.0
- Author:
- jumperchen
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlShadowElement
HtmlShadowElement.Direction
-
Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent
AbstractComponent.Children, AbstractComponent.ForwardInfo, AbstractComponent.TargetInfo
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean_dirtyBindingstatic java.lang.StringON_BINDING_READYComponent developer use onlystatic java.lang.StringSHADOW_VARIABLEComponent developer use only-
Fields inherited from class org.zkoss.zk.ui.HtmlShadowElement
_afterComposed, _dynamicValue, BIND_ANNO, BINDER, INIT_ANNO, LOAD_ANNO, ON_REBUILD_SHADOW_TREE_LATER, REFERENCE_ANNO, SAVE_ANNO, SKIP_DISTRIBUTED_CHILDREN_PROPERTY_CHANGE
-
Fields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
-
Fields inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl
AFTER_CHILD_ADDED, AFTER_CHILD_REMOVED, AFTER_PAGE_ATTACHED, AFTER_PAGE_DETACHED, AFTER_PARENT_CHANGED, CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE
-
-
Constructor Summary
Constructors Constructor Description TemplateBasedShadowElement()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddBindingListener()voidafterCompose()Creates the distributed children after apply dynamic propertiesjava.lang.Objectclone()Clones the component.protected voidcompose(Component host)Composes the shadow element.voiddetach()Removes the relation points between shadow host and this shadow element.protected voiddocheck0()protected booleanisBindingReady()Returns the current phase is in a binding ready state, if any.booleanisDirtyBinding()Internal used onlybooleanisDynamicValue()Returns whether the shadow element contains a dynamic value, it means the shadow element cannot be destroyed after evaluated.protected booleanisEffective()Returns whether the shadow element is effectivevoidonChildAdded(Component child)Default: handles special event listeners.voidonChildRemoved(Component child)Default: handles special event listeners.protected voidrebuildSubShadowTree()Rebuilds the shadow tree if the shadow element contains a dynamic value, it should be alive, otherwise, it will be detached.protected voidremoveBindingListener()-
Methods inherited from class org.zkoss.zk.ui.HtmlShadowElement
afterHostChildAdded, afterHostChildRemoved, asShadow, beforeChildAdded, beforeHostChildAdded, beforeHostChildRemoved, beforeHostParentChanged, beforeParentChanged, clearChildren, destroyIndexCacheMap, getDistributedChildren, getFirstInsertion, getIndex, getIndexCacheMap, getLastInsertion, getNextInsertion, getNextInsertionComponentIfAny, getPreviousInsertion, getPreviousInsertionComponentIfAny, getShadowHost, getShadowHostIfAny, initClone, initIndexCacheMap, inRange, invalidate, isDynamicValue, mergeSubTree, mergeToHost, onHostAttached, onHostChildAdded, onHostChildRemoved, onHostDetached, recreate, removeFromParent, resolveVariable, setDynamicValue, setParent, setPrevInsertion, setShadowHost, shrinkRange, stretchRange, toString, updateFirstInsertion, updateLastInsertion, updateNextInsertion, updatePreviousInsertion, updateSubBindingAnnotationCount
-
Methods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildRemoved, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, disableHostChanged, enableBindingAnnotation, enableHostChanged, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getCallback, getChildren, getClientAttribute, getClientDataAttribute, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getExtraCtrl, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getForwards, getId, getLastChild, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getPropertyAccess, getRedrawCallback, getRoot, getShadowFellowIfAny, getShadowRoots, getShadowVariable, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, insertBefore, isChildable, isDisabledHostChanged, isInitialized, isInvalidated, isListenerAvailable, isVisible, onPageAttached, onPageDetached, onParentChanged, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, renderProperties, renderPropertiesOnly, replace, response, response, response, service, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setStubonly, setStubonly, setSubBindingAnnotationCount, setTemplate, setVisible, setVisibleDirectly, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, updateByClient, willPassivate, willPassivate, willSerialize, willSerialize
-
-
-
-
Method Detail
-
onChildRemoved
public void onChildRemoved(Component child)
Description copied from class:AbstractComponentDefault: handles special event listeners.- Specified by:
onChildRemovedin interfaceComponentCtrl- Overrides:
onChildRemovedin classAbstractComponent- See Also:
ComponentCtrl.onChildRemoved(org.zkoss.zk.ui.Component)
-
onChildAdded
public void onChildAdded(Component child)
Description copied from class:AbstractComponentDefault: handles special event listeners.- Specified by:
onChildAddedin interfaceComponentCtrl- Overrides:
onChildAddedin classHtmlShadowElement- See Also:
ComponentCtrl.onChildAdded(org.zkoss.zk.ui.Component)
-
afterCompose
public void afterCompose()
Description copied from class:HtmlShadowElementCreates the distributed children after apply dynamic propertiesIf a shadow element is created by ZK loader, this method is invoked automatically. Developers rarely need to invoke this method.
Default: it invokes
HtmlShadowElement.compose(org.zkoss.zk.ui.Component)to compose the shadow element.The method will invoke the following methods in order.
- Check if
HtmlShadowElement.isEffective()to be true. - If true, invokes
HtmlShadowElement.compose(org.zkoss.zk.ui.Component)method to create the distributed children, otherwise, nothing happened.
Instead of overriding this method, it is suggested to override
HtmlShadowElement.compose(org.zkoss.zk.ui.Component), since all other methods depend onHtmlShadowElement.compose(org.zkoss.zk.ui.Component)(rather thanHtmlShadowElement.afterCompose()).- Specified by:
afterComposein interfaceAfterCompose- Overrides:
afterComposein classHtmlShadowElement
- Check if
-
isDynamicValue
public boolean isDynamicValue()
Description copied from interface:ShadowElementCtrlReturns whether the shadow element contains a dynamic value, it means the shadow element cannot be destroyed after evaluated.- Specified by:
isDynamicValuein interfaceShadowElementCtrl- Overrides:
isDynamicValuein classHtmlShadowElement
-
rebuildSubShadowTree
protected void rebuildSubShadowTree()
Description copied from class:HtmlShadowElementRebuilds the shadow tree if the shadow element contains a dynamic value, it should be alive, otherwise, it will be detached.- Overrides:
rebuildSubShadowTreein classHtmlShadowElement
-
compose
protected void compose(Component host)
Description copied from class:HtmlShadowElementComposes the shadow element. It is called byHtmlShadowElement.afterCompose()if the shadow host is not null. Otherwise, it will skip this method call.The second invocation is ignored. If you want to recreate child components, use
HtmlShadowElement.recreate()instead.- Specified by:
composein classHtmlShadowElement- Parameters:
host- the shadow host component, never null.
-
addBindingListener
protected void addBindingListener()
-
removeBindingListener
protected void removeBindingListener()
-
detach
public void detach()
Description copied from class:HtmlShadowElementRemoves the relation points between shadow host and this shadow element.- Specified by:
detachin interfaceComponent- Specified by:
detachin interfaceShadowElement- Overrides:
detachin classHtmlShadowElement
-
isBindingReady
protected boolean isBindingReady()
Returns the current phase is in a binding ready state, if any. It is used for sub-class to check the state in aHtmlShadowElement.recreate()method.
-
isEffective
protected boolean isEffective()
Description copied from class:HtmlShadowElementReturns whether the shadow element is effective- Specified by:
isEffectivein classHtmlShadowElement
-
clone
public java.lang.Object clone()
Description copied from interface:ComponentClones the component. All of its children and descendants are cloned. Also, ID are preserved.- Specified by:
clonein interfaceComponent- Overrides:
clonein classHtmlShadowElement- Returns:
- the new component. Notice that it doesn't belong to any page, nor desktop. It doesn't have a parent, either.
-
docheck0
protected void docheck0()
-
isDirtyBinding
public boolean isDirtyBinding()
Internal used only
-
-