public abstract class AbstractUiFactory extends java.lang.Object implements UiFactory
UiFactory
.
Derived class must implement UiFactory.newSession(org.zkoss.zk.ui.WebApp, java.lang.Object, java.lang.Object)
, which
depends on the Web container.
Constructor and Description |
---|
AbstractUiFactory() |
Modifier and Type | Method and Description |
---|---|
PageDefinition |
getPageDefinition(RequestInfo ri,
java.lang.String path)
Returns the page definition of the specified path, or null if not found.
|
PageDefinition |
getPageDefinitionDirectly(RequestInfo ri,
Document content,
java.lang.String extension)
Returns the page definition of the specified content; never null.
|
PageDefinition |
getPageDefinitionDirectly(RequestInfo ri,
java.io.Reader reader,
java.lang.String extension)
Returns the page definition of the specified reader; never null.
|
PageDefinition |
getPageDefinitionDirectly(RequestInfo ri,
java.lang.String content,
java.lang.String extension)
Returns the page definition of the specified content; never null.
|
Richlet |
getRichlet(RequestInfo ri,
java.lang.String path)
Returns a richlet for specified request, or null if the richlet is not found..
|
boolean |
isRichlet(RequestInfo ri,
boolean bRichlet)
Tests whether the specified request is a richlet.
|
Component |
newComponent(Page page,
Component parent,
ComponentDefinition compdef,
java.lang.String clsnm)
Creates and initializes a component based on the specified
ComponentDefinition . |
Component |
newComponent(Page page,
Component parent,
ComponentInfo compInfo,
Component insertBefore)
Creates and initializes a component based on the specified
ComponentInfo . |
Component |
newComponent(Page page,
Component parent,
ShadowInfo compInfo,
Component insertBefore)
Creates and initializes a shadow based on the specified
ShadowInfo . |
Composer |
newComposer(Page page,
java.lang.Class klass)
Instantiates a composer of the given class.
|
Composer |
newComposer(Page page,
java.lang.String className)
Instantiates a composer of the given class name.
|
Desktop |
newDesktop(RequestInfo ri,
java.lang.String updateURI,
java.lang.String path)
Creates an instance of
Desktop . |
Desktop |
newDesktop(RequestInfo ri,
java.lang.String updateURI,
java.lang.String resourceURI,
java.lang.String path)
Creates an instance of
Desktop . |
Page |
newPage(RequestInfo ri,
PageDefinition pagedef,
java.lang.String path)
Creates an instance of
Page for the specified page definition. |
Page |
newPage(RequestInfo ri,
Richlet richlet,
java.lang.String path)
Creates an instance of
Page for the specified richlet. |
ServerPush |
newServerPush(Desktop desktop,
java.lang.Class klass)
Instantiates a server push of the given class.
|
void |
start(WebApp wapp)
Starts this factory.
|
void |
stop(WebApp wapp)
Stops this factory.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
newSession
public void start(WebApp wapp)
UiFactory
public boolean isRichlet(RequestInfo ri, boolean bRichlet)
UiFactory
If this method returns true, UiFactory.getRichlet(org.zkoss.zk.ui.sys.RequestInfo, java.lang.String)
is called to create
the richlet. Otherwise, UiFactory.getPageDefinition(org.zkoss.zk.ui.sys.RequestInfo, java.lang.String)
is called to retrieve
the page definition from a ZUML page.
public Richlet getRichlet(RequestInfo ri, java.lang.String path)
UiFactory
getRichlet
in interface UiFactory
public Desktop newDesktop(RequestInfo ri, java.lang.String updateURI, java.lang.String path)
UiFactory
Desktop
.
Note: the returned instance must also implement DesktopCtrl
.
newDesktop
in interface UiFactory
ri
- the additional request information.updateURI
- the URI that is used as the base to generate
URI for asynchronous updates. In other words, it is used to
implement Desktop.getUpdateURI(java.lang.String)
path
- the path to request this desktop, such as "/test/test.zul",
or null if it is caused by a filter.public Desktop newDesktop(RequestInfo ri, java.lang.String updateURI, java.lang.String resourceURI, java.lang.String path)
UiFactory
Desktop
.
Note: the returned instance must also implement DesktopCtrl
.
newDesktop
in interface UiFactory
ri
- the additional request information.updateURI
- the URI that is used as the base to generate
URI for asynchronous updates. In other words, it is used to
implement Desktop.getUpdateURI(java.lang.String)
resourceURI
- the URI that is used to get ZK resourcepath
- the path to request this desktop, such as "/test/test.zul",
or null if it is caused by a filter.public Page newPage(RequestInfo ri, PageDefinition pagedef, java.lang.String path)
UiFactory
public Page newPage(RequestInfo ri, Richlet richlet, java.lang.String path)
UiFactory
public Component newComponent(Page page, Component parent, ShadowInfo compInfo, Component insertBefore)
UiFactory
ShadowInfo
.
After called, the new shadow element is added to the host component, if any. In addition, the properties are all applied to the new shadow element.
newComponent
in interface UiFactory
page
- the page that the host component belongs to (never null).parent
- the parent shadow, or null if the new shadow is root.compInfo
- the shadow informationpublic Component newComponent(Page page, Component parent, ComponentInfo compInfo, Component insertBefore)
UiFactory
ComponentInfo
.
After called, the new component is added to the page, and becomes a
child of the specified parent, if any. In addition, the properties
and custom attributes defined in ComponentDefinition
and ComponentInfo
are all
applied to the new component.
newComponent
in interface UiFactory
page
- the page that the new component belongs to (never null).parent
- the parent component, or null if the new component is root.compInfo
- the component informationpublic Component newComponent(Page page, Component parent, ComponentDefinition compdef, java.lang.String clsnm)
UiFactory
ComponentDefinition
.
After called, the new component is added to the page, and becomes a
child of the specified parent, if any. In addition, the properties
and custom attributes defined in ComponentDefinition
are all
applied to the new component.
newComponent
in interface UiFactory
page
- the page that the new component belongs to (never null).parent
- the parent component, or null if the new component is root.clsnm
- the implementation class of the component.
If null, ComponentDefinition.getImplementationClass()
will
be used.public Composer newComposer(Page page, java.lang.Class klass)
Default: creates an instance of klass by use of its no-arg constructor.
newComposer
in interface UiFactory
page
- the page that the composer will be created for.public Composer newComposer(Page page, java.lang.String className) throws java.lang.ClassNotFoundException
Default: use Page.resolveClass(java.lang.String)
to resolve the class
and then invoke newComposer(Page, Class)
to instantiate an instance.
newComposer
in interface UiFactory
page
- the page that the composer will be created for.java.lang.ClassNotFoundException
public ServerPush newServerPush(Desktop desktop, java.lang.Class klass)
Default: creates an instance of klass by use of its no-arg constructor.
newServerPush
in interface UiFactory
desktop
- the desktop that the server push will be created for.public PageDefinition getPageDefinition(RequestInfo ri, java.lang.String path)
Dependency: Execution.createComponents -& Execution.getPageDefinition -& UiFactory.getPageDefiition -& PageDefinitions.getPageDefinition
getPageDefinition
in interface UiFactory
ri
- the additional request information.path
- the path to request this page.UiFactory.getPageDefinitionDirectly(org.zkoss.zk.ui.sys.RequestInfo, java.lang.String, java.lang.String)
public PageDefinition getPageDefinitionDirectly(RequestInfo ri, java.lang.String content, java.lang.String extension)
Dependency: Execution.createComponentsDirectly -& Execution.getPageDefinitionDirectly -& UiFactory.getPageDefiitionDirectly -& PageDefintions.getPageDefinitionDirectly
getPageDefinitionDirectly
in interface UiFactory
content
- the raw content of the page. It must be in ZUML.extension
- the default extension if doc doesn't specify
an language. Ignored if null.
If extension is null and the content doesn't specify a language,
the language called "xul/html" is assumed.UiFactory.getPageDefinition(org.zkoss.zk.ui.sys.RequestInfo, java.lang.String)
public PageDefinition getPageDefinitionDirectly(RequestInfo ri, Document content, java.lang.String extension)
UiFactory
It is called when Execution.getPageDefinitionDirectly(Document, String)
is going to generate a page definition for the content it intercepts.
Implementation NOTE: DO NOT invoke
Execution.getPageDefinitionDirectly(Document, String)
.
Otherwise, an endless loop occurs.
getPageDefinitionDirectly
in interface UiFactory
content
- the raw content of the page in DOM.extension
- the default extension if doc doesn't specify
an language. Ignored if null.
If extension is null and the content doesn't specify a language,
the language called "xul/html" is assumed.UiFactory.getPageDefinition(org.zkoss.zk.ui.sys.RequestInfo, java.lang.String)
public PageDefinition getPageDefinitionDirectly(RequestInfo ri, java.io.Reader reader, java.lang.String extension) throws java.io.IOException
UiFactory
It is called when Execution.getPageDefinitionDirectly(Reader, String)
is going to generate a page definition for the content it intercepts.
Implementation NOTE: DO NOT invoke
Execution.getPageDefinitionDirectly(Reader, String)
.
Otherwise, an endless loop occurs.
getPageDefinitionDirectly
in interface UiFactory
reader
- the reader to retrieve the raw content in ZUML.extension
- the default extension if doc doesn't specify
an language. Ignored if null.
If extension is null and the content doesn't specify a language,
the language called "xul/html" is assumed.java.io.IOException
UiFactory.getPageDefinition(org.zkoss.zk.ui.sys.RequestInfo, java.lang.String)
Copyright © 2005-2023 Potix Corporation. All Rights Reserved.