public class FaceletFullStateManagementStrategy
extends javax.faces.view.StateManagementStrategy
Modifier and Type | Class and Description |
---|---|
private static class |
FaceletFullStateManagementStrategy.FacetNode
Inner class used to store a facet in the saved component tree.
|
private static class |
FaceletFullStateManagementStrategy.TreeNode
Inner class used to store a node in the saved component tree.
|
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,java.lang.Class<?>> |
classMap
Stores the class map.
|
private boolean |
isDevelopmentMode
Are we in development mode.
|
private static java.util.logging.Logger |
LOGGER
Stores the logger.
|
private static java.lang.String |
SKIP_ITERATION_HINT
Stores the skip hint.
|
Constructor and Description |
---|
FaceletFullStateManagementStrategy()
Constructor.
|
FaceletFullStateManagementStrategy(javax.faces.context.FacesContext context)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
private void |
captureChild(java.util.List<FaceletFullStateManagementStrategy.TreeNode> tree,
int parent,
javax.faces.component.UIComponent c)
Capture the child.
|
private void |
captureFacet(java.util.List<FaceletFullStateManagementStrategy.TreeNode> tree,
int parent,
java.lang.String name,
javax.faces.component.UIComponent c)
Capture the facet.
|
private void |
captureRest(java.util.List<FaceletFullStateManagementStrategy.TreeNode> tree,
int pos,
javax.faces.component.UIComponent c)
Capture the rest.
|
private int |
getProperChildIndex(javax.faces.component.UIComponent component)
Helper method that determines what the index of the given child component
will be taking transient siblings into account.
|
private javax.faces.component.UIComponent |
locateComponentByClientId(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent subTree,
java.lang.String clientId)
Find the given component in the component tree.
|
private javax.faces.component.UIComponent |
newInstance(FaceletFullStateManagementStrategy.TreeNode n)
Create a new component instance.
|
private void |
pruneAndReAddToDynamicActions(java.util.List<ComponentStruct> dynamicActionList,
ComponentStruct struct)
Methods that takes care of pruning and re-adding an action to the dynamic
action list.
|
private void |
restoreComponentState(javax.faces.context.FacesContext context,
java.util.HashMap<java.lang.String,java.lang.Object> state)
Restore the component state.
|
private void |
restoreDynamicActions(javax.faces.context.FacesContext context,
StateContext stateContext,
java.util.HashMap<java.lang.String,java.lang.Object> state)
Restore the list of dynamic actions and replay them.
|
private void |
restoreDynamicAdd(javax.faces.context.FacesContext context,
java.util.Map<java.lang.String,java.lang.Object> state,
ComponentStruct struct)
Method that takes care of restoring a dynamic add.
|
private void |
restoreDynamicRemove(javax.faces.context.FacesContext context,
ComponentStruct struct)
Method that takes care of restoring a dynamic remove.
|
private javax.faces.component.UIViewRoot |
restoreTree(javax.faces.context.FacesContext context,
java.lang.String renderKitId,
java.lang.Object[] tree)
Restore the component tree.
|
javax.faces.component.UIViewRoot |
restoreView(javax.faces.context.FacesContext context,
java.lang.String viewId,
java.lang.String renderKitId)
Restore the view.
|
private java.lang.Object |
saveComponentState(javax.faces.context.FacesContext context)
Save the component state.
|
private void |
saveDynamicActions(javax.faces.context.FacesContext context,
StateContext stateContext,
javax.faces.component.UIViewRoot viewRoot)
Save the dynamic actions.
|
java.lang.Object |
saveView(javax.faces.context.FacesContext context)
Save the view.
|
private static final java.util.logging.Logger LOGGER
private static java.lang.String SKIP_ITERATION_HINT
private java.util.Map<java.lang.String,java.lang.Class<?>> classMap
private boolean isDevelopmentMode
public FaceletFullStateManagementStrategy()
public FaceletFullStateManagementStrategy(javax.faces.context.FacesContext context)
context
- the Faces context.private void captureChild(java.util.List<FaceletFullStateManagementStrategy.TreeNode> tree, int parent, javax.faces.component.UIComponent c)
tree
- the tree.parent
- the parent.c
- the component.private void captureFacet(java.util.List<FaceletFullStateManagementStrategy.TreeNode> tree, int parent, java.lang.String name, javax.faces.component.UIComponent c)
tree
- the tree.parent
- the parent.name
- the facet name.c
- the component.private void captureRest(java.util.List<FaceletFullStateManagementStrategy.TreeNode> tree, int pos, javax.faces.component.UIComponent c)
tree
- the tree.pos
- the position.c
- the component.private javax.faces.component.UIComponent locateComponentByClientId(javax.faces.context.FacesContext context, javax.faces.component.UIComponent subTree, java.lang.String clientId)
context
- the Faces context.clientId
- the client id of the component to find.private javax.faces.component.UIComponent newInstance(FaceletFullStateManagementStrategy.TreeNode n) throws javax.faces.FacesException
n
- the tree node.javax.faces.FacesException
- when a serious error occurs.private void pruneAndReAddToDynamicActions(java.util.List<ComponentStruct> dynamicActionList, ComponentStruct struct)
If you remove a component, re-add it to the same parent and then remove it again, you only have to capture the FIRST remove. Similarly if you add a component, remove it, and then re-add it to the same parent you only need to capture the LAST add.
dynamicActionList
- the dynamic action list.struct
- the component struct to add.private void restoreComponentState(javax.faces.context.FacesContext context, java.util.HashMap<java.lang.String,java.lang.Object> state)
context
- the Faces context.state
- the component state.private void restoreDynamicActions(javax.faces.context.FacesContext context, StateContext stateContext, java.util.HashMap<java.lang.String,java.lang.Object> state)
context
- the Faces context.stateContext
- the state context.stateMap
- the state.viewRoot
- the view root.private void restoreDynamicAdd(javax.faces.context.FacesContext context, java.util.Map<java.lang.String,java.lang.Object> state, ComponentStruct struct)
context
- the Faces context.state
- the state.struct
- the component struct.private void restoreDynamicRemove(javax.faces.context.FacesContext context, ComponentStruct struct)
context
- the Faces context.struct
- the component struct.private javax.faces.component.UIViewRoot restoreTree(javax.faces.context.FacesContext context, java.lang.String renderKitId, java.lang.Object[] tree) throws javax.faces.FacesException
context
- the Faces context.renderKitId
- the render kit id.tree
- the saved tree.javax.faces.FacesException
- when a serious error occurs.public javax.faces.component.UIViewRoot restoreView(javax.faces.context.FacesContext context, java.lang.String viewId, java.lang.String renderKitId)
restoreView
in class javax.faces.view.StateManagementStrategy
context
- the Faces context.viewId
- the view id.renderKitId
- the render kit id.private java.lang.Object saveComponentState(javax.faces.context.FacesContext context)
context
- the Faces context.private void saveDynamicActions(javax.faces.context.FacesContext context, StateContext stateContext, javax.faces.component.UIViewRoot viewRoot)
context
- the Faces context.stateContext
- the state context.stateMap
- the state.public java.lang.Object saveView(javax.faces.context.FacesContext context)
saveView
in class javax.faces.view.StateManagementStrategy
context
- the Faces context.private int getProperChildIndex(javax.faces.component.UIComponent component)
component
- the UI component.Copyright © 2002-2013 Oracle America, Inc. All Rights Reserved.