Package org.zkoss.zhtml.impl
Class PageRenderer
java.lang.Object
org.zkoss.zhtml.impl.PageRenderer
- All Implemented Interfaces:
org.zkoss.zk.ui.sys.PageRenderer
The page render for ZHTML pages.
- Since:
- 5.0.0
- Author:
- tomyeh
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidafterRenderHtml(org.zkoss.zk.ui.Execution exec, org.zkoss.zk.ui.Page page, Writer out, Object param) Ends and cleans up the rendering of a complete ZHTML page.static voidafterRenderTag(org.zkoss.zk.ui.Execution exec, Object param) Ends and cleans up the rendering of a ZHTML tag.static ObjectbeforeRenderHtml(org.zkoss.zk.ui.Execution exec, org.zkoss.zk.ui.Page page, Writer out) Prepares for rendering a complete ZHTML page.static ObjectbeforeRenderTag(org.zkoss.zk.ui.Execution exec) Prepares for rendering a ZHTML tag.static StringchildrenToContent(org.zkoss.zk.ui.Component comp) Converts the children of the give component into a string-typed content, or null if no children at all.static TagRenderContextgetTagRenderContext(org.zkoss.zk.ui.Execution exec) Returns the render context, or null if not available.voidprotected voidrenderComplete(org.zkoss.zk.ui.Execution exec, org.zkoss.zk.ui.Page page, Writer out) Renders the page ifPage.isComplete()is true.protected voidrenderPage(org.zkoss.zk.ui.Execution exec, org.zkoss.zk.ui.Page page, Writer out, boolean au) Renders the page ifPage.isComplete()is false.
-
Constructor Details
-
PageRenderer
public PageRenderer()
-
-
Method Details
-
getTagRenderContext
Returns the render context, or null if not available. The render context is available only if the ZHTML page is rendered directly (rather than via inclusion).- Parameters:
exec- the execution. If null, Executions.getCurrent() is assumed.
-
render
- Specified by:
renderin interfaceorg.zkoss.zk.ui.sys.PageRenderer- Throws:
IOException
-
renderPage
protected void renderPage(org.zkoss.zk.ui.Execution exec, org.zkoss.zk.ui.Page page, Writer out, boolean au) throws IOException Renders the page ifPage.isComplete()is false.- Parameters:
au- whether it is caused by an asynchronous update- Throws:
IOException
-
renderComplete
protected void renderComplete(org.zkoss.zk.ui.Execution exec, org.zkoss.zk.ui.Page page, Writer out) throws IOException Renders the page ifPage.isComplete()is true. In other words, the page content contains HTML/BODY tags.- Throws:
IOException
-
beforeRenderHtml
public static Object beforeRenderHtml(org.zkoss.zk.ui.Execution exec, org.zkoss.zk.ui.Page page, Writer out) throws IOException Prepares for rendering a complete ZHTML page. After rendering, the caller shall also invokeafterRenderHtml(org.zkoss.zk.ui.Execution, org.zkoss.zk.ui.Page, java.io.Writer, java.lang.Object). Furthermore, the return value of this method shall be passed as theparamargument ofafterRenderHtml(org.zkoss.zk.ui.Execution, org.zkoss.zk.ui.Page, java.io.Writer, java.lang.Object). -
afterRenderHtml
public static void afterRenderHtml(org.zkoss.zk.ui.Execution exec, org.zkoss.zk.ui.Page page, Writer out, Object param) throws IOException Ends and cleans up the rendering of a complete ZHTML page.- Parameters:
param- the value returned bybeforeRenderHtml(org.zkoss.zk.ui.Execution, org.zkoss.zk.ui.Page, java.io.Writer).- Throws:
IOException- See Also:
-
beforeRenderTag
Prepares for rendering a ZHTML tag. After rendering, the caller shall also invokeafterRenderTag(org.zkoss.zk.ui.Execution, java.lang.Object). Furthermore, the return value of this method shall be passed as theparamargument ofafterRenderTag(org.zkoss.zk.ui.Execution, java.lang.Object).- Returns:
- the result of this invocation. It shall be passed to the
paramargument ofafterRenderTag(org.zkoss.zk.ui.Execution, java.lang.Object). - See Also:
-
afterRenderTag
Ends and cleans up the rendering of a ZHTML tag.- Parameters:
param- the value returned bybeforeRenderHtml(org.zkoss.zk.ui.Execution, org.zkoss.zk.ui.Page, java.io.Writer).
-
childrenToContent
Converts the children of the give component into a string-typed content, or null if no children at all.- Throws:
org.zkoss.zk.ui.UiException- if some of the children is not ZHTML tags (i.e., notAbstractTag).- Since:
- 5.0.7
-