/** * Restore the list of dynamic actions and replay them. * * @param context the Faces context. * @param stateContext the state context. * @param stateMap the state. * @param viewRoot the view root. */ private void restoreDynamicActions(FacesContext context, StateContext stateContext, Map<String, Object> stateMap) { if (LOGGER.isLoggable(Level.FINEST)) { LOGGER.finest("FaceletPartialStateManagementStrategy.restoreDynamicActions"); } List<Object> savedActions = (List<Object>) stateMap.get(DYNAMIC_ACTIONS); List<ComponentStruct> actions = stateContext.getDynamicActions(); if (savedActions != null && !savedActions.isEmpty()) { for (Object object : savedActions) { ComponentStruct action = new ComponentStruct(); action.restoreState(context, object); if (ComponentStruct.ADD.equals(action.action)) { restoreDynamicAdd(context, stateMap, action); } if (ComponentStruct.REMOVE.equals(action.action)) { restoreDynamicRemove(context, action); } pruneAndReAddToDynamicActions(actions, action); } } }
/** * Restore the list of dynamic actions and replay them. * * @param context the Faces context. * @param stateContext the state context. * @param stateMap the state. * @param viewRoot the view root. */ private void restoreDynamicActions(FacesContext context, StateContext stateContext, HashMap<String, Object> state) { if (LOGGER.isLoggable(Level.FINEST)) { LOGGER.finest("FaceletFullStateManagementStrategy.restoreDynamicActions"); } UIViewRoot viewRoot = context.getViewRoot(); List<Object> savedActions = (List<Object>) viewRoot.getAttributes().get(DYNAMIC_ACTIONS); List<ComponentStruct> actions = stateContext.getDynamicActions(); if (savedActions != null && !savedActions.isEmpty()) { for (Object object : savedActions) { ComponentStruct action = new ComponentStruct(); action.restoreState(context, object); if (ComponentStruct.ADD.equals(action.action)) { restoreDynamicAdd(context, state, action); } if (ComponentStruct.REMOVE.equals(action.action)) { restoreDynamicRemove(context, action); } pruneAndReAddToDynamicActions(actions, action); } } }
/** * Restore the list of dynamic actions and replay them. * * @param context the Faces context. * @param stateContext the state context. * @param stateMap the state. * @param viewRoot the view root. */ private void restoreDynamicActions(FacesContext context, StateContext stateContext, HashMap<String, Object> state) { if (LOGGER.isLoggable(FINEST)) { LOGGER.finest("FaceletFullStateManagementStrategy.restoreDynamicActions"); } @SuppressWarnings("unchecked") List<Object> savedActions = (List<Object>) context.getViewRoot().getAttributes().get(DYNAMIC_ACTIONS); List<ComponentStruct> actions = stateContext.getDynamicActions(); if (!isEmpty(savedActions)) { for (Object savedAction : savedActions) { ComponentStruct action = new ComponentStruct(); action.restoreState(context, savedAction); if (ADD.equals(action.getAction())) { restoreDynamicAdd(context, state, action); } if (REMOVE.equals(action.getAction())) { restoreDynamicRemove(context, action); } pruneAndReAddToDynamicActions(actions, action); } } }
/** * Restore the list of dynamic actions and replay them. * * @param context the Faces context. * @param stateContext the state context. * @param stateMap the state. * @param viewRoot the view root. */ private void restoreDynamicActions(FacesContext context, StateContext stateContext, Map<String, Object> stateMap) { if (LOGGER.isLoggable(FINEST)) { LOGGER.finest("FaceletPartialStateManagementStrategy.restoreDynamicActions"); } @SuppressWarnings("unchecked") List<Object> savedActions = (List<Object>) stateMap.get(DYNAMIC_ACTIONS); List<ComponentStruct> actions = stateContext.getDynamicActions(); if (!isEmpty(savedActions)) { for (Object savedAction : savedActions) { ComponentStruct action = new ComponentStruct(); action.restoreState(context, savedAction); if (ADD.equals(action.getAction())) { restoreDynamicAdd(context, stateMap, action); } if (REMOVE.equals(action.getAction())) { restoreDynamicRemove(context, action); } pruneAndReAddToDynamicActions(actions, action); } } }
/** * Restore the list of dynamic actions and replay them. * * @param context the Faces context. * @param stateContext the state context. * @param stateMap the state. * @param viewRoot the view root. */ private void restoreDynamicActions(FacesContext context, StateContext stateContext, Map<String, Object> stateMap) { if (LOGGER.isLoggable(FINEST)) { LOGGER.finest("FaceletPartialStateManagementStrategy.restoreDynamicActions"); } @SuppressWarnings("unchecked") List<Object> savedActions = (List<Object>) stateMap.get(DYNAMIC_ACTIONS); List<ComponentStruct> actions = stateContext.getDynamicActions(); if (!isEmpty(savedActions)) { for (Object savedAction : savedActions) { ComponentStruct action = new ComponentStruct(); action.restoreState(context, savedAction); if (ADD.equals(action.getAction())) { restoreDynamicAdd(context, stateMap, action); } if (REMOVE.equals(action.getAction())) { restoreDynamicRemove(context, action); } pruneAndReAddToDynamicActions(actions, action); } } }
/** * Restore the list of dynamic actions and replay them. * * @param context the Faces context. * @param stateContext the state context. * @param stateMap the state. * @param viewRoot the view root. */ private void restoreDynamicActions(FacesContext context, StateContext stateContext, Map<String, Object> stateMap) { if (LOGGER.isLoggable(FINEST)) { LOGGER.finest("FaceletPartialStateManagementStrategy.restoreDynamicActions"); } @SuppressWarnings("unchecked") List<Object> savedActions = (List<Object>) stateMap.get(DYNAMIC_ACTIONS); List<ComponentStruct> actions = stateContext.getDynamicActions(); if (!isEmpty(savedActions)) { for (Object savedAction : savedActions) { ComponentStruct action = new ComponentStruct(); action.restoreState(context, savedAction); if (ADD.equals(action.getAction())) { restoreDynamicAdd(context, stateMap, action); } if (REMOVE.equals(action.getAction())) { restoreDynamicRemove(context, action); } pruneAndReAddToDynamicActions(actions, action); } } }
/** * Restore the list of dynamic actions and replay them. * * @param context the Faces context. * @param stateContext the state context. * @param stateMap the state. * @param viewRoot the view root. */ private void restoreDynamicActions(FacesContext context, StateContext stateContext, HashMap<String, Object> state) { if (LOGGER.isLoggable(FINEST)) { LOGGER.finest("FaceletFullStateManagementStrategy.restoreDynamicActions"); } @SuppressWarnings("unchecked") List<Object> savedActions = (List<Object>) context.getViewRoot().getAttributes().get(DYNAMIC_ACTIONS); List<ComponentStruct> actions = stateContext.getDynamicActions(); if (!isEmpty(savedActions)) { for (Object savedAction : savedActions) { ComponentStruct action = new ComponentStruct(); action.restoreState(context, savedAction); if (ADD.equals(action.getAction())) { restoreDynamicAdd(context, state, action); } if (REMOVE.equals(action.getAction())) { restoreDynamicRemove(context, action); } pruneAndReAddToDynamicActions(actions, action); } } }
/** * Restore the list of dynamic actions and replay them. * * @param context the Faces context. * @param stateContext the state context. * @param stateMap the state. * @param viewRoot the view root. */ private void restoreDynamicActions(FacesContext context, StateContext stateContext, HashMap<String, Object> state) { if (LOGGER.isLoggable(FINEST)) { LOGGER.finest("FaceletFullStateManagementStrategy.restoreDynamicActions"); } @SuppressWarnings("unchecked") List<Object> savedActions = (List<Object>) context.getViewRoot().getAttributes().get(DYNAMIC_ACTIONS); List<ComponentStruct> actions = stateContext.getDynamicActions(); if (!isEmpty(savedActions)) { for (Object savedAction : savedActions) { ComponentStruct action = new ComponentStruct(); action.restoreState(context, savedAction); if (ADD.equals(action.getAction())) { restoreDynamicAdd(context, state, action); } if (REMOVE.equals(action.getAction())) { restoreDynamicRemove(context, action); } pruneAndReAddToDynamicActions(actions, action); } } }