/** * Method that takes care of restoring a dynamic remove. * * @param context the Faces context. * @param struct the component struct. */ private void restoreDynamicRemove(FacesContext context, ComponentStruct struct) { if (LOGGER.isLoggable(Level.FINEST)) { LOGGER.finest("FaceletPartialStateManagementStrategy.restoreDynamicRemove"); } UIComponent child = locateComponentByClientId(context, context.getViewRoot(), struct.getClientId()); if (child != null) { StateContext stateContext = StateContext.getStateContext(context); stateContext.getDynamicComponents().put(struct.getClientId(), child); UIComponent parent = child.getParent(); parent.getChildren().remove(child); } }
/** * Method that takes care of restoring a dynamic remove. * * @param context the Faces context. * @param struct the component struct. */ private void restoreDynamicRemove(FacesContext context, ComponentStruct struct) { if (LOGGER.isLoggable(FINEST)) { LOGGER.finest("FaceletFullStateManagementStrategy.restoreDynamicRemove"); } UIComponent child = locateComponentByClientId(context, context.getViewRoot(), struct.getClientId()); if (child != null) { StateContext stateContext = StateContext.getStateContext(context); stateContext.getDynamicComponents().put(struct.getClientId(), child); UIComponent parent = child.getParent(); parent.getChildren().remove(child); } }
/** * Method that takes care of restoring a dynamic remove. * * @param context the Faces context. * @param struct the component struct. */ private void restoreDynamicRemove(FacesContext context, ComponentStruct struct) { if (LOGGER.isLoggable(Level.FINEST)) { LOGGER.finest("FaceletPartialStateManagementStrategy.restoreDynamicRemove"); } UIComponent child = locateComponentByClientId(context, context.getViewRoot(), struct.getClientId()); if (child != null) { StateContext stateContext = StateContext.getStateContext(context); stateContext.getDynamicComponents().put(struct.getClientId(), child); UIComponent parent = child.getParent(); parent.getChildren().remove(child); } }
/** * Reapply the dynamic remove after Facelets reapply. * * @param context the Faces context. * @param struct the component struct. */ private void reapplyDynamicRemove(FacesContext context, ComponentStruct struct) { UIComponent child = locateComponentByClientId(context, context.getViewRoot(), struct.getClientId()); if (child != null) { StateContext stateContext = StateContext.getStateContext(context); stateContext.getDynamicComponents().put(struct.getClientId(), child); UIComponent parent = child.getParent(); parent.getChildren().remove(child); } }
/** * Reapply the dynamic remove after Facelets reapply. * * @param context the Faces context. * @param struct the component struct. */ private void reapplyDynamicRemove(FacesContext context, ComponentStruct struct) { UIComponent child = locateComponentByClientId(context, context.getViewRoot(), struct.getClientId()); if (child != null) { StateContext stateContext = StateContext.getStateContext(context); stateContext.getDynamicComponents().put(struct.getClientId(), child); UIComponent parent = child.getParent(); parent.getChildren().remove(child); } }
/** * Method that takes care of restoring a dynamic remove. * * @param context the Faces context. * @param struct the component struct. */ private void restoreDynamicRemove(FacesContext context, ComponentStruct struct) { if (LOGGER.isLoggable(FINEST)) { LOGGER.finest("FaceletFullStateManagementStrategy.restoreDynamicRemove"); } UIComponent child = locateComponentByClientId(context, context.getViewRoot(), struct.getClientId()); if (child != null) { StateContext stateContext = StateContext.getStateContext(context); stateContext.getDynamicComponents().put(struct.getClientId(), child); UIComponent parent = child.getParent(); parent.getChildren().remove(child); } }
List<Object> savedActions = new ArrayList<>(actions.size()); for (ComponentStruct action : actions) { UIComponent component = componentMap.get(action.getClientId()); if (component == null && context.isProjectStage(ProjectStage.Development)) { LOGGER.log( Level.WARNING, "Unable to save dynamic action with clientId ''{0}'' because the UIComponent cannot be found", action.getClientId());
/** * Method that takes care of restoring a dynamic remove. * * @param context the Faces context. * @param struct the component struct. */ private void restoreDynamicRemove(FacesContext context, ComponentStruct struct) { if (LOGGER.isLoggable(FINEST)) { LOGGER.finest("FaceletFullStateManagementStrategy.restoreDynamicRemove"); } UIComponent child = locateComponentByClientId(context, context.getViewRoot(), struct.getClientId()); if (child != null) { StateContext stateContext = StateContext.getStateContext(context); stateContext.getDynamicComponents().put(struct.getClientId(), child); UIComponent parent = child.getParent(); parent.getChildren().remove(child); } }
/** * Method that takes care of restoring a dynamic remove. * * @param context the Faces context. * @param struct the component struct. */ private void restoreDynamicRemove(FacesContext context, ComponentStruct struct) { if (LOGGER.isLoggable(Level.FINEST)) { LOGGER.finest("FaceletPartialStateManagementStrategy.restoreDynamicRemove"); } UIComponent child = locateComponentByClientId(context, context.getViewRoot(), struct.getClientId()); if (child != null) { StateContext stateContext = StateContext.getStateContext(context); stateContext.getDynamicComponents().put(struct.getClientId(), child); UIComponent parent = child.getParent(); parent.getChildren().remove(child); } }
/** * Reapply the dynamic remove after Facelets reapply. * * @param context the Faces context. * @param struct the component struct. */ private void reapplyDynamicRemove(FacesContext context, ComponentStruct struct) { UIComponent child = locateComponentByClientId(context, context.getViewRoot(), struct.getClientId()); if (child != null) { StateContext stateContext = StateContext.getStateContext(context); stateContext.getDynamicComponents().put(struct.getClientId(), child); UIComponent parent = child.getParent(); parent.getChildren().remove(child); } }
List<Object> savedActions = new ArrayList<>(actions.size()); for (ComponentStruct action : actions) { UIComponent component = componentMap.get(action.getClientId()); if (component == null && context.isProjectStage(ProjectStage.Development)) { LOGGER.log( Level.WARNING, "Unable to save dynamic action with clientId ''{0}'' because the UIComponent cannot be found", action.getClientId());
List<Object> savedActions = new ArrayList<>(actions.size()); for (ComponentStruct action : actions) { UIComponent component = componentMap.get(action.getClientId()); if (component == null && context.isProjectStage(ProjectStage.Development)) { LOGGER.log( Level.WARNING, "Unable to save dynamic action with clientId ''{0}'' because the UIComponent cannot be found", action.getClientId());
/** * Save the dynamic actions. * * @param context the Faces context. * @param stateContext the state context. * @param stateMap the state. */ private void saveDynamicActions(FacesContext context, StateContext stateContext, UIViewRoot viewRoot) { if (LOGGER.isLoggable(FINEST)) { LOGGER.finest("FaceletFullStateManagementStrategy.saveDynamicActions"); } List<ComponentStruct> actions = stateContext.getDynamicActions(); HashMap<String, UIComponent> componentMap = stateContext.getDynamicComponents(); if (actions != null) { List<Object> savedActions = new ArrayList<>(actions.size()); for (ComponentStruct action : actions) { UIComponent component = componentMap.get(action.getClientId()); if (component == null && context.isProjectStage(Development)) { LOGGER.log( WARNING, "Unable to save dynamic action with clientId ''{0}'' because the UIComponent cannot be found", action.getClientId()); } if (component != null) { savedActions.add(action.saveState(context)); } } viewRoot.getAttributes().put(DYNAMIC_ACTIONS, savedActions); } }
/** * Save the dynamic actions. * * @param context the Faces context. * @param stateContext the state context. * @param stateMap the state. */ private void saveDynamicActions(FacesContext context, StateContext stateContext, UIViewRoot viewRoot) { if (LOGGER.isLoggable(FINEST)) { LOGGER.finest("FaceletFullStateManagementStrategy.saveDynamicActions"); } List<ComponentStruct> actions = stateContext.getDynamicActions(); HashMap<String, UIComponent> componentMap = stateContext.getDynamicComponents(); if (actions != null) { List<Object> savedActions = new ArrayList<>(actions.size()); for (ComponentStruct action : actions) { UIComponent component = componentMap.get(action.getClientId()); if (component == null && context.isProjectStage(Development)) { LOGGER.log( WARNING, "Unable to save dynamic action with clientId ''{0}'' because the UIComponent cannot be found", action.getClientId()); } if (component != null) { savedActions.add(action.saveState(context)); } } viewRoot.getAttributes().put(DYNAMIC_ACTIONS, savedActions); } }
/** * Save the dynamic actions. * * @param context the Faces context. * @param stateContext the state context. * @param stateMap the state. */ private void saveDynamicActions(FacesContext context, StateContext stateContext, UIViewRoot viewRoot) { if (LOGGER.isLoggable(FINEST)) { LOGGER.finest("FaceletFullStateManagementStrategy.saveDynamicActions"); } List<ComponentStruct> actions = stateContext.getDynamicActions(); HashMap<String, UIComponent> componentMap = stateContext.getDynamicComponents(); if (actions != null) { List<Object> savedActions = new ArrayList<>(actions.size()); for (ComponentStruct action : actions) { UIComponent component = componentMap.get(action.getClientId()); if (component == null && context.isProjectStage(Development)) { LOGGER.log( WARNING, "Unable to save dynamic action with clientId ''{0}'' because the UIComponent cannot be found", action.getClientId()); } if (component != null) { savedActions.add(action.saveState(context)); } } viewRoot.getAttributes().put(DYNAMIC_ACTIONS, savedActions); } }
UIComponent child = locateComponentByClientId(context, parent, struct.getClientId()); StateContext stateContext = StateContext.getStateContext(context); child = stateContext.getDynamicComponents().get(struct.getClientId()); child.getAttributes().put(DYNAMIC_COMPONENT, child.getParent().getChildren().indexOf(child)); stateContext.getDynamicComponents().put(struct.getClientId(), child);
UIComponent child = locateComponentByClientId(context, parent, struct.getClientId()); StateHolderSaver saver = (StateHolderSaver) state.get(struct.getClientId()); if (saver != null) { child = (UIComponent) saver.restore(context); child = stateContext.getDynamicComponents().get(struct.getClientId()); stateContext.getDynamicComponents().put(struct.getClientId(), child);
UIComponent child = locateComponentByClientId(context, parent, struct.getClientId()); StateContext stateContext = StateContext.getStateContext(context); child = stateContext.getDynamicComponents().get(struct.getClientId()); child.getAttributes().put(DYNAMIC_COMPONENT, child.getParent().getChildren().indexOf(child)); stateContext.getDynamicComponents().put(struct.getClientId(), child);
UIComponent child = locateComponentByClientId(context, parent, struct.getClientId()); StateHolderSaver saver = (StateHolderSaver) state.get(struct.getClientId()); if (saver != null) { child = (UIComponent) saver.restore(context); child = stateContext.getDynamicComponents().get(struct.getClientId()); stateContext.getDynamicComponents().put(struct.getClientId(), child);
UIComponent child = locateComponentByClientId(context, parent, struct.getClientId()); StateContext stateContext = StateContext.getStateContext(context); child = stateContext.getDynamicComponents().get(struct.getClientId()); child.getAttributes().put(DYNAMIC_COMPONENT, child.getParent().getChildren().indexOf(child)); stateContext.getDynamicComponents().put(struct.getClientId(), child);