|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.zk.ui.impl.AbstractUiFactory
public abstract class AbstractUiFactory
The skeletal implementation of 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 Summary | |
|---|---|
AbstractUiFactory()
|
|
| Method Summary | |
|---|---|
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. |
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. |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.zkoss.zk.ui.sys.UiFactory |
|---|
newSession |
| Constructor Detail |
|---|
public AbstractUiFactory()
| Method Detail |
|---|
public void start(WebApp wapp)
UiFactory
start in interface UiFactorypublic void stop(WebApp wapp)
UiFactory
stop in interface UiFactory
public boolean isRichlet(RequestInfo ri,
boolean bRichlet)
UiFactoryIf 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.
isRichlet in interface UiFactorybRichlet - the default value that this method shall return.
It is a suggestion. If you don't know what to do, just return bRichlet.
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)
UiFactoryDesktop.
Note: the returned instance must also implement DesktopCtrl.
newDesktop in interface UiFactoryri - 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 Page newPage(RequestInfo ri,
PageDefinition pagedef,
java.lang.String path)
UiFactoryPage for the specified page definition.
Note: the returned instance must also implement PageCtrl.
newPage in interface UiFactoryri - the additional request information.pagedef - the page definition. If null, it means the page is served
by a Richlet instance.path - the path to request this page, or null if it is caused
by a filter.
public Page newPage(RequestInfo ri,
Richlet richlet,
java.lang.String path)
UiFactoryPage for the specified richlet.
Note: the returned instance must also implement PageCtrl.
newPage in interface UiFactory
public Component newComponent(Page page,
Component parent,
ComponentInfo compInfo,
Component insertBefore)
UiFactoryComponentInfo.
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 UiFactorypage - 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 information
public Component newComponent(Page page,
Component parent,
ComponentDefinition compdef,
java.lang.String clsnm)
UiFactoryComponentDefinition.
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 UiFactorypage - 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 UiFactorypage - 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 UiFactorypage - 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 UiFactorydesktop - 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 UiFactoryri - 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 UiFactorycontent - 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)
UiFactoryIt 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 UiFactorycontent - 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
UiFactoryIt 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 UiFactoryreader - 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.IOExceptionUiFactory.getPageDefinition(org.zkoss.zk.ui.sys.RequestInfo, java.lang.String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||