/** Removes all children of the specified component. * It is the same as <code>comp.getChildren().clear()</code>. */ public static void removeAllChildren(Component comp) { comp.getChildren().clear(); }
/** Replaces all children of the specified component. * It is the same as * <pre><code>parent.getChildren().clear(); *parent.getChildren().addAll(newChildren); *</code></pre> * @since 3.5.2 */ public static void replaceChildren(Component parent, Collection<Component> newChildren) { final Collection<Component> children = parent.getChildren(); children.clear(); children.addAll(newChildren); }
/** Returns the column index of this cell, starting from 0. */ public int getColumnIndex() { int j = 0; for (Iterator it = getParent().getChildren().iterator(); it.hasNext(); ++j) if (it.next() == this) break; return j; }
/** Returns the column index, starting from 0. */ public int getColumnIndex() { int j = 0; for (Iterator it = getParent().getChildren().iterator(); it.hasNext(); ++j) if (it.next() == this) break; return j; }
/** Returns the column index of this cell, starting from 0. */ public int getColumnIndex() { int j = 0; for (Iterator it = getParent().getChildren().iterator(); it.hasNext(); ++j) if (it.next() == this) break; return j; }
/** Returns the column index, starting from 0. */ public int getColumnIndex() { int j = 0; for (Iterator it = getParent().getChildren().iterator(); it.hasNext(); ++j) if (it.next() == this) break; return j; }
public boolean accept(ComponentMatchCtx ctx, String... parameters) { if(parameters.length > 0) return false; return ctx.getComponent().getChildren().isEmpty(); } });
/** * Return the child index of the component. If the component is one of the * page roots, return -1. */ public int getComponentChildIndex() { if(_compChildIndex > -1) return _compChildIndex; Component parent = _comp.getParent(); return parent == null ? -1 : parent.getChildren().indexOf(_comp); }
/** Returns the column index, starting from 0. */ public int getColumnIndex() { int j = 0; for (Iterator it = getParent().getChildren().iterator(); it.hasNext(); ++j) if (it.next() == this) break; return j; }
/** * return the index of this item * @return the index of this item * @since 5.0.9 */ public int getIndex() { List list = this.getParent().getChildren(); return list.indexOf(this); }
/** Returns the column index, starting from 0. */ public int getColumnIndex() { int j = 0; for (Iterator it = getParent().getChildren().iterator(); it.hasNext(); ++j) if (it.next() == this) break; return j; }
/** Returns the column index, starting from 0. */ public int getColumnIndex() { int j = 0; for (Iterator it = getParent().getChildren().iterator(); it.hasNext(); ++j) if (it.next() == this) break; return j; }
/** * Return the child index of the component. If the component is one of the * page roots, return -1. */ public int getComponentChildIndex() { if (_compChildIndex > -1) return _compChildIndex; Component parent = _comp.getParent(); return parent == null ? -1 : parent.getChildren().indexOf(_comp); }
private void loadAnnotations(Component comp) { loadComponentAnnotation(comp); loadComponentPropertyAnnotation(comp); final List children = comp.getChildren(); for (final Iterator it = children.iterator(); it.hasNext();) { loadAnnotations((Component) it.next()); //recursive back } }
/** * Return the count of total siblings of the component, including itself. */ public int getComponentSiblingSize() { Component parent = _comp.getParent(); return parent == null ? _comp.getPage().getRoots().size() : parent.getChildren().size(); }
private void addAllComponents(Component comp) { addComponent(comp); for (Component child : comp.getChildren()) addAllComponents(child); }
private void removeComponents(Collection<Component> comps) { for (Component comp : comps) { removeComponents(comp.getChildren()); //recursive removeComponent(comp, true); } }
/*package*/ static void postOnCreateEvents(Component item) { for (final Iterator it = item.getChildren().iterator(); it.hasNext();) { final Component child = (Component) it.next(); postOnCreateEvents(child); //recursive } if (Events.isListened(item, Events.ON_CREATE, false)) { Events.postEvent(new CreateEvent(Events.ON_CREATE, item, null)); } } }
private final void fixFellows(Collection<Component> c) { for (Component comp : c) { final String compId = comp.getId(); if (compId.length() > 0) addFellow(comp); if (!(comp instanceof IdSpace)) fixFellows(comp.getChildren()); //recursive } }
private void mySetupTemplateComponent(Component comp, Object owner, Component item) { if (existsBindings(comp)) { if (comp.getAttribute(OWNER) != null) { comp.setAttribute(HASTEMPLATEOWNER, Boolean.TRUE); //owner is a template } comp.setAttribute(OWNER, owner); comp.setAttribute(ITEM, item); } for (Component c : comp.getChildren()) { mySetupTemplateComponent(c, owner, item); //recursive } }