|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.zk.ui.impl.PageImpl
public class PageImpl
An implmentation of Page and PageCtrl.
Refer to them for more details.
Note: though PageImpl is serializable, it is designed
to work with Web container to enable the serialization of sessions.
It is not suggested to serialize and desrialize it directly since
many fields might be lost.
On the other hand, it is OK to serialize and deserialize
Component.
Implementation Notes:
It is not thread-safe because it is protected by the spec:
at most one thread can access a page and all its components at the same time.
| Field Summary |
|---|
| Fields inherited from interface org.zkoss.zk.ui.Page |
|---|
APPLICATION_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE |
| Fields inherited from interface org.zkoss.zk.ui.sys.PageCtrl |
|---|
ATTR_REDRAW_BY_INCLUDE |
| Constructor Summary | |
|---|---|
PageImpl(LanguageDefinition langdef,
ComponentDefinitionMap compdefs,
java.lang.String path,
java.lang.String zslang)
Constructs a page without page definition and richlet. |
|
PageImpl(PageDefinition pgdef)
Constructs a page by giving the page definition. |
|
PageImpl(Richlet richlet,
java.lang.String path)
Constructs a page by specifying a richlet. |
|
| Method Summary | |
|---|---|
void |
addDeferredZScript(Component parent,
ZScript zscript)
Adds a deferred zscript. |
boolean |
addEventListener(java.lang.String evtnm,
EventListener listener)
Adds an event listener to specified event for all components in this page. |
void |
addFellow(Component comp)
Adds a fellow. |
void |
addFunctionMapper(org.zkoss.xel.FunctionMapper mapper)
Adds the function mapper in addition to the current one. |
void |
addRoot(Component comp)
Adds a root component to a page. |
boolean |
addVariableResolver(org.zkoss.xel.VariableResolver resolver)
Adds a name resolver that will be used to resolve a variable by Page.getVariable(java.lang.String). |
boolean |
containsVariable(java.lang.String name)
Returns whether the specified variable is defined. |
void |
destroy()
Called when this page is about to be detroyed. |
java.lang.Object |
getAttribute(java.lang.String name)
Returns the value of the specified attribute associated with this page. |
java.lang.Object |
getAttribute(java.lang.String name,
int scope)
Returns the value of the specified custom attribute in the specified scope. |
java.util.Map |
getAttributes()
Returns all custom attributes associated with this page. |
java.util.Map |
getAttributes(int scope)
Returns all custom attributes of the specified scope. |
java.lang.Boolean |
getCacheable()
Returns if the client can cache the rendered result, or null to use the device default. |
ComponentDefinition |
getComponentDefinition(java.lang.Class cls,
boolean recur)
Returns the component definition of the specified class, or null if not found. |
ComponentDefinition |
getComponentDefinition(java.lang.String name,
boolean recur)
Returns the component definition of the specified name, or null if not found. |
ComponentDefinitionMap |
getComponentDefinitionMap()
Returns the map of component definitions (never null). |
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. |
Desktop |
getDesktop()
Returns the desktop that this page belongs to. |
java.lang.String |
getDocType()
Returns the doc type (<! |
java.lang.Object |
getELVariable(java.lang.String name)
Deprecated. As of release of 3.0.0, replaced with getXelVariable(java.lang.String). |
Component |
getFellow(java.lang.String compId)
Returns a component of the specified ID in the same ID space. |
Component |
getFellowIfAny(java.lang.String compId)
Returns a component of the specified ID in the same ID space, or null if not found. |
java.lang.String |
getFirstLine()
Returns the first line to be generated to the output, or null if nothing to generate. |
org.zkoss.xel.FunctionMapper |
getFunctionMapper()
Returns the function mapper for resolving XEL functions, or null if not available. |
java.lang.String |
getHeaders()
Returns the header elements declared in this page (never null). |
java.lang.String |
getId()
Returns ID which is unique in the request (never null). |
Interpreter |
getInterpreter(java.lang.String zslang)
Returns the interpreter of the specified scripting language. |
LanguageDefinition |
getLanguageDefinition()
Returns the language definition that this page belongs to (never null). |
java.util.Iterator |
getListenerIterator(java.lang.String evtnm)
Returns an iterator for iterating listener for the specified event. |
java.util.Collection |
getLoadedInterpreters()
Returns all loaded interpreters. |
Namespace |
getNamespace()
Returns the namespace used to store variables belonging to the ID space of this page. |
Component |
getOwner()
Returns the owner of this page, or null if it is not owned by any component. |
java.lang.String |
getRequestPath()
Returns the request path of this page, or "" if not available. |
java.lang.String |
getRootAttributes()
Returns the attributes of the root element declared in this page (never null). |
java.util.Collection |
getRoots()
Returns a readonly list of the root components. |
java.lang.String |
getStyle()
Returns the CSS style of this page, or empty if not specified. |
java.lang.String |
getTitle()
Returns the title of the desktop this page belongs to (and evaluate it if it contains an expression). |
java.lang.String |
getUuid()
Returns UUID (universal unique ID) which is unquie in the whole session. |
java.lang.Object |
getVariable(java.lang.String name)
Returns the value of a variable defined in the namespace ( Page.getNamespace()). |
java.lang.Object |
getXelVariable(java.lang.String name)
Returns a variable that is visible to XEL expressions. |
java.lang.Class |
getZScriptClass(java.lang.String clsnm)
Returns the class of the specified name by searching the thread class loader and the classes defined in the loaded interpreters. |
org.zkoss.xel.Function |
getZScriptFunction(Component comp,
java.lang.String name,
java.lang.Class[] argTypes)
Returns the variable of the specified name by searching the logical scope of the namespace of the specified component for all the loaded interpreters. |
org.zkoss.xel.Function |
getZScriptFunction(Namespace ns,
java.lang.String name,
java.lang.Class[] argTypes)
Returns the variable of the specified name by searching the logical scope of the specified namespace for all the loaded interpreters. |
org.zkoss.xel.Function |
getZScriptFunction(java.lang.String name,
java.lang.Class[] argTypes)
Returns the variable of the specified name by searching the loaded interpreters. |
java.lang.String |
getZScriptLanguage()
Returns the default scripting language which is assumed when a zscript element doesn't specify any language. |
Method |
getZScriptMethod(Namespace ns,
java.lang.String name,
java.lang.Class[] argTypes)
Deprecated. As of release 3.0.0, replaced by getZScriptFunction(String,Class[]). |
Method |
getZScriptMethod(java.lang.String name,
java.lang.Class[] argTypes)
Deprecated. As of release 3.0.0, replaced by getZScriptFunction(String,Class[]). |
java.lang.Object |
getZScriptVariable(Component comp,
java.lang.String name)
Returns the value of the variable of the specified name by searching the logical scope of the namespace of the specified component for all the loaded interpreters, if any. |
java.lang.Object |
getZScriptVariable(Namespace ns,
java.lang.String name)
Returns the value of the variable of the specified name by searching the logical scope of the specified namespace for all the loaded interpreters, if any. |
java.lang.Object |
getZScriptVariable(java.lang.String name)
Returns the value of the variable of the specified name by searching the loaded interpreters, if any. |
boolean |
hasFellow(java.lang.String compId)
Returns whether a fellow exists with the specified component ID. |
protected void |
init()
Initialized the page when contructed or deserialized. |
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 |
interpret(java.lang.String zslang,
java.lang.String script,
Namespace ns)
Interpret a script of the specified scripting language against the specified namespace. |
void |
invalidate()
Invalidates this page to cause all components to redraw. |
boolean |
isListenerAvailable(java.lang.String evtnm)
Returns whether the event listener is available. |
void |
moveRoot(Component comp,
Component refRoot)
Moves a root component before the reference component. |
void |
redraw(java.util.Collection responses,
java.io.Writer out)
Redraws the whole page into the specified output. |
java.lang.Object |
removeAttribute(java.lang.String name)
Removes the specified attribute custom associated with the page. |
java.lang.Object |
removeAttribute(java.lang.String name,
int scope)
Removes the specified custom attribute in the specified scope. |
void |
removeComponents()
Removes all components in this page. |
boolean |
removeEventListener(java.lang.String evtnm,
EventListener listener)
Removes an event listener. |
void |
removeFellow(Component comp)
Removes a fellow. |
void |
removeRoot(Component comp)
Detaches a root component from this page. |
boolean |
removeVariableResolver(org.zkoss.xel.VariableResolver resolver)
Removes a name resolve that was added by Page.addVariableResolver(org.zkoss.xel.VariableResolver). |
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). |
java.lang.Object |
setAttribute(java.lang.String name,
java.lang.Object value)
Sets the value of the specified custom attribute associated with this page. |
java.lang.Object |
setAttribute(java.lang.String name,
java.lang.Object value,
int scope)
Sets the value of the specified custom attribute in the specified scope. |
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 |
setId(java.lang.String id)
Sets the identifier of this page. |
void |
setOwner(Component comp)
Sets the owner of this page. |
void |
setRootAttributes(java.lang.String rootAttrs)
Set the attributes of the root element declared in this page Default: "". |
void |
setStyle(java.lang.String style)
Sets the CSS style of this page. |
void |
setTitle(java.lang.String title)
Sets the title of the desktop this page belongs to (it might contain an expression). |
void |
setVariable(java.lang.String name,
java.lang.Object val)
Sets a variable to the namespace ( Page.getNamespace()). |
void |
setZScriptLanguage(java.lang.String zslang)
Sets the defafult scripting language which will be assumed if a zscript element doesn't specify any language. |
java.lang.String |
toString()
|
void |
unsetVariable(java.lang.String name)
Unsets a variable from the namespace ( Page.getNamespace()). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public PageImpl(PageDefinition pgdef)
Note: when a page is constructed, it doesn't belong to a desktop
yet. Caller has to invoke init() to complete
the creation of a page.
Why two phase? Contructor could be called before execution
is activated, but init() must be called in an execution.
Also note that getId() and getTitle()
are not ready until init() is called.
pgdef - the page definition (never null).
public PageImpl(LanguageDefinition langdef,
ComponentDefinitionMap compdefs,
java.lang.String path,
java.lang.String zslang)
langdef - the language definition (never null)compdefs - the component definition map.
If null, an empty map is assumed.path - the request path. If null, empty is assumed.zslang - the zscript language. If null, "Java" is assumed.
public PageImpl(Richlet richlet,
java.lang.String path)
Note: when a page is constructed, it doesn't belong to a desktop
yet. Caller has to invoke init() to complete
the creation of a page.
Also note that getId() and getTitle()
are not ready until init() is called.
richlet - the richlet to serve this page.path - the request path, or null if not available| Method Detail |
|---|
protected void init()
public final org.zkoss.xel.FunctionMapper getFunctionMapper()
Page
getFunctionMapper in interface Pagepublic void addFunctionMapper(org.zkoss.xel.FunctionMapper mapper)
PageThe new added function mapper has the higher priority.
Page.getFunctionMapper() will return the new
addFunctionMapper in interface Pagemapper - the new function mapper (null to ignore).public java.lang.String getRequestPath()
PageIt is the same as the servlet path (javax.servlet.http.HttpServletRequest's getServletPath), if ZK is running at a servlet container.
Note: Desktop.getRequestPath() returns the request path
that causes the desktop to create. And, there might be multiple
pages in the same desktop.
getRequestPath in interface PageExecution.getContextPath(),
Desktop.getRequestPath()public final java.lang.String getId()
PageNote: it returns null when
Initiator.doInit(org.zkoss.zk.ui.Page, java.lang.Object[]) is called.
getId in interface Pagepublic final java.lang.String getUuid()
PageIt is mainly used for communication between client and server and you rarely need to access it.
getUuid in interface Pagepublic void setId(java.lang.String id)
PageNote: you can change the page's ID only in
Initiator.doInit(org.zkoss.zk.ui.Page, java.lang.Object[])
or ExecutionInit.init(org.zkoss.zk.ui.Execution, org.zkoss.zk.ui.Execution).
Once the page is initialized (by PageCtrl.init(org.zkoss.zk.ui.sys.PageConfig)),
calling this
method will cause an exception.
setId in interface Pagepublic java.lang.String getTitle()
PageDefault: "".
getTitle in interface Pagepublic void setTitle(java.lang.String title)
Page
setTitle in interface Pagepublic java.lang.String getStyle()
Page
getStyle in interface Pagepublic void setStyle(java.lang.String style)
PageNote: Unlike Page.setTitle(java.lang.String), you can change the style only in
the lifecycle of the loading page.
setStyle in interface Pagepublic java.util.Collection getRoots()
Page
getRoots in interface Pagepublic java.util.Map getAttributes(int scope)
PageIf scope is Page.PAGE_SCOPE, it means custom attributes shared
by components from the same page as this one's.
If scope is Page.DESKTOP_SCOPE, it means custom attributes shared
by components from the same desktopas this one's.
getAttributes in interface Pagescope - Page.APPLICATION_SCOPE, Page.SESSION_SCOPE,
Page.PAGE_SCOPE, Page.REQUEST_SCOPE or Page.DESKTOP_SCOPE.
public java.lang.Object getAttribute(java.lang.String name,
int scope)
PageIf scope is Page.PAGE_SCOPE, it means custom attributes shared
by components from the same page as this one's.
If scope is Page.DESKTOP_SCOPE, it means custom attributes shared
by components from the same desktopas this one's.
getAttribute in interface Pagescope - Page.APPLICATION_SCOPE, Page.SESSION_SCOPE,
Page.PAGE_SCOPE, Page.REQUEST_SCOPE or Page.DESKTOP_SCOPE.
public java.lang.Object setAttribute(java.lang.String name,
java.lang.Object value,
int scope)
PageIf scope is Page.PAGE_SCOPE, it means custom attributes shared
by components from the same page as this one's.
If scope is Page.DESKTOP_SCOPE, it means custom attributes shared
by components from the same desktopas this one's.
setAttribute in interface Pagescope - Page.APPLICATION_SCOPE, Page.SESSION_SCOPE,
Page.PAGE_SCOPE, Page.REQUEST_SCOPE or Page.DESKTOP_SCOPE.
public java.lang.Object removeAttribute(java.lang.String name,
int scope)
PageIf scope is Page.PAGE_SCOPE, it means custom attributes shared
by components from the same page as this one's.
If scope is Page.DESKTOP_SCOPE, it means custom attributes shared
by components from the same desktopas this one's.
removeAttribute in interface Pagescope - Page.APPLICATION_SCOPE, Page.SESSION_SCOPE,
Page.PAGE_SCOPE, Page.REQUEST_SCOPE or Page.DESKTOP_SCOPE.public java.util.Map getAttributes()
Page
getAttributes in interface Pagepublic java.lang.Object getAttribute(java.lang.String name)
Page
getAttribute in interface Page
public java.lang.Object setAttribute(java.lang.String name,
java.lang.Object value)
PageNote: The attribute is removed (by Page.removeAttribute(java.lang.String, int)
if value is null, while Page.setVariable(java.lang.String, java.lang.Object) considers null as a legal value.
setAttribute in interface Pagevalue - the value. If null, the attribute is removed.public java.lang.Object removeAttribute(java.lang.String name)
Page
removeAttribute in interface Pagepublic void invalidate()
Page
invalidate in interface Pagepublic void removeComponents()
Page
removeComponents in interface PageExecution.createComponents(String,Component,Map)
public void setVariable(java.lang.String name,
java.lang.Object val)
PagePage.getNamespace()).
It is the same as getNamespace().setVariable(name, value, true).
setVariable in interface PageComponent.setVariable(java.lang.String, java.lang.Object, boolean),
Component.getNamespace()public boolean containsVariable(java.lang.String name)
PageNote: null is a valid value for variable, so this method is used
to know whether a variable is defined.
On the other hand, Page.setAttribute(java.lang.String, java.lang.Object, int) actually remove
an attribute (by Page.removeAttribute(java.lang.String, int) if value is null.
containsVariable in interface Pagepublic java.lang.Object getVariable(java.lang.String name)
PagePage.getNamespace()).
It is the same as getNamespace().getVariable(name, true).
Page.getVariable(java.lang.String) and Page.getZScriptVariable(java.lang.String)Page.getVariable(java.lang.String) returns only variables defined by
Page.setVariable(java.lang.String, java.lang.Object) (i.e., a shortcut to Namespace.setVariable(java.lang.String, java.lang.Object, boolean)).
On the other hand, Page.getZScriptVariable(java.lang.String) returns these variables
and those defined when executing zscripts.
getVariable in interface PageComponent.getVariable(java.lang.String, boolean),
Component.getNamespace()public void unsetVariable(java.lang.String name)
PagePage.getNamespace()).
It is the same as getNamespace().unsetVariable(name, true).
unsetVariable in interface PageComponent.unsetVariable(java.lang.String, boolean),
Component.getNamespace()public java.lang.Class getZScriptClass(java.lang.String clsnm)
PageNote: it also looks for the class by use of the current thread's class loader.
getZScriptClass in interface PagePage.getLoadedInterpreters()
public org.zkoss.xel.Function getZScriptFunction(java.lang.String name,
java.lang.Class[] argTypes)
Page
getZScriptFunction in interface PagePage.getLoadedInterpreters()
public org.zkoss.xel.Function getZScriptFunction(Namespace ns,
java.lang.String name,
java.lang.Class[] argTypes)
PageIt is similar to Page.getZScriptVariable(String), except
it uses the specified namespace as a reference to identify the
correct scope for searching the variable.
If the interpreter does NOT support hierachical scopes,
this method is the same as Page.getZScriptVariable(String).
getZScriptFunction in interface Pagens - the namespace used as a reference to identify the
correct scope for searching the variable.
It is ignored if the interpreter doesn't support hierachical scopes.
Note: this method doesn't look for any variable stored in ns.
Page.getLoadedInterpreters()
public org.zkoss.xel.Function getZScriptFunction(Component comp,
java.lang.String name,
java.lang.Class[] argTypes)
PageIt is a shortcut: getZScriptFunction(comp.getNamespace(), name, argTypes);
getZScriptFunction in interface Page
public Method getZScriptMethod(java.lang.String name,
java.lang.Class[] argTypes)
getZScriptFunction(String,Class[]).
getZScriptMethod in interface Page
public Method getZScriptMethod(Namespace ns,
java.lang.String name,
java.lang.Class[] argTypes)
getZScriptFunction(String,Class[]).
getZScriptMethod in interface Pagepublic java.lang.Object getZScriptVariable(java.lang.String name)
PagePage.getVariable(java.lang.String) and Page.getZScriptVariable(java.lang.String)Page.getVariable(java.lang.String) returns variables defined by
Page.setVariable(java.lang.String, java.lang.Object) (i.e., a shortcut to Namespace.setVariable(java.lang.String, java.lang.Object, boolean)).
On the other hand, Page.getZScriptVariable(java.lang.String) returns the variables
that are defined when executing zscripts.
getZScriptVariable in interface PagePage.getLoadedInterpreters()
public java.lang.Object getZScriptVariable(Namespace ns,
java.lang.String name)
PageIt is similar to Page.getZScriptVariable(String), except
it uses the specified namespace as a reference to identify the
correct scope for searching the variable.
If the interpreter does NOT support hierachical scopes,
this method is the same as Page.getZScriptVariable(String).
getZScriptVariable in interface Pagens - the namespace used as a reference to identify the
correct scope for searching the variable.
It is ignored if the interpreter doesn't support hierachical scopes.
Note: this method doesn't look for any variable stored in ns.
public java.lang.Object getZScriptVariable(Component comp,
java.lang.String name)
PageIt is a shortcut: getZScriptVariable(comp.getNamespace(), name);
getZScriptVariable in interface Pagepublic java.lang.Object getXelVariable(java.lang.String name)
PageThis method is mainly used to access special variable, such as request parameters (if this page is requested by HTTP).
Note: components that are specified with an ID are already accessible
by Page.getVariable(java.lang.String).
getXelVariable in interface Pagepublic java.lang.Object getELVariable(java.lang.String name)
getXelVariable(java.lang.String).
Page
getELVariable in interface Pagepublic boolean addVariableResolver(org.zkoss.xel.VariableResolver resolver)
PagePage.getVariable(java.lang.String).
Note: the variables resolved by the specified resolver are accessible to both zscript and EL expressions.
addVariableResolver in interface Pagepublic boolean removeVariableResolver(org.zkoss.xel.VariableResolver resolver)
PagePage.addVariableResolver(org.zkoss.xel.VariableResolver).
removeVariableResolver in interface Page
public boolean addEventListener(java.lang.String evtnm,
EventListener listener)
PageDue to performance consideration, unlike Component.addEventListener(java.lang.String, org.zkoss.zk.ui.event.EventListener),
all event listeners for the page are deferrable, no matter
Deferrable is implemented or not.
addEventListener in interface Pageevtnm - what event to listen (never null)
Component.addEventListener(java.lang.String, org.zkoss.zk.ui.event.EventListener)
public boolean removeEventListener(java.lang.String evtnm,
EventListener listener)
Page
removeEventListener in interface Pagepublic Component getFellow(java.lang.String compId)
IdSpaceUnlike IdSpace.getFellowIfAny(java.lang.String), it throws an exception if not found.
getFellow in interface IdSpacepublic Component getFellowIfAny(java.lang.String compId)
IdSpaceUnlike IdSpace.getFellow(java.lang.String), it returns null if not found.
getFellowIfAny in interface IdSpacepublic void init(PageConfig config)
PageCtrlPageConfig, and then adds it
to a desktop (by use of Execution.getDesktop()).
This method shall be called only after the current execution is activated.
init in interface PageCtrlconfig - the info about how to initialize this pagepublic void destroy()
PageCtrl
destroy in interface PageCtrlpublic java.lang.String getHeaders()
PageCtrlFor HTML, the header element is the HEAD element.
getHeaders in interface PageCtrlpublic java.lang.String getRootAttributes()
PageCtrlFor HTML, the root element is the HTML element.
getRootAttributes in interface PageCtrlpublic void setRootAttributes(java.lang.String rootAttrs)
PageCtrlDefault: "".
setRootAttributes in interface PageCtrlpublic java.lang.String getContentType()
PageCtrl
getContentType in interface PageCtrlpublic void setContentType(java.lang.String contentType)
PageCtrl
setContentType in interface PageCtrlpublic java.lang.String getDocType()
PageCtrl
getDocType in interface PageCtrlpublic void setDocType(java.lang.String docType)
PageCtrlDefault: null (i.e., the device default)
setDocType in interface PageCtrlpublic java.lang.String getFirstLine()
PageCtrlFor XML devices, it is usually the xml processing instruction:
<?xml version="1.0" encoding="UTF-8"?>
getFirstLine in interface PageCtrl
public void setFirstLine(java.lang.String firstLine)
PageCtrlDefault: null (i.e., nothing generated)
setFirstLine in interface PageCtrlpublic java.lang.Boolean getCacheable()
PageCtrl
getCacheable in interface PageCtrlpublic void setCacheable(java.lang.Boolean cacheable)
PageCtrlDefault: null (use the device default).
setCacheable in interface PageCtrlpublic final Desktop getDesktop()
PageNote: it returns null when
Initiator.doInit(org.zkoss.zk.ui.Page, java.lang.Object[]) is called.
getDesktop in interface Pagepublic void addRoot(Component comp)
PageCtrlIt is used internally and developers shall not invoke it explicityly.
addRoot in interface PageCtrlComponent.setPage(org.zkoss.zk.ui.Page)public void removeRoot(Component comp)
PageCtrlIt is used internally and developers shall not invoke it explicitly
removeRoot in interface PageCtrlComponent.setPage(org.zkoss.zk.ui.Page)
public void moveRoot(Component comp,
Component refRoot)
PageCtrlNote: it assumes removeRoot was called before for comp. Otherwise, nothing happens.
It is used internally and developers shall not invoke it explicitly
moveRoot in interface PageCtrlComponent.setPageBefore(org.zkoss.zk.ui.Page, org.zkoss.zk.ui.Component)public void addFellow(Component comp)
PageCtrl
addFellow in interface PageCtrlpublic void removeFellow(Component comp)
PageCtrl
removeFellow in interface PageCtrlpublic boolean hasFellow(java.lang.String compId)
PageCtrl
hasFellow in interface PageCtrl
public void redraw(java.util.Collection responses,
java.io.Writer out)
throws java.io.IOException
PageCtrlYou could use PageCtrl.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.
redraw in interface PageCtrlresponses - 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.IOExceptionpublic final Namespace getNamespace()
Page
getNamespace in interface PagePage.interpret(java.lang.String, java.lang.String, org.zkoss.zk.scripting.Namespace)
public void interpret(java.lang.String zslang,
java.lang.String script,
Namespace ns)
Page
interpret in interface Pagezslang - the scripting language. If null, Page.getZScriptLanguage()
is assumed.ns - the namspace. If null, the current namespace is assumed.
The current namespace is the event target's namespace
(Event.getTarget()),
if the thread is processing an event.
Otherwise, the current namespace is this page's namespacepublic Interpreter getInterpreter(java.lang.String zslang)
PageThe interpreter will be loaded and initialized, if it is not loaded yet.
getInterpreter in interface Pagezslang - the scripting language. If null, Page.getZScriptLanguage()
is assumed.public java.util.Collection getLoadedInterpreters()
Page
getLoadedInterpreters in interface Pagepublic java.lang.String getZScriptLanguage()
Page
getZScriptLanguage in interface Page
public void setZScriptLanguage(java.lang.String zslang)
throws InterpreterNotFoundException
Page
setZScriptLanguage in interface PageInterpreterNotFoundException - if no such language
public void addDeferredZScript(Component parent,
ZScript zscript)
PageCtrl
addDeferredZScript in interface PageCtrlparent - 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.public boolean isListenerAvailable(java.lang.String evtnm)
Page
isListenerAvailable in interface Pagepublic java.util.Iterator getListenerIterator(java.lang.String evtnm)
Page
getListenerIterator in interface Pagepublic final Component getOwner()
PageCtrl
getOwner in interface PageCtrlpublic final void setOwner(Component comp)
PageCtrlUsed only internally.
setOwner in interface PageCtrlpublic Component getDefaultParent()
PageCtrlPageCtrl.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.
getDefaultParent in interface PageCtrlpublic void setDefaultParent(Component comp)
PageCtrlIt 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.
setDefaultParent in interface PageCtrlPageCtrl.getDefaultParent()public void sessionWillPassivate(Desktop desktop)
PageCtrl
sessionWillPassivate in interface PageCtrlpublic void sessionDidActivate(Desktop desktop)
PageCtrl
sessionDidActivate in interface PageCtrlpublic LanguageDefinition getLanguageDefinition()
Page
getLanguageDefinition in interface Pagepublic ComponentDefinitionMap getComponentDefinitionMap()
PageNote: the map is shared among all instance of the same page definition.
Any component definition added (by ComponentDefinitionMap.add(org.zkoss.zk.ui.metainfo.ComponentDefinition))
are visible to all other instances of the same page definition.
Thus, it is NOT a good idea to change its content.
getComponentDefinitionMap in interface Page
public ComponentDefinition getComponentDefinition(java.lang.String name,
boolean recur)
PageNote: unlike LanguageDefinition.getComponentDefinition(java.lang.String),
this method doesn't throw ComponentNotFoundException if not found.
It just returns null.
getComponentDefinition in interface Pagerecur - whether to look up the component from Page.getLanguageDefinition()
public ComponentDefinition getComponentDefinition(java.lang.Class cls,
boolean recur)
PageNote: unlike LanguageDefinition.getComponentDefinition(java.lang.String),
this method doesn't throw ComponentNotFoundException if not found.
It just returns null.
getComponentDefinition in interface Pagerecur - whether to look up the component from Page.getLanguageDefinition()public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||