Class StateContext


  • public class StateContext
    extends Object
    Context for dealing with partial state saving mechanics.
    • Method Detail

      • release

        public static void release​(FacesContext facesContext)
        Release the state context.
        Parameters:
        facesContext - the Faces context.
      • getStateContext

        public static StateContext getStateContext​(FacesContext ctx)
        Parameters:
        ctx - the FacesContext for the current request
        Returns:
        StateContext for this request
      • isPartialStateSaving

        public boolean isPartialStateSaving​(FacesContext ctx,
                                            String viewId)
        Parameters:
        ctx - FacesContext.
        viewId - the view ID to check or null if viewId is unknown.
        Returns:
        true if partial state saving should be used for the specified view ID, otherwise false
      • trackViewModifications

        public boolean trackViewModifications()
        Returns:
        true if view modifications outside of the initial construction of the view are being tracked.
      • startTrackViewModifications

        public void startTrackViewModifications​(FacesContext ctx,
                                                UIViewRoot root)
        Installs a SystemEventListener on the UIViewRoot to track components added to or removed from the view.
        Parameters:
        ctx - the involved faces context
        root - the involved view root
      • setTrackViewModifications

        public void setTrackViewModifications​(boolean trackMods)
        Toggles the current modification tracking status.
        Parameters:
        trackMods - if true and the listener installed by startTrackViewModifications is* present, then view modifications will be tracked. If false, then modification events will be ignored.
      • componentAddedDynamically

        public boolean componentAddedDynamically​(UIComponent c)
        Parameters:
        c - the UIComponent to check
        Returns:
        true if the component was added after the initial view construction
      • getIndexOfDynamicallyAddedChildInParent

        public int getIndexOfDynamicallyAddedChildInParent​(UIComponent c)
      • hasOneOrMoreDynamicChild

        public boolean hasOneOrMoreDynamicChild​(UIComponent parent)
      • getDynamicActions

        public List<ComponentStruct> getDynamicActions()
        Get the dynamic list (of adds and removes).
        Returns:
        the dynamic list
      • getDynamicComponents

        public HashMap<String,​UIComponent> getDynamicComponents()
        Get the hash map of dynamic components.
        Returns:
        the hash map of dynamic components.