org.zkoss.zhtml.impl
Class PageRenderer

java.lang.Object
  extended by org.zkoss.zhtml.impl.PageRenderer
All Implemented Interfaces:
org.zkoss.zk.ui.sys.PageRenderer

public class PageRenderer
extends Object
implements org.zkoss.zk.ui.sys.PageRenderer

The page render for ZHTML pages.

Since:
5.0.0
Author:
tomyeh

Constructor Summary
PageRenderer()
           
 
Method Summary
static void afterRenderHtml(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 void afterRenderTag(org.zkoss.zk.ui.Execution exec, Object param)
          Ends and cleans up the rendering of a ZHTML tag.
static Object beforeRenderHtml(org.zkoss.zk.ui.Execution exec, org.zkoss.zk.ui.Page page, Writer out)
          Prepares for rendering a complete ZHTML page.
static Object beforeRenderTag(org.zkoss.zk.ui.Execution exec)
          Prepares for rendering a ZHTML tag.
static String childrenToContent(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 TagRenderContext getTagRenderContext(org.zkoss.zk.ui.Execution exec)
          Returns the render context, or null if not available.
 void render(org.zkoss.zk.ui.Page page, Writer out)
           
protected  void renderComplete(org.zkoss.zk.ui.Execution exec, org.zkoss.zk.ui.Page page, Writer out)
          Renders the page if Page.isComplete() is true.
protected  void renderPage(org.zkoss.zk.ui.Execution exec, org.zkoss.zk.ui.Page page, Writer out, boolean au)
          Renders the page if Page.isComplete() is false.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageRenderer

public PageRenderer()
Method Detail

getTagRenderContext

public static TagRenderContext getTagRenderContext(org.zkoss.zk.ui.Execution exec)
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

public void render(org.zkoss.zk.ui.Page page,
                   Writer out)
            throws IOException
Specified by:
render in interface org.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 if Page.isComplete() is false.

Parameters:
au - whether it is caued 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 if Page.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 invoke afterRenderHtml(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 the param argument of afterRenderHtml(org.zkoss.zk.ui.Execution, org.zkoss.zk.ui.Page, java.io.Writer, java.lang.Object).

Throws:
IOException
See Also:
afterRenderHtml(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 by beforeRenderHtml(org.zkoss.zk.ui.Execution, org.zkoss.zk.ui.Page, java.io.Writer).
Throws:
IOException
See Also:
beforeRenderHtml(org.zkoss.zk.ui.Execution, org.zkoss.zk.ui.Page, java.io.Writer)

beforeRenderTag

public static Object beforeRenderTag(org.zkoss.zk.ui.Execution exec)
Prepares for rendering a ZHTML tag. After rendering, the caller shall also invoke afterRenderTag(org.zkoss.zk.ui.Execution, java.lang.Object). Furthermore, the return value of this method shall be passed as the param argument of afterRenderTag(org.zkoss.zk.ui.Execution, java.lang.Object).

Returns:
the result of this invocation. It shall be passed to the param argument of afterRenderTag(org.zkoss.zk.ui.Execution, java.lang.Object).
See Also:
afterRenderTag(org.zkoss.zk.ui.Execution, java.lang.Object)

afterRenderTag

public static void afterRenderTag(org.zkoss.zk.ui.Execution exec,
                                  Object param)
Ends and cleans up the rendering of a ZHTML tag.

Parameters:
param - the value returned by beforeRenderHtml(org.zkoss.zk.ui.Execution, org.zkoss.zk.ui.Page, java.io.Writer).

childrenToContent

public static String childrenToContent(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.

Throws:
org.zkoss.zk.ui.UiException - if some of the children is not ZHTML tags (i.e., not AbstractTag).
Since:
5.0.7


Copyright © 2012. All Rights Reserved.