public class StateContext
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private class |
StateContext.AddRemoveListener |
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.
|
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
KEY |
private static java.util.logging.Logger |
LOGGER |
private StateContext.AddRemoveListener |
modListener |
private boolean |
partial |
private boolean |
partialLocked |
private ApplicationStateInfo |
stateInfo |
private boolean |
trackMods |
private java.lang.ref.WeakReference<javax.faces.component.UIViewRoot> |
viewRootRef |
Modifier | Constructor and Description |
---|---|
private |
StateContext(ApplicationStateInfo stateInfo) |
Modifier and Type | Method and Description |
---|---|
boolean |
componentAddedDynamically(javax.faces.component.UIComponent c) |
private StateContext.AddRemoveListener |
createAddRemoveListener(javax.faces.context.FacesContext context,
javax.faces.component.UIViewRoot root) |
private int |
decrementDynamicChildCount(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent parent) |
java.util.List<ComponentStruct> |
getDynamicActions()
Get the dynamic list (of adds and removes).
|
java.util.HashMap<java.lang.String,javax.faces.component.UIComponent> |
getDynamicComponents()
Get the hash map of dynamic components.
|
int |
getIndexOfDynamicallyAddedChildInParent(javax.faces.component.UIComponent c) |
static StateContext |
getStateContext(javax.faces.context.FacesContext ctx) |
boolean |
hasOneOrMoreDynamicChild(javax.faces.component.UIComponent parent) |
private int |
incrementDynamicChildCount(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent parent) |
boolean |
isPartialStateSaving(javax.faces.context.FacesContext ctx,
java.lang.String viewId) |
static void |
release(javax.faces.context.FacesContext facesContext)
Release the state context.
|
void |
setTrackViewModifications(boolean trackMods)
Toggles the current modification tracking status.
|
void |
startTrackViewModifications(javax.faces.context.FacesContext ctx,
javax.faces.component.UIViewRoot root)
Installs a
SystemEventListener on the UIViewRoot
to track components added to or removed from the view. |
boolean |
trackViewModifications() |
private static final java.lang.String KEY
private boolean partial
private boolean partialLocked
private boolean trackMods
private StateContext.AddRemoveListener modListener
private ApplicationStateInfo stateInfo
private java.lang.ref.WeakReference<javax.faces.component.UIViewRoot> viewRootRef
private static final java.util.logging.Logger LOGGER
private StateContext(ApplicationStateInfo stateInfo)
public static void release(javax.faces.context.FacesContext facesContext)
facesContext
- the Faces context.public static StateContext getStateContext(javax.faces.context.FacesContext ctx)
ctx
- the FacesContext
for the current requestStateContext
for this requestpublic boolean isPartialStateSaving(javax.faces.context.FacesContext ctx, java.lang.String viewId)
ctx
- FacesContext.viewId
- the view ID to check or null if viewId is unknown.true
if partial state saving should be used for the
specified view ID, otherwise false
public boolean trackViewModifications()
true
if view modifications outside of the initial
construction of the view are being tracked.public void startTrackViewModifications(javax.faces.context.FacesContext ctx, javax.faces.component.UIViewRoot root)
SystemEventListener
on the UIViewRoot
to track components added to or removed from the view.public void setTrackViewModifications(boolean trackMods)
trackMods
- if true
and the listener installed by
{@link #startTrackViewModifications(javax.faces.context.FacesContext, javax.faces.component.UIViewRoot)
is present, then view modifications will be tracked. If
false
, then modification events will be ignored.public boolean componentAddedDynamically(javax.faces.component.UIComponent c)
c
- the UIComponent to checktrue
if the component was added after the initial
view constructionpublic int getIndexOfDynamicallyAddedChildInParent(javax.faces.component.UIComponent c)
public boolean hasOneOrMoreDynamicChild(javax.faces.component.UIComponent parent)
private int incrementDynamicChildCount(javax.faces.context.FacesContext context, javax.faces.component.UIComponent parent)
private int decrementDynamicChildCount(javax.faces.context.FacesContext context, javax.faces.component.UIComponent parent)
public java.util.List<ComponentStruct> getDynamicActions()
public java.util.HashMap<java.lang.String,javax.faces.component.UIComponent> getDynamicComponents()
private StateContext.AddRemoveListener createAddRemoveListener(javax.faces.context.FacesContext context, javax.faces.component.UIViewRoot root)
Copyright © 2002-2013 Oracle America, Inc. All Rights Reserved.