Interface PageCtrl
-
- All Known Implementing Classes:
AbstractPage,PageImpl,VolatilePage
public interface PageCtrlAddition interface toPagefor implementation purpose.Application developers shall never access any of this methods.
- Author:
- tomyeh
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddAfterHeadTags(java.lang.String tags)Adds the tags that will be generated inside the head element and after ZK's default tags.voidaddBeforeHeadTags(java.lang.String tags)Adds the tags that will be generated inside the head element and before ZK's default tags.voidaddDeferredZScript(Component parent, ZScript zscript)Adds a deferred zscript.voiddestroy()Called when this page is about to be destroyed.java.lang.StringgetAfterHeadTags()Returns the tags that shall be generated inside the head element and after ZK's default tags (never null).java.lang.BooleangetAutomaticTimeout()Returns whether to automatically redirect to the timeout URI.java.lang.StringgetBeforeHeadTags()Returns the tags that shall be generated inside the head element and before ZK's default tags (never null).java.lang.BooleangetCacheable()Returns if the client can cache the rendered result, or null to use the device default.java.lang.StringgetContentType()Returns the content type, or null to use the device default.java.lang.StringgetDocType()Returns the doc type (<!java.lang.StringgetFirstLine()Returns the first line to be generated to the output, or null if nothing to generate.ComponentgetOwner()Returns the owner of this page, or null if it is not owned by any component.java.util.Collection<java.lang.Object[]>getResponseHeaders()Returns a readonly collection of response headers (never null).java.lang.StringgetRootAttributes()Returns the attributes of the root element declared in this page (never null).java.lang.StringgetWidgetClass()Returns the widget class of this page, or null to use the device default.voidinit(PageConfig config)Initializes this page by assigning the info provided by the specifiedPageConfig, and then adds it to a desktop (by use ofExecution.getDesktop()).voidpreInit()Pre-initializes this page.voidredraw(java.io.Writer out)Redraws the whole page into the specified output.voidsessionDidActivate(Desktop desktop)Notification that the session, which owns this page, has just been activated (a.k.a., deserialized).voidsessionWillPassivate(Desktop desktop)Notification that the session, which owns this page, is about to be passivated (a.k.a., serialized).voidsetAutomaticTimeout(java.lang.Boolean autoTimeout)Sets whether to automatically redirect to the timeout URI.voidsetCacheable(java.lang.Boolean cacheable)Sets if the client can cache the rendered result.voidsetContentType(java.lang.String contentType)Sets the content type.voidsetDocType(java.lang.String docType)Sets the doc type (<!voidsetFirstLine(java.lang.String firstLine)Sets the first line to be generated to the output.voidsetOwner(Component comp)Sets the owner of this page.voidsetRootAttributes(java.lang.String rootAttributes)Set the attributes of the root element declared in this pagevoidsetWidgetClass(java.lang.String wgtcls)Sets the widget class of this page.
-
-
-
Method Detail
-
preInit
void preInit()
Pre-initializes this page. It initializesPage.getDesktop(), but it doesn't add this page to the desktop yet (which is done byinit(org.zkoss.zk.ui.sys.PageConfig)).Note: it is called before
Initiator.doInit(org.zkoss.zk.ui.Page, java.util.Map<java.lang.String, java.lang.Object>)andinit(org.zkoss.zk.ui.sys.PageConfig). SincePage.getDesktop()is initialized in this method, it is OK to create components inInitiator.doInit(org.zkoss.zk.ui.Page, java.util.Map<java.lang.String, java.lang.Object>).- Since:
- 3.5.2
-
init
void init(PageConfig config)
Initializes this page by assigning the info provided by the specifiedPageConfig, and then adds it to a desktop (by use ofExecution.getDesktop()).Note: this method is called after
preInit()andInitiator.doInit(org.zkoss.zk.ui.Page, java.util.Map<java.lang.String, java.lang.Object>).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 destroyed. It is called by desktop, after removing it from the desktop.
-
getBeforeHeadTags
java.lang.String getBeforeHeadTags()
Returns the tags that shall be generated inside the head element and before ZK's default tags (never null). For example, it might consist of <meta> and <link>.Since it is generated before ZK's default tags (such as CSS and JS), it cannot override ZK's default behaviors.
- Since:
- 5.0.5
- See Also:
getAfterHeadTags()
-
getAfterHeadTags
java.lang.String getAfterHeadTags()
Returns the tags that shall be generated inside the head element and after ZK's default tags (never null). For example, it might consist of <meta> and <link>.Since it is generated after ZK's default tags (such as CSS and JS), it could override ZK's default behaviors.
- Since:
- 5.0.5
- See Also:
getBeforeHeadTags()
-
addBeforeHeadTags
void addBeforeHeadTags(java.lang.String tags)
Adds the tags that will be generated inside the head element and before ZK's default tags. For example,((PageCtrl)page).addBeforeHeadTags("<meta name=\"robots\" content=\"index,follow\"/>");You could specify the link, meta and script directive to have the similar result.
- Since:
- 5.0.5
-
addAfterHeadTags
void addAfterHeadTags(java.lang.String tags)
Adds the tags that will be generated inside the head element and after ZK's default tags. For example,((PageCtrl)page).addBeforeHeadTags("<meta name=\"robots\" content=\"index,follow\"/>");You could specify the link, meta and script directive to have the similar result.
- Since:
- 5.0.5
-
getResponseHeaders
java.util.Collection<java.lang.Object[]> getResponseHeaders()
Returns a readonly collection of response headers (never null). The entry is a three-element object array. The first element is the header name. The second element of the array is the value which is an instance ofDateorString(and never null). The third element indicates whether to add (rather than set) theader. It is an instance of Boolean (and never null).- Since:
- 5.0.2
-
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 pageDefault: "".
-
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
-
getWidgetClass
java.lang.String getWidgetClass()
Returns the widget class of this page, or null to use the device default.- Since:
- 5.0.5
-
setWidgetClass
void setWidgetClass(java.lang.String wgtcls)
Sets the widget class of this page.- Parameters:
wgtcls- the widget class. The device default is assumed if wgtcls is null or empty.- Since:
- 5.0.5
-
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.Note: the owner, if not null, must implement
Includer.
-
setOwner
void setOwner(Component comp)
Sets the owner of this page.Called only internally
Since 5.0.6, the owner must implement
Includer.
-
redraw
void redraw(java.io.Writer out) throws java.io.IOExceptionRedraws the whole page into the specified output.You could use
Attributes.PAGE_REDRAW_CONTROLand/orAttributes.PAGE_RENDERERto 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.
-
sessionWillPassivate
void sessionWillPassivate(Desktop desktop)
Notification that the session, which owns this page, is about to be passivated (a.k.a., serialized).
-
sessionDidActivate
void sessionDidActivate(Desktop desktop)
Notification that the session, which owns this page, has just been activated (a.k.a., deserialized).
-
-