/** * Create an iterator which selects from all the descendants of a given * component, including itself. * @param root the reference component for selector * @param selector the selector string */ public ComponentIterator(Component root, String selector){ this(root.getPage(), root, selector); }
/** * Create an iterator which selects from all the descendants of a given * component, including itself. * @param root the reference component for selector * @param selector the selector string */ public ComponentIterator(Component root, String selector) { this(root.getPage(), root, selector); }
/** Returns the page owning this event, or null if broadcast. */ public final Page getPage() { return _target != null ? _target.getPage() : null; }
/** Clears components if it belongs to invalidated or removed page. */ private void clearInInvalidPage(Collection<Component> coll) { for (Iterator<Component> it = coll.iterator(); it.hasNext();) { final Component comp = it.next(); final Page page = comp.getPage(); if (page != null && ((_pgRemoved != null && _pgRemoved.contains(page)) || (_pgInvalid != null && _pgInvalid.contains(page)))) it.remove(); } }
private void renderValue(Component value) { if (value == null || value.getPage() == null) _buf.append((String) null); else _buf.append("{$u:'").append(value.getUuid()).append("'}"); }
private String renderValue(Component value) { if (value == null || value.getPage() == null) return null; else return new StringBuilder().append("{$u:'").append(value.getUuid()).append("'}").toString(); }
/** Returns the current page. * @since 5.0.10 */ protected Page getPage() { if (self != null) { final Page page = self.getPage(); if (page != null) return page; } return super.getPage(); }
public String toJSONString() { return _comp.getPage() == null ? "null" : "{$u:'" + _comp.getUuid() + "'}"; } }
private void addSmartUpdate0(Component comp, String attr, Object value, boolean append, int priority) { if (comp == null) throw new IllegalArgumentException(); //main fix for BUG ZK-1464 if (_ending && (comp.getPage() == null || (_pgRemoved != null && _pgRemoved.contains(comp.getPage())))) { return; } final Map<String, TimedValue> respmap = getAttrRespMap(comp); if (respmap != null) respmap.put(append ? attr + ":" + _cntMultSU++ : attr, new TimedValue(_timed++, comp, attr, value, priority)); }
private Page getPage() { final Page page = _comp.getPage(); if (page != null) return page; return _desktop.getFirstPage(); }
/** Returns the parent of the ID space, or null if not found. * @since 5.0.0 */ public static IdSpace getParentIdSpace(IdSpace idspace) { if (idspace instanceof Component) { final Component c = (Component) idspace; final Component p = c.getParent(); return p != null ? p.getSpaceOwner() : c.getPage(); } return null; }
/** * 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 static IdSpace getSpaceOwnerOfParent(Component comp) { final Component parent = comp.getParent(); return parent != null ? spaceOwnerNoVirtual(parent) : //ignore virtual IdSpace comp.getPage(); }
/** * 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(); }
/** Returns the current page. */ protected Page getPage() { if (_self != null) { final Page page = _self.getPage(); if (page != null) return page; } final Execution exec = Executions.getCurrent(); return exec != null ? ((ExecutionCtrl) exec).getCurrentPage() : null; }
/** load bean value into the attribute of the specified component. * @param comp the component. * @param bean the bean value. */ public void loadAttribute(Component comp, Object bean) { if (!isLoadable() || _attr.startsWith("_") || DataBinder.isTemplate(comp) || comp.getPage() == null) { return; //cannot load, a control attribute, or a detached component, skip! } myLoadAttribute(comp, bean); }
public String getNativeContent(Component comp, List<NodeInfo> children, Native.Helper helper) { final StringBuffer sb = new StringBuffer(256); getNativeContent( new CreateInfo(((WebAppCtrl) _wapp).getUiFactory(), Executions.getCurrent(), comp.getPage(), null), sb, comp, children, helper); return sb.toString(); }
private boolean loadComponent0(Component comp) { if (isTemplate(comp) || comp.getPage() == null) { return true; //skip detached component } final Collection bindings = getBindings(comp); if (bindings != null) { loadAttrs(comp, bindings); } return false; }
/** load bean value into the attribute of the specified component. * @param comp the component. */ public void loadAttribute(Component comp) { if (!isLoadable() || _attr.startsWith("_") || DataBinder.isTemplate(comp) || comp == null //bug #1941947 Cannot find associated CollectionItem || comp.getPage() == null) { return; //cannot load, a control attribute, or a detached component, skip! } Object bean = _binder.getBeanAndRegisterBeanSameNodes(comp, _expression); myLoadAttribute(comp, bean); }