protected void renderChildren(FacesContext context, UIComponent component) throws IOException { if (component.getChildCount() > 0) { for (int i = 0; i < component.getChildCount(); i++) { UIComponent child = component.getChildren().get(i); renderChild(context, child); } } }
public static void processDecodesOfFacetsAndChilds(UIComponent component, FacesContext context) { if (component.getFacetCount() > 0) { for (UIComponent facet : component.getFacets().values()) { facet.processDecodes(context); } } if (component.getChildCount() > 0) { for (int i = 0, childCount = component.getChildCount(); i < childCount; i++) { UIComponent child = component.getChildren().get(i); child.processDecodes(context); } } }
protected boolean visitColumnContent(VisitContext context, VisitCallback callback, UIComponent component) { if (component.getChildCount() > 0) { for (UIComponent grandkid : component.getChildren()) { if (grandkid.visitTree(context, callback)) { return true; } } } return false; }
protected boolean visitColumnGroup(VisitContext context, VisitCallback callback, ColumnGroup group) { if (group.getChildCount() > 0) { for (UIComponent row : group.getChildren()) { if (row.getChildCount() > 0) { for (UIComponent col : row.getChildren()) { if (col instanceof Column && col.getFacetCount() > 0) { boolean value = visitColumnFacets(context, callback, col); if (value) { return true; } } } } } } return false; }
private void setupValidators(SetupValidatorsParameter parameterObject, UIComponent component) { if (component.getChildCount() == 0 && component.getFacetCount() == 0) { return; } Iterator<UIComponent> facetsAndChildren = component.getFacetsAndChildren(); while (facetsAndChildren.hasNext()) { UIComponent child = facetsAndChildren.next(); if (child instanceof EditableValueHolder) { EditableValueHolder input = (EditableValueHolder) child; setupValidator(parameterObject, input); } if (!(child instanceof AbstractGraphValidator)) { // don't setup validators for nested GVs setupValidators(parameterObject, child); } } }
public static void processValidatorsOfFacetsAndChilds(UIComponent component, FacesContext context) { if (component.getFacetCount() > 0) { for (UIComponent facet : component.getFacets().values()) { facet.processValidators(context); } } if (component.getChildCount() > 0) { for (int i = 0, childCount = component.getChildCount(); i < childCount; i++) { UIComponent child = component.getChildren().get(i); child.processValidators(context); } } }
@Override public UIComponent resolveComponent(FacesContext context, UIComponent source, UIComponent last, String expression, int options) { UIComponent parent = last.getParent(); if (parent.getChildCount() > 1) { List<UIComponent> children = parent.getChildren(); int index = children.indexOf(last); if (index < parent.getChildCount() - 1) { int nextIndex = -1; do { index++; String className = children.get(index).getClass().getName(); if (!className.contains("UIInstructions") && !className.contains("UILeaf")) { nextIndex = index; } } while (nextIndex == -1 && index < parent.getChildCount() - 1); if (nextIndex != -1) { return children.get(nextIndex); } } } return null; }
protected boolean visitColumnContent(VisitContext context, VisitCallback callback, UIComponent component) { if (component.getChildCount() > 0) { for (UIComponent grandkid : component.getChildren()) { if (grandkid.visitTree(context, callback)) { return true; } } } return false; }
protected boolean visitColumnGroup(VisitContext context, VisitCallback callback, ColumnGroup group) { if (group.getChildCount() > 0) { for (UIComponent row : group.getChildren()) { if (row.getChildCount() > 0) { for (UIComponent col : row.getChildren()) { if (col instanceof Column && col.getFacetCount() > 0) { boolean value = visitColumnFacets(context, callback, (Column) col); if (value) { return true; } } } } } } return false; }
private void setupValidators(SetupValidatorsParameter parameterObject, UIComponent component) { if (component.getChildCount() == 0 && component.getFacetCount() == 0) { return; } Iterator<UIComponent> facetsAndChildren = component.getFacetsAndChildren(); while (facetsAndChildren.hasNext()) { UIComponent child = facetsAndChildren.next(); if (child instanceof EditableValueHolder) { EditableValueHolder input = (EditableValueHolder) child; setupValidator(parameterObject, input); } if (!(child instanceof AbstractGraphValidator)) { // don't setup validators for nested GVs setupValidators(parameterObject, child); } } }
public static void processUpdatesOfFacetsAndChilds(UIComponent component, FacesContext context) { if (component.getFacetCount() > 0) { for (UIComponent facet : component.getFacets().values()) { facet.processUpdates(context); } } if (component.getChildCount() > 0) { for (int i = 0, childCount = component.getChildCount(); i < childCount; i++) { UIComponent child = component.getChildren().get(i); child.processUpdates(context); } } }
@Override public UIComponent resolveComponent(FacesContext context, UIComponent source, UIComponent last, String expression, int options) { UIComponent parent = last.getParent(); if (parent.getChildCount() > 1) { List<UIComponent> children = parent.getChildren(); int index = children.indexOf(last); if (index > 0) { int nextIndex = -1; do { index--; String className = children.get(index).getClass().getName(); if (!className.contains("UIInstructions") && !className.contains("UILeaf")) { nextIndex = index; } } while (nextIndex == -1 && index > 0); if (nextIndex != -1) { return children.get(nextIndex); } } } return null; }
public _SelectItemsIterator(UIComponent selectItemsParent, FacesContext facesContext) { _children = selectItemsParent.getChildCount() > 0 ? selectItemsParent.getChildren().iterator() : _EMPTY_UICOMPONENT_ITERATOR; _facesContext = facesContext; }
public static void withId(String id, UIComponent base, List<UIComponent> components) { if (id.equals(base.getId())) { components.add(base); } if (base.getFacetCount() > 0) { for (UIComponent facet : base.getFacets().values()) { withId(id, facet, components); } } if (base.getChildCount() > 0) { for (int i = 0, childCount = base.getChildCount(); i < childCount; i++) { UIComponent child = base.getChildren().get(i); withId(id, child, components); } } }
public AjaxRequestBuilder params(UIComponent component) { boolean paramWritten = false; for (int i = 0; i < component.getChildCount(); i++) { UIComponent child = component.getChildren().get(i); if (child instanceof UIParameter) { UIParameter parameter = (UIParameter) child; Object paramValue = parameter.getValue(); if (paramValue == null) { continue; } if (!paramWritten) { paramWritten = true; buffer.append(",pa:["); } else { buffer.append(","); } buffer.append("{name:").append("\"").append(EscapeUtils.forJavaScript(parameter.getName())).append("\",value:\"") .append(EscapeUtils.forJavaScript(paramValue.toString())).append("\"}"); } } if (paramWritten) { buffer.append("]"); } return this; }
public SelectItemsIterator(UIComponent selectItemsParent, FacesContext facesContext) { _children = selectItemsParent.getChildCount() > 0 ? selectItemsParent.getChildren().iterator() : _EMPTY_UICOMPONENT_ITERATOR; _facesContext = facesContext; }
if (childStates == null) { childStates = new ArrayList<>( parent.getFacetCount() + parent.getChildCount() - totalChildCount + childEmptyIndex); childStates.add(child.getChildCount() > 0 ? new Object[]{new SavedState((EditableValueHolder) child), saveDescendantComponentStates(child, saveChildFacets, true)} : new Object[]{new SavedState((EditableValueHolder) child), null}); else if (child.getChildCount() > 0 || (saveChildFacets && child.getFacetCount() > 0)) { Object descendantSavedState = saveDescendantComponentStates(child, saveChildFacets, true); + parent.getChildCount() - totalChildCount + childEmptyIndex); if (parent.getChildCount() > 0) { for (int i = 0; i < parent.getChildCount(); i++) { UIComponent child = parent.getChildren().get(i); if (!child.isTransient()) { + parent.getChildCount() - totalChildCount + childEmptyIndex); childStates.add(child.getChildCount() > 0
int childNumber = Integer.parseInt(matcher.group(1)); if (childNumber + 1 > last.getChildCount()) { throw new FacesException("Component with clientId \"" + last.getClientId(context) + "\" has fewer children as \"" + childNumber + "\". Expression: \"" + expression + "\""); List<UIComponent> list = last.getChildren(); int count = 0; for (int i = 0; i < last.getChildCount(); i++) { String className = list.get(i).getClass().getName(); if (!className.contains("UIInstructions") && !className.contains("UILeaf")) { count++; return last.getChildren().get(childNumber);
public void encodeChildren(FacesContext context, UIComponent component) throws IOException { if (component.getChildCount() > 0) { for (UIComponent child : component.getChildren()) { child.encodeAll(context); } } }
if (iterateFacets && parent.getFacetCount() > 0) { Iterator<UIComponent> childIterator = parent.getFacets().values().iterator(); if (parent.getChildCount() > 0) { for (int i = 0; i < parent.getChildCount(); i++) { UIComponent component = parent.getChildren().get(i);