Class AbstractUiFactory
- All Implemented Interfaces:
UiFactory
- Direct Known Subclasses:
SerializableUiFactory,SimpleUiFactory
UiFactory.
Derived class must implement UiFactory.newSession(org.zkoss.zk.ui.WebApp, java.lang.Object, java.lang.Object), which
depends on the Web container.
- Author:
- tomyeh
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetPageDefinition(RequestInfo ri, String path) Returns the page definition of the specified path, or null if not found.getPageDefinitionDirectly(RequestInfo ri, Reader reader, String extension) Returns the page definition of the specified reader; never null.getPageDefinitionDirectly(RequestInfo ri, String content, String extension) Returns the page definition of the specified content; never null.getPageDefinitionDirectly(RequestInfo ri, org.zkoss.idom.Document content, String extension) Returns the page definition of the specified content; never null.getRichlet(RequestInfo ri, String path) Returns a richlet for specified request, or null if the richlet is not found..booleanisRichlet(RequestInfo ri, boolean bRichlet) Tests whether the specified request is a richlet.newComponent(Page page, Component parent, ComponentDefinition compdef, String clsnm) Creates and initializes a component based on the specifiedComponentDefinition.newComponent(Page page, Component parent, ComponentInfo compInfo, Component insertBefore) Creates and initializes a component based on the specifiedComponentInfo.newComponent(Page page, Component parent, ShadowInfo compInfo, Component insertBefore) Creates and initializes a shadow based on the specifiedShadowInfo.newComposer(Page page, Class klass) Instantiates a composer of the given class.newComposer(Page page, String className) Instantiates a composer of the given class name.newDesktop(RequestInfo ri, String updateURI, String path) Creates an instance ofDesktop.newDesktop(RequestInfo ri, String updateURI, String resourceURI, String path) Creates an instance ofDesktop.newPage(RequestInfo ri, PageDefinition pagedef, String path) Creates an instance ofPagefor the specified page definition.newPage(RequestInfo ri, Richlet richlet, String path) Creates an instance ofPagefor the specified richlet.newServerPush(Desktop desktop, Class klass) Instantiates a server push of the given class.voidStarts this factory.voidStops this factory.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.zkoss.zk.ui.sys.UiFactory
newSession
-
Constructor Details
-
AbstractUiFactory
public AbstractUiFactory()
-
-
Method Details
-
start
Description copied from interface:UiFactoryStarts this factory. -
stop
Description copied from interface:UiFactoryStops this factory. -
isRichlet
Description copied from interface:UiFactoryTests whether the specified request is a richlet.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. -
getRichlet
Description copied from interface:UiFactoryReturns a richlet for specified request, or null if the richlet is not found..- Specified by:
getRichletin interfaceUiFactory
-
newDesktop
Description copied from interface:UiFactoryCreates an instance ofDesktop.Note: the returned instance must also implement
DesktopCtrl.- Specified by:
newDesktopin interfaceUiFactory- Parameters:
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 implementDesktop.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.
-
newDesktop
Description copied from interface:UiFactoryCreates an instance ofDesktop.Note: the returned instance must also implement
DesktopCtrl.- Specified by:
newDesktopin interfaceUiFactory- Parameters:
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 implementDesktop.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.
-
newPage
Description copied from interface:UiFactory -
newPage
Description copied from interface:UiFactory -
newComponent
public Component newComponent(Page page, Component parent, ShadowInfo compInfo, Component insertBefore) Description copied from interface:UiFactoryCreates and initializes a shadow based on the specifiedShadowInfo.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.
- Specified by:
newComponentin interfaceUiFactory- Parameters:
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 information
-
newComponent
public Component newComponent(Page page, Component parent, ComponentInfo compInfo, Component insertBefore) Description copied from interface:UiFactoryCreates and initializes a component based on the specifiedComponentInfo.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
ComponentDefinitionandComponentInfoare all applied to the new component.- Specified by:
newComponentin interfaceUiFactory- Parameters:
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 information
-
newComponent
public Component newComponent(Page page, Component parent, ComponentDefinition compdef, String clsnm) Description copied from interface:UiFactoryCreates and initializes a component based on the specifiedComponentDefinition.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
ComponentDefinitionare all applied to the new component.- Specified by:
newComponentin interfaceUiFactory- Parameters:
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.
-
newComposer
Instantiates a composer of the given class.Default: creates an instance of klass by use of its no-arg constructor.
- Specified by:
newComposerin interfaceUiFactory- Parameters:
page- the page that the composer will be created for.- Since:
- 6.0.0
-
newComposer
Instantiates a composer of the given class name.Default: use
Page.resolveClass(java.lang.String)to resolve the class and then invokenewComposer(Page, Class)to instantiate an instance.- Specified by:
newComposerin interfaceUiFactory- Parameters:
page- the page that the composer will be created for.- Throws:
ClassNotFoundException- Since:
- 6.0.0
-
newServerPush
Instantiates a server push of the given class.Default: creates an instance of klass by use of its no-arg constructor.
- Specified by:
newServerPushin interfaceUiFactory- Parameters:
desktop- the desktop that the server push will be created for.- Since:
- 6.0.0
-
getPageDefinition
Returns the page definition of the specified path, or null if not found.Dependency: Execution.createComponents -& Execution.getPageDefinition -& UiFactory.getPageDefiition -& PageDefinitions.getPageDefinition
- Specified by:
getPageDefinitionin interfaceUiFactory- Parameters:
ri- the additional request information.path- the path to request this page.- See Also:
-
getPageDefinitionDirectly
Returns the page definition of the specified content; never null.Dependency: Execution.createComponentsDirectly -& Execution.getPageDefinitionDirectly -& UiFactory.getPageDefiitionDirectly -& PageDefintions.getPageDefinitionDirectly
- Specified by:
getPageDefinitionDirectlyin interfaceUiFactorycontent- 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.- See Also:
-
getPageDefinitionDirectly
public PageDefinition getPageDefinitionDirectly(RequestInfo ri, org.zkoss.idom.Document content, String extension) Description copied from interface:UiFactoryReturns the page definition of the specified content; never null.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.- Specified by:
getPageDefinitionDirectlyin interfaceUiFactorycontent- 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.- See Also:
-
getPageDefinitionDirectly
public PageDefinition getPageDefinitionDirectly(RequestInfo ri, Reader reader, String extension) throws IOException Description copied from interface:UiFactoryReturns the page definition of the specified reader; never null.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.- Specified by:
getPageDefinitionDirectlyin interfaceUiFactoryreader- 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.- Throws:
IOException- See Also:
-