org.zkoss.zuti.zul
Class TemplateBasedShadowElement

java.lang.Object
  extended by org.zkoss.zk.ui.AbstractComponent
      extended by org.zkoss.zk.ui.HtmlShadowElement
          extended by org.zkoss.zuti.zul.TemplateBasedShadowElement
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Component, AfterCompose, Scope, ShadowElement, ShadowElementCtrl, ComponentCtrl
Direct Known Subclasses:
Apply, Choose, ForEach, If, Otherwise

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
 
Field Summary
protected  boolean _dirtyBinding
           
static java.lang.String FOREACH_RENDERED_COMPONENTS
          foreach support list model (Component developer use only)
static java.lang.String ON_BINDING_READY
          Component developer use only
static java.lang.String SHADOW_VARIABLE
          Component developer use only
 
Fields inherited from class org.zkoss.zk.ui.HtmlShadowElement
_afterComposed, BIND_ANNO, BINDER, INIT_ANNO, LOAD_ANNO, ON_REBUILD_SHADOW_TREE_LATER, REFERENCE_ANNO, SAVE_ANNO
 
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
CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE
 
Constructor Summary
TemplateBasedShadowElement()
           
 
Method Summary
protected  void addBindingListener()
           
 void afterCompose()
          Creates the distributed children after apply dynamic properties If a shadow element is created by ZK loader, this method is invoked automatically.
 java.lang.Object clone()
          Clones the component.
protected  void compose(Component host)
          Composes the shadow element.
 void detach()
          Removes the relation points between shadow host and this shadow element.
protected  void docheck0()
           
protected  boolean isBindingReady()
          Returns the current phase is in a binding ready state, if any.
 boolean isDynamicValue()
          Returns whether the shadow element contains a dynamic value, it means the shadow element cannot be destroyed after evaluated.
protected  boolean isEffective()
          Returns whether the shadow element is effective
 void onChildAdded(Component child)
          Default: does nothing.
 void onChildRemoved(Component child)
          Default: does nothing.
protected  void rebuildSubShadowTree()
          Rebuilds the shadow tree if the shadow element contains a dynamic value, it should be alive, otherwise, it will be detached.
protected  void removeBindingListener()
           
 
Methods inherited from class org.zkoss.zk.ui.HtmlShadowElement
afterHostChildAdded, afterHostChildRemoved, asShadow, beforeChildAdded, beforeHostChildAdded, beforeHostChildRemoved, beforeHostParentChanged, beforeParentChanged, getDistributedChildren, getFirstInsertion, getLastInsertion, getNextInsertion, getNextInsertionComponentIfAny, getPreviousInsertion, getPreviousInsertionComponentIfAny, getShadowHost, getShadowHostIfAny, inRange, invalidate, isDynamicValue, mergeSubTree, mergeToHost, onHostAttached, onHostChildAdded, onHostChildRemoved, onHostDetached, recreate, resolveVariable, setParent, setPrevInsertion, setShadowHost, shrinkRange, stretchRange, toString, updateSubBindingAnnotationCount
 
Methods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addAnnotation, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildRemoved, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, enableBindingAnnotation, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getChildren, getClientAttribute, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getExtraCtrl, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRedrawCallback, getRoot, getShadowRoots, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttribute, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, insertBefore, isChildable, isInvalidated, isListenerAvailable, isVisible, onPageAttached, onPageDetached, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, renderProperties, replace, response, response, response, service, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setStubonly, setStubonly, setSubBindingAnnotationCount, setTemplate, setVisible, setVisibleDirectly, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, updateByClient, willPassivate, willPassivate, willSerialize, willSerialize
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ON_BINDING_READY

public static java.lang.String ON_BINDING_READY
Component developer use only


SHADOW_VARIABLE

public static java.lang.String SHADOW_VARIABLE
Component developer use only


FOREACH_RENDERED_COMPONENTS

public static final java.lang.String FOREACH_RENDERED_COMPONENTS
foreach support list model (Component developer use only)

See Also:
Constant Field Values

_dirtyBinding

protected boolean _dirtyBinding
Constructor Detail

TemplateBasedShadowElement

public TemplateBasedShadowElement()
Method Detail

onChildRemoved

public void onChildRemoved(Component child)
Description copied from class: AbstractComponent
Default: does nothing.

Specified by:
onChildRemoved in interface ComponentCtrl
Overrides:
onChildRemoved in class AbstractComponent
See Also:
ComponentCtrl.onChildRemoved(org.zkoss.zk.ui.Component)

onChildAdded

public void onChildAdded(Component child)
Description copied from class: AbstractComponent
Default: does nothing.

Specified by:
onChildAdded in interface ComponentCtrl
Overrides:
onChildAdded in class HtmlShadowElement
See Also:
ComponentCtrl.onChildAdded(org.zkoss.zk.ui.Component)

afterCompose

public void afterCompose()
Description copied from class: HtmlShadowElement
Creates the distributed children after apply dynamic properties

If 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.

  1. Check if HtmlShadowElement.isEffective() to be true.
  2. 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 on HtmlShadowElement.compose(org.zkoss.zk.ui.Component) (rather than HtmlShadowElement.afterCompose()).

Specified by:
afterCompose in interface AfterCompose
Overrides:
afterCompose in class HtmlShadowElement

isDynamicValue

public boolean isDynamicValue()
Description copied from interface: ShadowElementCtrl
Returns whether the shadow element contains a dynamic value, it means the shadow element cannot be destroyed after evaluated.

Specified by:
isDynamicValue in interface ShadowElementCtrl
Overrides:
isDynamicValue in class HtmlShadowElement

rebuildSubShadowTree

protected void rebuildSubShadowTree()
Description copied from class: HtmlShadowElement
Rebuilds the shadow tree if the shadow element contains a dynamic value, it should be alive, otherwise, it will be detached.

Overrides:
rebuildSubShadowTree in class HtmlShadowElement

compose

protected void compose(Component host)
Description copied from class: HtmlShadowElement
Composes the shadow element. It is called by HtmlShadowElement.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:
compose in class HtmlShadowElement
Parameters:
host - the shadow host component, never null.

addBindingListener

protected void addBindingListener()

removeBindingListener

protected void removeBindingListener()

detach

public void detach()
Description copied from class: HtmlShadowElement
Removes the relation points between shadow host and this shadow element.

Specified by:
detach in interface Component
Specified by:
detach in interface ShadowElement
Overrides:
detach in class HtmlShadowElement

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 a HtmlShadowElement.recreate() method.


isEffective

protected boolean isEffective()
Description copied from class: HtmlShadowElement
Returns whether the shadow element is effective

Specified by:
isEffective in class HtmlShadowElement

clone

public java.lang.Object clone()
Description copied from interface: Component
Clones the component. All of its children and descendants are cloned. Also, ID are preserved.

Specified by:
clone in interface Component
Overrides:
clone in class HtmlShadowElement
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()


Copyright © 2005-2011 Potix Corporation. All Rights Reserved. SourceForge.net Logo