Package com.sun.faces.context
Class StateContext
java.lang.Object
com.sun.faces.context.StateContext
Context for dealing with partial state saving mechanics.
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
A system event listener which is used to listen for changes on the component tree after restore view and before rendering out the view.class
class
An AddRemoveListener that implements the new dynamic component strategy where no state is managed by the listener itself. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Get the dynamic list (of adds and removes).Get the hash map of dynamic components.int
static StateContext
boolean
hasOneOrMoreDynamicChild
(UIComponent parent) boolean
isPartialStateSaving
(FacesContext ctx, String viewId) static void
release
(FacesContext facesContext) Release the state context.void
setTrackViewModifications
(boolean trackMods) Toggles the current modification tracking status.void
startTrackViewModifications
(FacesContext ctx, UIViewRoot root) Installs aSystemEventListener
on theUIViewRoot
to track components added to or removed from the view.boolean
-
Method Details
-
release
Release the state context.- Parameters:
facesContext
- the Faces context.
-
getStateContext
- Parameters:
ctx
- theFacesContext
for the current request- Returns:
StateContext
for this request
-
isPartialStateSaving
- 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, otherwisefalse
-
trackViewModifications
public boolean trackViewModifications()- Returns:
true
if view modifications outside of the initial construction of the view are being tracked.
-
startTrackViewModifications
Installs aSystemEventListener
on theUIViewRoot
to track components added to or removed from the view.- Parameters:
ctx
- the involved faces contextroot
- the involved view root
-
setTrackViewModifications
public void setTrackViewModifications(boolean trackMods) Toggles the current modification tracking status.- Parameters:
trackMods
- iftrue
and the listener installed bystartTrackViewModifications
is* present, then view modifications will be tracked. Iffalse
, then modification events will be ignored.
-
componentAddedDynamically
- Parameters:
c
- the UIComponent to check- Returns:
true
if the component was added after the initial view construction
-
getIndexOfDynamicallyAddedChildInParent
-
hasOneOrMoreDynamicChild
-
getDynamicActions
Get the dynamic list (of adds and removes).- Returns:
- the dynamic list
-
getDynamicComponents
Get the hash map of dynamic components.- Returns:
- the hash map of dynamic components.
-