Class AbstractUiFactory

    • Constructor Detail

      • AbstractUiFactory

        public AbstractUiFactory()
    • Method Detail

      • start

        public void start​(WebApp wapp)
        Description copied from interface: UiFactory
        Starts this factory.
        Specified by:
        start in interface UiFactory
      • stop

        public void stop​(WebApp wapp)
        Description copied from interface: UiFactory
        Stops this factory.
        Specified by:
        stop in interface UiFactory
      • getRichlet

        public Richlet getRichlet​(RequestInfo ri,
                                  java.lang.String path)
        Description copied from interface: UiFactory
        Returns a richlet for specified request, or null if the richlet is not found..
        Specified by:
        getRichlet in interface UiFactory
      • newDesktop

        public Desktop newDesktop​(RequestInfo ri,
                                  java.lang.String updateURI,
                                  java.lang.String path)
        Description copied from interface: UiFactory
        Creates an instance of Desktop.

        Note: the returned instance must also implement DesktopCtrl.

        Specified by:
        newDesktop in interface UiFactory
        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 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.
      • newDesktop

        public Desktop newDesktop​(RequestInfo ri,
                                  java.lang.String updateURI,
                                  java.lang.String resourceURI,
                                  java.lang.String path)
        Description copied from interface: UiFactory
        Creates an instance of Desktop.

        Note: the returned instance must also implement DesktopCtrl.

        Specified by:
        newDesktop in interface UiFactory
        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 implement Desktop.getUpdateURI(java.lang.String)
        resourceURI - the URI that is used to get ZK resource
        path - the path to request this desktop, such as "/test/test.zul", or null if it is caused by a filter.
      • newPage

        public Page newPage​(RequestInfo ri,
                            PageDefinition pagedef,
                            java.lang.String path)
        Description copied from interface: UiFactory
        Creates an instance of Page for the specified page definition.

        Note: the returned instance must also implement PageCtrl.

        Specified by:
        newPage in interface UiFactory
        Parameters:
        ri - 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.
      • newPage

        public Page newPage​(RequestInfo ri,
                            Richlet richlet,
                            java.lang.String path)
        Description copied from interface: UiFactory
        Creates an instance of Page for the specified richlet.

        Note: the returned instance must also implement PageCtrl.

        Specified by:
        newPage in interface UiFactory
      • newComponent

        public Component newComponent​(Page page,
                                      Component parent,
                                      ShadowInfo compInfo,
                                      Component insertBefore)
        Description copied from interface: UiFactory
        Creates and initializes a shadow based on the specified 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.

        Specified by:
        newComponent in interface UiFactory
        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: UiFactory
        Creates and initializes a component based on the specified 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.

        Specified by:
        newComponent in interface UiFactory
        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,
                                      java.lang.String clsnm)
        Description copied from interface: UiFactory
        Creates and initializes a component based on the specified 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.

        Specified by:
        newComponent in interface UiFactory
        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

        public Composer newComposer​(Page page,
                                    java.lang.Class klass)
        Instantiates a composer of the given class.

        Default: creates an instance of klass by use of its no-arg constructor.

        Specified by:
        newComposer in interface UiFactory
        Parameters:
        page - the page that the composer will be created for.
        Since:
        6.0.0
      • newComposer

        public Composer newComposer​(Page page,
                                    java.lang.String className)
                             throws java.lang.ClassNotFoundException
        Instantiates a composer of the given class name.

        Default: use Page.resolveClass(java.lang.String) to resolve the class and then invoke newComposer(Page, Class) to instantiate an instance.

        Specified by:
        newComposer in interface UiFactory
        Parameters:
        page - the page that the composer will be created for.
        Throws:
        java.lang.ClassNotFoundException
        Since:
        6.0.0
      • newServerPush

        public ServerPush newServerPush​(Desktop desktop,
                                        java.lang.Class klass)
        Instantiates a server push of the given class.

        Default: creates an instance of klass by use of its no-arg constructor.

        Specified by:
        newServerPush in interface UiFactory
        Parameters:
        desktop - the desktop that the server push will be created for.
        Since:
        6.0.0
      • getPageDefinitionDirectly

        public PageDefinition getPageDefinitionDirectly​(RequestInfo ri,
                                                        java.lang.String content,
                                                        java.lang.String extension)
        Returns the page definition of the specified content; never null.

        Dependency: Execution.createComponentsDirectly -& Execution.getPageDefinitionDirectly -& UiFactory.getPageDefiitionDirectly -& PageDefintions.getPageDefinitionDirectly

        Specified by:
        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.
        See Also:
        UiFactory.getPageDefinition(org.zkoss.zk.ui.sys.RequestInfo, java.lang.String)