Class UIContextDelegate

    • Constructor Detail

      • UIContextDelegate

        protected UIContextDelegate​(UIContext backing)
        Creates a UIContextDelegate. This is marked protected, as it doesn't make sense to create an instance of the delegate without changing behaviour.
        Parameters:
        backing - the backing context.
    • Method Detail

      • setBacking

        protected void setBacking​(UIContext backing)
        Sets the backing context.
        Parameters:
        backing - the backing context.
      • clearScratchMap

        public void clearScratchMap()
        Reserved for internal framework use. Clears the scratch map with phase scope.
        Specified by:
        clearScratchMap in interface UIContext
      • clearScratchMap

        public void clearScratchMap​(WComponent component)
        Reserved for internal framework use. Clears the scratch map with phase scope for the given component.
        Specified by:
        clearScratchMap in interface UIContext
        Parameters:
        component - the component to clear the scratch map for.
      • getComponents

        public Set getComponents()
        Specified by:
        getComponents in interface UIContext
        Returns:
        the set of WComponents that are storing a model.
      • getCreationTime

        public long getCreationTime()
        Returns the creation time of this UIContext, which can be used to approximate the user session creation time.
        Specified by:
        getCreationTime in interface UIContext
        Returns:
        the creation time of this UIContext.
      • getEnvironment

        public Environment getEnvironment()
        If we've got an environment, return it. Otherwise return a dummy environment.
        Specified by:
        getEnvironment in interface UIContext
        Returns:
        the current environment.
      • getFocussedId

        public String getFocussedId()
        Specified by:
        getFocussedId in interface UIContext
        Returns:
        the unique id of the focussed component for this UI.
      • getFwkAttribute

        public Object getFwkAttribute​(String name)
        Reserved for internal framework use. Retrieves a framework attribute.
        Specified by:
        getFwkAttribute in interface UIContext
        Parameters:
        name - the attribute name.
        Returns:
        the framework attribute with the given name.
      • getFwkAttributeNames

        public Set getFwkAttributeNames()
        Reserved for internal framework use.
        Specified by:
        getFwkAttributeNames in interface UIContext
        Returns:
        the names of all attributes bound to this context.
      • getHeaders

        public Headers getHeaders()
        Specified by:
        getHeaders in interface UIContext
        Returns:
        the headers instance for this UIContext.
      • getModel

        public WebModel getModel​(WebComponent component)
        Get the extrinsic state information for the given component.
        Specified by:
        getModel in interface UIContext
        Parameters:
        component - the component to get the model for.
        Returns:
        the component's model.
      • getScratchMap

        public Map getScratchMap​(WComponent component)
        Reserved for internal framework use. Retrieves a scratch area with phse scope, where data can be temporarily stored. WComponents must not rely on data being available in the scratch area after each phase.
        Specified by:
        getScratchMap in interface UIContext
        Parameters:
        component - the component to retrieve the scratch map for.
        Returns:
        the scratch map with phase scope for the given component.
      • getUI

        public WComponent getUI()
        Specified by:
        getUI in interface UIContext
        Returns:
        the top level web component for which is context applies.
      • invokeLater

        public void invokeLater​(Runnable runnable)
        Adds a runnable to the list of runnables to be invoked later. The runnable will be invoked against this UIContext.
        Specified by:
        invokeLater in interface UIContext
        Parameters:
        runnable - the runnable to add
      • invokeLater

        public void invokeLater​(UIContext uic,
                                Runnable runnable)
        Adds a runnable to the list of runnables to be invoked later against the given UIContext.
        Specified by:
        invokeLater in interface UIContext
        Parameters:
        uic - the context to run the runnable in.
        runnable - the runnable to add
      • isDummyEnvironment

        public boolean isDummyEnvironment()
        Specified by:
        isDummyEnvironment in interface UIContext
        Returns:
        true if the current environment is a 'dummy' environment.
      • removeFwkAttribute

        public void removeFwkAttribute​(String name)
        Reserved for internal framework use. Removes a framework attribute.
        Specified by:
        removeFwkAttribute in interface UIContext
        Parameters:
        name - the attribute name.
      • removeModel

        public void removeModel​(WebComponent component)
        Removes the extrinsic state information for the given component. Note that this is not recursive for the children.
        Specified by:
        removeModel in interface UIContext
        Parameters:
        component - the component to remove the model for.
      • setEnvironment

        public void setEnvironment​(Environment environment)
        Explicitly sets the environment.
        Specified by:
        setEnvironment in interface UIContext
        Parameters:
        environment - the environment to set.
      • setFocussed

        public void setFocussed​(WComponent component,
                                UIContext uic)
        Sets the component in this UIC which is to be the focus of the client browser cursor. The id of the component is used to find the focussed element in the rendered html. Since id could be different in different contexts the context of the component is also needed.
        Specified by:
        setFocussed in interface UIContext
        Parameters:
        component - - the component that sould be the cursor focus in the rendered UI.
        uic - - the context that the component exists in.
      • setFocussed

        public void setFocussed​(WComponent component)
        Sets the component in this UIC which is to be the focus of the client browser cursor. The id of the component is used to find the focussed element in the rendered html.
        Specified by:
        setFocussed in interface UIContext
        Parameters:
        component - the component that sould be the cursor focus in the rendered UI.
      • setFwkAttribute

        public void setFwkAttribute​(String name,
                                    Object value)
        Reserved for internal framework use. Sets a framework attribute.
        Specified by:
        setFwkAttribute in interface UIContext
        Parameters:
        name - the attribute name.
        value - the attribute value.
      • setModel

        public void setModel​(WebComponent component,
                             WebModel model)
        Stores the extrinsic state information for the given component.
        Specified by:
        setModel in interface UIContext
        Parameters:
        component - the component to set the model for.
        model - the model to set.
      • setUI

        public void setUI​(WComponent ui)
        For use by internal framework code only. Sets the top level web component for this context.
        Specified by:
        setUI in interface UIContext
        Parameters:
        ui - the top level web component for this context.
      • getLocale

        public Locale getLocale()
        Retrieves the locale for this context.
        Specified by:
        getLocale in interface UIContext
        Returns:
        the Locale for this context, or null if no locale has been set.
      • setLocale

        public void setLocale​(Locale locale)
        Sets the locale for this context.
        Specified by:
        setLocale in interface UIContext
        Parameters:
        locale - the Locale to set, or null for the default locale.
      • getBacking

        public UIContext getBacking()
        Returns:
        the backing context.
      • getRequestScratchMap

        public Map<Object,​Object> getRequestScratchMap​(WComponent component)
        Reserved for internal framework use. Get scratch map with request scope.
        Specified by:
        getRequestScratchMap in interface UIContext
        Parameters:
        component - the component to retrieve the scratch map for.
        Returns:
        the scratch map with request scope
      • clearRequestScratchMap

        public void clearRequestScratchMap​(WComponent component)
        Reserved for internal framework use. Clears the scratch map with request scope.
        Specified by:
        clearRequestScratchMap in interface UIContext
        Parameters:
        component - the component to clear the scratch map for.
      • clearRequestScratchMap

        public void clearRequestScratchMap()
        Reserved for internal framework use. Clears the scratch map with request scope.
        Specified by:
        clearRequestScratchMap in interface UIContext