/** Applies the custom attributes. * <p>Note: this method does nothing if {@link #isEffective} returns false. */ public void apply(Page page) { if (_attrs != null && isEffective(page)) { final Evaluator eval = getEvaluator(); for (Map.Entry<String, Object> me : _attrs.entrySet()) { final String name = me.getKey(); final Object value = me.getValue(); page.setAttribute(name, Utils.evaluateComposite(eval, page, value), _scope != -1 ? _scope : Component.PAGE_SCOPE); } } }
new AttributesInfo(parent, attrs, scope, composite, ConditionImpl.getInstance(ifc, unless));
/** Applies the custom attributes. * <p>Note: this method does nothing if {@link #isEffective} returns false. */ public void apply(Component comp) { if (_attrs != null && isEffective(comp)) { final Evaluator eval = getEvaluator(); for (Map.Entry<String, Object> me : _attrs.entrySet()) { final String name = me.getKey(); final Object value = me.getValue(); comp.setAttribute(name, Utils.evaluateComposite(eval, comp, value), _scope != -1 ? _scope : Component.COMPONENT_SCOPE); //bug zk-1298, handle special composerName, see Components#wireController if ("composerName".equals(name)) { Object ctrlnm = comp.getAttribute(name); if (ctrlnm instanceof String) { Object controller = comp.removeAttribute("_$composer$_"); //get from special attribute if (controller != null && comp.getAttribute((String) ctrlnm) == null) { comp.setAttribute((String) ctrlnm, controller); } } } } } }