org.zkoss.jsf.zul.impl
Class RootComponent

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by org.zkoss.jsf.zul.impl.AbstractComponent
              extended by org.zkoss.jsf.zul.impl.RootComponent
All Implemented Interfaces:
javax.faces.component.StateHolder
Direct Known Subclasses:
Page

public class RootComponent
extends AbstractComponent

A skeletal class to implement the root ZK Component. Currently, only the page component (Page) extends from this class.

Author:
Dennis.Chen

Field Summary
 
Fields inherited from class javax.faces.component.UIComponent
bindings
 
Constructor Summary
protected RootComponent()
          protected Constructor.
 
Method Summary
 void encodeBegin(javax.faces.context.FacesContext context)
           
 void encodeEnd(javax.faces.context.FacesContext context)
          Override Method, When encodeEnd in RootComponent, all it's children ZULJSF Component has encoded, then we start initial the ZK environment, and initial ZUL component by calling AbstractComponent.loadZULTree(org.zkoss.zk.ui.Page, java.io.StringWriter) of each children under RootComponent.
protected  org.zkoss.jsf.zul.impl.ComponentInfo getComponentInfo()
          Get ComponentInfo for current Component Tree.
 java.lang.String getZScriptLanguage()
          Returns the default scripting language.
protected  void init(org.zkoss.zk.ui.Execution exec, org.zkoss.zk.ui.Page page)
          Initializes the page.
 void processZScript(org.zkoss.zk.ui.Component parent, org.zkoss.zk.ui.metainfo.ZScript zs)
          RootComponent was supposed to handle all children's ZScript.
 void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
          Override Method, restore the state of this component.
 java.lang.Object saveState(javax.faces.context.FacesContext context)
          Override Method, save the state of this component.
 void setZscriptLanguage(java.lang.String lang)
          Sets the default scripting language in this RootComponent.
 void setZScriptLanguage(java.lang.String lang)
          Sets the default scripting language in this RootComponent.
 
Methods inherited from class org.zkoss.jsf.zul.impl.AbstractComponent
findAncestorWithClass, getBodyContent, getFacesContext, getFamily, getIf, getUnless, isEffective, isSuppressed, loadZULTree, restoreAttachedMapState, saveAttachedMapState, setBodyContent, setIf, setSuppressed, setUnless
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeChildren, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
 
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RootComponent

protected RootComponent()
protected Constructor. Construct a RootTag with LanguageDefinition = "xul/html".

Method Detail

getZScriptLanguage

public java.lang.String getZScriptLanguage()
Returns the default scripting language.


setZScriptLanguage

public void setZScriptLanguage(java.lang.String lang)
Sets the default scripting language in this RootComponent.

Default: Java.

Parameters:
lang - the name of the scripting language, such as Java, Ruby and Groovy.

setZscriptLanguage

public void setZscriptLanguage(java.lang.String lang)
Sets the default scripting language in this RootComponent. It is the same as setZScriptLanguage(java.lang.String) (used to simplify the typing in JSF page).


getComponentInfo

protected org.zkoss.jsf.zul.impl.ComponentInfo getComponentInfo()
Get ComponentInfo for current Component Tree.
it check a existed instance and return it, if not, a new instance will be created and return.

Overrides:
getComponentInfo in class AbstractComponent
Returns:
a ComponentInfo of current Component Tree

init

protected void init(org.zkoss.zk.ui.Execution exec,
                    org.zkoss.zk.ui.Page page)
Initializes the page. It is called after the ZUL Page is created, and before any ZUL Component is created.

Default: does nothing

Parameters:
exec - the execution. Note: when this method is called, the execution is not activated. For example, Executions.getCurrent() returns null.
page - the page

processZScript

public void processZScript(org.zkoss.zk.ui.Component parent,
                           org.zkoss.zk.ui.metainfo.ZScript zs)
                    throws java.io.IOException
RootComponent was supposed to handle all children's ZScript.

Parameters:
parent - The owner of zscript segment.
zs - A ZScript object.
Throws:
java.io.IOException

encodeBegin

public void encodeBegin(javax.faces.context.FacesContext context)
                 throws java.io.IOException
Overrides:
encodeBegin in class javax.faces.component.UIComponentBase
Throws:
java.io.IOException

encodeEnd

public void encodeEnd(javax.faces.context.FacesContext context)
               throws java.io.IOException
Override Method, When encodeEnd in RootComponent, all it's children ZULJSF Component has encoded, then we start initial the ZK environment, and initial ZUL component by calling AbstractComponent.loadZULTree(org.zkoss.zk.ui.Page, java.io.StringWriter) of each children under RootComponent.

Overrides:
encodeEnd in class javax.faces.component.UIComponentBase
Throws:
java.io.IOException

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext context)
Override Method, save the state of this component.

Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class AbstractComponent

restoreState

public void restoreState(javax.faces.context.FacesContext context,
                         java.lang.Object state)
Override Method, restore the state of this component.

Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class AbstractComponent


Copyright © 2005-2007 Potix Corporation. All Rights Reserved.