private List<Object> collectChildState(FacesContext context, List<Object> stateList) { if (getChildCount() > 0) { Iterator<UIComponent> kids = getChildren().iterator(); while (kids.hasNext()) { UIComponent kid = (UIComponent) kids.next(); if (!kid.isTransient()) { stateList.add(kid.processSaveState(context)); } } } return stateList; }
private List<Object> collectChildState(FacesContext context, List<Object> stateList) { if (getChildCount() > 0) { Iterator<UIComponent> kids = getChildren().iterator(); while (kids.hasNext()) { UIComponent kid = (UIComponent) kids.next(); if (!kid.isTransient()) { stateList.add(kid.processSaveState(context)); } } } return stateList; }
private List<Object> collectChildState(FacesContext context, List<Object> stateList) { if (getChildCount() > 0) { Iterator<UIComponent> kids = getChildren().iterator(); while (kids.hasNext()) { UIComponent kid = kids.next(); if (!kid.isTransient()) { stateList.add(kid.processSaveState(context)); } } } return stateList; }
private List<Object> collectChildState(FacesContext context, List<Object> stateList) { if (getChildCount() > 0) { Iterator<UIComponent> kids = getChildren().iterator(); while (kids.hasNext()) { UIComponent kid = kids.next(); if (!kid.isTransient()) { stateList.add(kid.processSaveState(context)); } } } return stateList; }
/** * Recursive method that manage the opening and closure components. * Ex. : <li><ul><button/></ul></li> * Stop condition: cNew hasn't more children --> close Tag * @param cNew * @param context * @throws IOException */ public static void recursiveEncodechildren( final UIComponentBase cNew, final FacesContext context) throws IOException { if (cNew.getChildren() != null && !cNew.getChildren().isEmpty()) { for (Object o : cNew.getChildren()) { UIComponentBase c2 = (UIComponentBase) o; c2.encodeBegin(context); recursiveEncodechildren(c2, context); } //we travelled all children must therefore close the parent cNew.encodeEnd(context); } else { cNew.encodeEnd(context); } }
/** * Recursive method that manage the opening and closure components. * Ex. : <li><ul><button/></ul></li> * Stop condition: cNew hasn't more children --> close Tag * @param cNew * @param context * @throws IOException */ public static void recursiveEncodechildren( final UIComponentBase cNew, final FacesContext context) throws IOException { if (cNew.getChildren() != null && !cNew.getChildren().isEmpty()) { for (Object o : cNew.getChildren()) { UIComponentBase c2 = (UIComponentBase) o; c2.encodeBegin(context); recursiveEncodechildren(c2, context); } //we travelled all children must therefore close the parent cNew.encodeEnd(context); } else { cNew.encodeEnd(context); } }
@Override public Iterator<UIComponent> getFacetsAndChildren() { int childCount = getChildCount(), facetCount = getFacetCount(); // If there are neither facets nor children if (childCount == 0 && facetCount == 0) { return EMPTY_ITERATOR; } // If there are only facets and no children if (childCount == 0) { return unmodifiableCollection(getFacets().values()).iterator(); } // If there are only children and no facets if (facetCount == 0) { return unmodifiableList(getChildren()).iterator(); } // If there are both children and facets return new FacetsAndChildrenIterator(this); }
@Override public Iterator<UIComponent> getFacetsAndChildren() { int childCount = getChildCount(), facetCount = getFacetCount(); // If there are neither facets nor children if (childCount == 0 && facetCount == 0) { return EMPTY_ITERATOR; } // If there are only facets and no children if (childCount == 0) { return unmodifiableCollection(getFacets().values()).iterator(); } // If there are only children and no facets if (facetCount == 0) { return unmodifiableList(getChildren()).iterator(); } // If there are both children and facets return new FacetsAndChildrenIterator(this); }
@Override public Iterator<UIComponent> getFacetsAndChildren() { int childCount = getChildCount(), facetCount = getFacetCount(); // If there are neither facets nor children if (childCount == 0 && facetCount == 0) { return EMPTY_ITERATOR; } // If there are only facets and no children if (childCount == 0) { return unmodifiableCollection(getFacets().values()).iterator(); } // If there are only children and no facets if (facetCount == 0) { return unmodifiableList(getChildren()).iterator(); } // If there are both children and facets return new FacetsAndChildrenIterator(this); }
@Override public Iterator<UIComponent> getFacetsAndChildren() { int childCount = getChildCount(), facetCount = getFacetCount(); // If there are neither facets nor children if (childCount == 0 && facetCount == 0) { return EMPTY_ITERATOR; } // If there are only facets and no children if (childCount == 0) { return unmodifiableCollection(getFacets().values()).iterator(); } // If there are only children and no facets if (facetCount == 0) { return unmodifiableList(getChildren()).iterator(); } // If there are both children and facets return new FacetsAndChildrenIterator(this); }
public Iterator<UIComponent> getFacetsAndChildren() { Iterator<UIComponent> result; int childCount = this.getChildCount(), facetCount = this.getFacetCount(); // If there are neither facets nor children if (0 == childCount && 0 == facetCount) { result = EMPTY_ITERATOR; } // If there are only facets and no children else if (0 == childCount) { Collection<UIComponent> unmodifiable = Collections.unmodifiableCollection(getFacets().values()); result = unmodifiable.iterator(); } // If there are only children and no facets else if (0 == facetCount) { List<UIComponent> unmodifiable = Collections.unmodifiableList(getChildren()); result = unmodifiable.iterator(); } // If there are both children and facets else { result = new FacetsAndChildrenIterator(this); } return result; }
@Override public Iterator<UIComponent> getFacetsAndChildren() { Iterator<UIComponent> result; int childCount = this.getChildCount(), facetCount = this.getFacetCount(); // If there are neither facets nor children if (0 == childCount && 0 == facetCount) { result = EMPTY_ITERATOR; } // If there are only facets and no children else if (0 == childCount) { Collection<UIComponent> unmodifiable = Collections.unmodifiableCollection(getFacets().values()); result = unmodifiable.iterator(); } // If there are only children and no facets else if (0 == facetCount) { List<UIComponent> unmodifiable = Collections.unmodifiableList(getChildren()); result = unmodifiable.iterator(); } // If there are both children and facets else { result = new FacetsAndChildrenIterator(this); } return result; }
@Override public Iterator<UIComponent> getFacetsAndChildren() { // we can't use _facetMap and _childrenList here directly, // because some component implementation could keep their // own properties for facets and children and just override // getFacets() and getChildren() (e.g. seen in PrimeFaces). // See MYFACES-2611 for details. if (getFacetCount() == 0) { if (getChildCount() == 0) { return _EMPTY_UICOMPONENT_ITERATOR; } return getChildren().iterator(); } else { if (getChildCount() == 0) { return getFacets().values().iterator(); } return new _FacetsAndChildrenIterator(getFacets(), getChildren()); } }
private int restoreChildState(FacesContext context, Object[] childState) { int i = 0; // Process all the children of this component if (getChildCount() > 0) { for (UIComponent kid : getChildren()) { if (kid.isTransient()) { continue; } Object currentState = childState[i++]; if (currentState == null) { continue; } kid.processRestoreState(context, currentState); } } return i; }
private int restoreChildState(FacesContext context, Object[] childState) { int i = 0; // Process all the children of this component if (getChildCount() > 0) { for (UIComponent kid : getChildren()) { if (kid.isTransient()) { continue; } Object currentState = childState[i++]; if (currentState == null) { continue; } kid.processRestoreState(context, currentState); } } return i; }
private int restoreChildState(FacesContext context, Object[] childState) { int i = 0; // Process all the children of this component if (getChildCount() > 0) { for (UIComponent kid : getChildren()) { if (kid.isTransient()) { continue; } Object currentState = childState[i++]; if (currentState == null) { continue; } kid.processRestoreState(context, currentState); } } return i; }
private int restoreChildState(FacesContext context, Object[] childState) { int i = 0; // Process all the children of this component if (getChildCount() > 0) { for (UIComponent kid : getChildren()) { if (kid.isTransient()) { continue; } Object currentState = childState[i++]; if (currentState == null) { continue; } kid.processRestoreState(context, currentState); } } return i; }
/** * @throws NullPointerException {@inheritDoc} */ @Override public void encodeChildren(FacesContext context) throws IOException { if (context == null) { throw new NullPointerException(); } if (!isRendered()) { return; } if (getRendererType() != null) { Renderer renderer = getRenderer(context); if (renderer != null) { renderer.encodeChildren(context, this); } // We've already logged for this component } else if (getChildCount() > 0) { for (UIComponent child : getChildren()) { child.encodeAll(context); } } }
/** * @throws NullPointerException {@inheritDoc} */ @Override public void encodeChildren(FacesContext context) throws IOException { if (context == null) { throw new NullPointerException(); } if (!isRendered()) { return; } if (getRendererType() != null) { Renderer renderer = getRenderer(context); if (renderer != null) { renderer.encodeChildren(context, this); } // We've already logged for this component } else if (getChildCount() > 0) { for (UIComponent child : getChildren()) { child.encodeAll(context); } } }
/** * @throws NullPointerException {@inheritDoc} */ @Override public void encodeChildren(FacesContext context) throws IOException { if (context == null) { throw new NullPointerException(); } if (!isRendered()) { return; } String rendererType = getRendererType(); if (rendererType != null) { Renderer renderer = this.getRenderer(context); if (renderer != null) { renderer.encodeChildren(context, this); } // We've already logged for this component } else { if (getChildCount() > 0) { for (UIComponent child : getChildren()) { child.encodeAll(context); } } } }