Package com.sun.faces.context
Class StateContext
java.lang.Object
com.sun.faces.context.StateContext
public class StateContext extends Object
Context for dealing with partial state saving mechanics.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
StateContext.DynamicAddRemoveListener
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
StateContext.NoopAddRemoveListener
class
StateContext.StatelessAddRemoveListener
An AddRemoveListener that implements the new dynamic component strategy where no state is managed by the listener itself. -
Method Summary
Modifier and Type Method Description boolean
componentAddedDynamically(UIComponent c)
List<ComponentStruct>
getDynamicActions()
Get the dynamic list (of adds and removes).HashMap<String,UIComponent>
getDynamicComponents()
Get the hash map of dynamic components.int
getIndexOfDynamicallyAddedChildInParent(UIComponent c)
static StateContext
getStateContext(FacesContext ctx)
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
trackViewModifications()
-
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. -
setTrackViewModifications
public void setTrackViewModifications(boolean trackMods)Toggles the current modification tracking status.- Parameters:
trackMods
- iftrue
and the listener installed byis present, then view modifications will be tracked. If
false
, 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). -
getDynamicComponents
Get the hash map of dynamic components.- Returns:
- the hash map of dynamic components.
-