org.zkoss.zk.ui.sys
Interface PageCtrl

All Known Implementing Classes:
AbstractPage, PageImpl

public interface PageCtrl

Addition interface to Page for implementation purpose.

Application developers shall never access any of this methods.

Author:
tomyeh

Field Summary
static java.lang.String ATTR_REDRAW_BY_INCLUDE
          Deprecated. As of release 5.0.0, replaced with Attributes.PAGE_REDRAW_CONTROL.
 
Method Summary
 void addDeferredZScript(Component parent, ZScript zscript)
          Adds a deferred zscript.
 void destroy()
          Called when this page is about to be detroyed.
 java.lang.Boolean getAutomaticTimeout()
          Returns whether to automatically redirect to the timeout URI.
 java.lang.Boolean getCacheable()
          Returns if the client can cache the rendered result, or null to use the device default.
 java.lang.String getContentType()
          Returns the content type, or null to use the device default.
 Component getDefaultParent()
          Deprecated. As of release 5.0.0, it is removed to simplify ZK.
 java.lang.String getDocType()
          Returns the doc type (<!
 java.lang.String getFirstLine()
          Returns the first line to be generated to the output, or null if nothing to generate.
 java.lang.String getHeaders()
          Returns all content that will be generated inside the header element (never null).
 java.lang.String getHeaders(boolean before)
          Returns the content of the specified condition that shall be generated inside the header element (never null).
 Component getOwner()
          Returns the owner of this page, or null if it is not owned by any component.
 java.lang.String getRootAttributes()
          Returns the attributes of the root element declared in this page (never null).
 void init(PageConfig config)
          Initializes this page by assigning the info provided by the specified PageConfig, and then adds it to a desktop (by use of Execution.getDesktop()).
 void preInit()
          Pre-initializes this page.
 void redraw(java.io.Writer out)
          Redraws the whole page into the specified output.
 void sessionDidActivate(Desktop desktop)
          Notification that the session, which owns this page, has just been activated (aka., deserialized).
 void sessionWillPassivate(Desktop desktop)
          Notification that the session, which owns this page, is about to be passivated (aka., serialized).
 void setAutomaticTimeout(java.lang.Boolean autoTimeout)
          Sets whether to automatically redirect to the timeout URI.
 void setCacheable(java.lang.Boolean cacheable)
          Sets if the client can cache the rendered result.
 void setContentType(java.lang.String contentType)
          Sets the content type.
 void setDefaultParent(Component comp)
          Deprecated. As of release 5.0.0, it is removed to simplify ZK.
 void setDocType(java.lang.String docType)
          Sets the doc type (<!
 void setFirstLine(java.lang.String firstLine)
          Sets the first line to be generated to the output.
 void setOwner(Component comp)
          Sets the owner of this page.
 void setRootAttributes(java.lang.String rootAttributes)
          Set the attributes of the root element declared in this page Default: "".
 

Field Detail

ATTR_REDRAW_BY_INCLUDE

static final java.lang.String ATTR_REDRAW_BY_INCLUDE
Deprecated. As of release 5.0.0, replaced with Attributes.PAGE_REDRAW_CONTROL.
See Also:
Constant Field Values
Method Detail

preInit

void preInit()
Pre-initializes this page. It initializes Page.getDesktop(), but it doesn't add this page to the desktop yet (which is done by init(org.zkoss.zk.ui.sys.PageConfig)).

Note: it is called before Initiator.doInit(org.zkoss.zk.ui.Page, java.util.Map) and init(org.zkoss.zk.ui.sys.PageConfig). Since Page.getDesktop() is initialized in this method, it is OK to create components in Initiator.doInit(org.zkoss.zk.ui.Page, java.util.Map).

Since:
3.5.2

init

void init(PageConfig config)
Initializes this page by assigning the info provided by the specified PageConfig, and then adds it to a desktop (by use of Execution.getDesktop()).

Note: this method is called after preInit() and Initiator.doInit(org.zkoss.zk.ui.Page, java.util.Map).

This method shall be called only after the current execution is activated.

Parameters:
config - the info about how to initialize this page
Since:
3.0.0

destroy

void destroy()
Called when this page is about to be detroyed. It is called by desktop, after removing it from the desktop.


getHeaders

java.lang.String getHeaders(boolean before)
Returns the content of the specified condition that shall be generated inside the header element (never null).

For HTML, the header element is the HEAD element.

Parameters:
before - whether to return the headers that shall be shown before ZK's CSS/JS headers. If true, only the headers that shall be shown before (such as meta) are returned. If true, only the headers that shall be shown after (such as link) are returned.
Since:
3.6.1
See Also:
getHeaders()

getHeaders

java.lang.String getHeaders()
Returns all content that will be generated inside the header element (never null).

For HTML, the header element is the HEAD element.

It returns all header no matter it shall be shown before or after ZK's CSS/JS headers. To have more control, use getHeaders(boolean) instead.

See Also:
getHeaders(boolean)

getRootAttributes

java.lang.String getRootAttributes()
Returns the attributes of the root element declared in this page (never null). An empty string is returned if no special attribute is declared.

For HTML, the root element is the HTML element.

Since:
3.0.0

setRootAttributes

void setRootAttributes(java.lang.String rootAttributes)
Set the attributes of the root element declared in this page

Default: "".


getDocType

java.lang.String getDocType()
Returns the doc type (<!DOCTYPE>), or null to use the device default.

Since:
3.0.0

setDocType

void setDocType(java.lang.String docType)
Sets the doc type (<!DOCTYPE>).

Default: null (i.e., the device default)

Since:
3.0.0

getFirstLine

java.lang.String getFirstLine()
Returns the first line to be generated to the output, or null if nothing to generate.

For XML devices, it is usually the xml processing instruction:
<?xml version="1.0" encoding="UTF-8"?>

Since:
3.0.0

setFirstLine

void setFirstLine(java.lang.String firstLine)
Sets the first line to be generated to the output.

Default: null (i.e., nothing generated)

Since:
3.0.0

getContentType

java.lang.String getContentType()
Returns the content type, or null to use the device default.

Since:
3.0.0

setContentType

void setContentType(java.lang.String contentType)
Sets the content type.

Since:
3.0.0

getCacheable

java.lang.Boolean getCacheable()
Returns if the client can cache the rendered result, or null to use the device default.

Since:
3.0.0

setCacheable

void setCacheable(java.lang.Boolean cacheable)
Sets if the client can cache the rendered result.

Default: null (use the device default).

Since:
3.0.0

getAutomaticTimeout

java.lang.Boolean getAutomaticTimeout()
Returns whether to automatically redirect to the timeout URI.

Since:
3.6.3
See Also:
setAutomaticTimeout(java.lang.Boolean)

setAutomaticTimeout

void setAutomaticTimeout(java.lang.Boolean autoTimeout)
Sets whether to automatically redirect to the timeout URI.

Default: null (use the device default).

If it is set to false, it means this page is redirected to the timeout URI when the use takes some action after timeout. In other words, nothing happens if the user does nothing. If it is set to true, it is redirected as soon as timeout, no matter the user takes any action.

Refer to Configuration.setAutomaticTimeout(java.lang.String, boolean) for how to configure the device default (default: false).

Since:
3.6.3

getOwner

Component getOwner()
Returns the owner of this page, or null if it is not owned by any component. A page is included by a component. We say it is owned by the component.


setOwner

void setOwner(Component comp)
Sets the owner of this page.

Used only internally.


redraw

void redraw(java.io.Writer out)
            throws java.io.IOException
Redraws the whole page into the specified output.

You could use Attributes.PAGE_REDRAW_CONTROL and/or Attributes.PAGE_RENDERER to control how to render manually.

Throws:
java.io.IOException
Since:
5.0.0

addDeferredZScript

void addDeferredZScript(Component parent,
                        ZScript zscript)
Adds a deferred zscript.

Parameters:
parent - the component that is the parent of zscript (in the ZUML page), or null if it belongs to the page.
zscript - the zscript that shall be evaluated as late as when the interpreter of the same language is being loaded.

getDefaultParent

Component getDefaultParent()
Deprecated. As of release 5.0.0, it is removed to simplify ZK.


setDefaultParent

void setDefaultParent(Component comp)
Deprecated. As of release 5.0.0, it is removed to simplify ZK.


sessionWillPassivate

void sessionWillPassivate(Desktop desktop)
Notification that the session, which owns this page, is about to be passivated (aka., serialized).


sessionDidActivate

void sessionDidActivate(Desktop desktop)
Notification that the session, which owns this page, has just been activated (aka., deserialized).



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