|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface PageCtrl
Addition interface to Page for implementation
purpose.
Application developers shall never access any of this methods.
| Field Summary | |
|---|---|
static java.lang.String |
ATTR_REDRAW_BY_INCLUDE
The execution attribute used to control redraw(java.util.Collection, java.io.Writer) to use
include instead of forward to redraw the page |
| Method Summary | |
|---|---|
void |
addDeferredZScript(Component parent,
ZScript zscript)
Adds a deferred zscript. |
void |
addFellow(Component comp)
Adds a fellow. |
void |
addRoot(Component comp)
Adds a root component to a page. |
void |
destroy()
Called when this page is about to be detroyed. |
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()
Returns the default parent, or null if no such parent. |
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). |
boolean |
hasFellow(java.lang.String compId)
Returns whether a fellow exists with the specified component ID. |
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 |
moveRoot(Component comp,
Component refRoot)
Moves a root component before the reference component. |
void |
preInit()
Pre-initializes this page. |
void |
redraw(java.util.Collection responses,
java.io.Writer out)
Redraws the whole page into the specified output. |
void |
removeFellow(Component comp)
Removes a fellow. |
void |
removeRoot(Component comp)
Detaches a root component from this page. |
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 |
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)
Sets the default parent. |
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 |
|---|
static final java.lang.String ATTR_REDRAW_BY_INCLUDE
redraw(java.util.Collection, java.io.Writer) to use
include instead of forward to redraw the page
| Method Detail |
|---|
void preInit()
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).
void init(PageConfig config)
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.
config - the info about how to initialize this pagevoid destroy()
java.lang.String getHeaders(boolean before)
For HTML, the header element is the HEAD element.
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.getHeaders()java.lang.String getHeaders()
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.
getHeaders(boolean)java.lang.String getRootAttributes()
For HTML, the root element is the HTML element.
void setRootAttributes(java.lang.String rootAttributes)
Default: "".
java.lang.String getDocType()
void setDocType(java.lang.String docType)
Default: null (i.e., the device default)
java.lang.String getFirstLine()
For XML devices, it is usually the xml processing instruction:
<?xml version="1.0" encoding="UTF-8"?>
void setFirstLine(java.lang.String firstLine)
Default: null (i.e., nothing generated)
java.lang.String getContentType()
void setContentType(java.lang.String contentType)
java.lang.Boolean getCacheable()
void setCacheable(java.lang.Boolean cacheable)
Default: null (use the device default).
Component getOwner()
void setOwner(Component comp)
Used only internally.
void redraw(java.util.Collection responses,
java.io.Writer out)
throws java.io.IOException
You could use ATTR_REDRAW_BY_INCLUDE to control
whether to include, instead of forward, the page content.
By default, Execution.forward(java.io.Writer, java.lang.String, java.util.Map, int) is used if possible.
responses - a list of responses that the page has to generate
corresponding javascript to process them; or null if no such responses.
The responses is not null, if and only if the page is creating
java.io.IOExceptionvoid addRoot(Component comp)
It is used internally and developers shall not invoke it explicityly.
Component.setPage(org.zkoss.zk.ui.Page)void removeRoot(Component comp)
It is used internally and developers shall not invoke it explicitly
Component.setPage(org.zkoss.zk.ui.Page)
void moveRoot(Component comp,
Component refRoot)
Note: it assumes removeRoot was called before for comp. Otherwise, nothing happens.
It is used internally and developers shall not invoke it explicitly
Component.setPageBefore(org.zkoss.zk.ui.Page, org.zkoss.zk.ui.Component)void addFellow(Component comp)
void removeFellow(Component comp)
boolean hasFellow(java.lang.String compId)
void addDeferredZScript(Component parent,
ZScript zscript)
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.Component getDefaultParent()
setDefaultParent(org.zkoss.zk.ui.Component)),
Executions.createComponents(String, Component, java.util.Map) will
use it as the default parent, if developers didn't specify one.
void setDefaultParent(Component comp)
It is rarely used by application developers. Rather, it is used by ZHTML's body to make sure new created compnents are placed correctly.
Caller has to ensure the comp is part of the page. Otherwise, the result is unpreditable.
getDefaultParent()void sessionWillPassivate(Desktop desktop)
void sessionDidActivate(Desktop desktop)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||