public Object setAttribute(String name, Object value) { return _owner.setAttribute(name, value); }
public Object setAttribute(String name, Object value, boolean recurse) { return _owner.setAttribute(name, value, recurse); }
public static void markHandling(Component comp, Binder binder) { comp.setAttribute(BinderImpl.BINDER, binder); }
private void saveBinder(Component comp) { final String val = Library.getProperty(COMPATIBLE); if ("true".equals(val)) { comp.setAttribute(_name, _binder, Component.SPACE_SCOPE); } else { comp.setAttribute(_name, _binder); } }
/** * Expose icon urls for auto-wiring. */ @Override public void doBeforeComposeChildren(Component comp) throws Exception { super.doBeforeComposeChildren(comp); comp.setAttribute("iconInfoOnly", ICON_INFO); comp.setAttribute("iconActionable", ICON_ACTIONABLE); comp.setAttribute("iconPriority", ICON_PRIORITY); comp.setAttribute("iconType", ICON_TYPE); comp.setAttribute("iconIndicator", ICON_INDICATOR); comp.setAttribute("iconPriorityHigh", PriorityRenderer.getImage(Priority.HIGH)); comp.setAttribute("iconPriorityMedium", PriorityRenderer.getImage(Priority.MEDIUM)); comp.setAttribute("iconPriorityLow", PriorityRenderer.getImage(Priority.LOW)); }
/** * Applies the custom attributes by component. * @param comp */ public void apply(Component comp) { for (Iterator it = _attrs.entrySet().iterator(); it.hasNext();) { final Map.Entry me = (Map.Entry)it.next(); final String name = (String)me.getKey(); comp.setAttribute(name, me.getValue(), _scope); } } /**
private void addChildrenBindingRenderedComps(final Component owner, Component[] items, int index) { List<Component[]> cbrCompsList = (List<Component[]>) owner .getAttribute(BinderCtrl.CHILDREN_BINDING_RENDERED_COMPONENTS); if (cbrCompsList == null) cbrCompsList = new LinkedList<Component[]>(); cbrCompsList.add(index, items); owner.setAttribute(BinderCtrl.CHILDREN_BINDING_RENDERED_COMPONENTS, cbrCompsList); }
@Override public void doBeforeComposeChildren(Component comp) throws Exception { super.doBeforeComposeChildren(comp); comp.setAttribute("iconPriority", MainController.ICON_PRIORITY); }
@SuppressWarnings("unchecked") private static Set<String> getEvtLisSet(Component comp, String name) { Object obj = comp.getAttribute(name); if (obj != null) return (Set<String>) obj; Set<String> set = new HashSet<String>(); comp.setAttribute(name, set); return set; }
public void applyAttributes(Component comp) { if (_custAttrs != null) { for (Map.Entry<String, ExValue> me : _custAttrs.entrySet()) { comp.setAttribute(me.getKey(), me.getValue().getValue(_evalr, comp)); } } }
/** Note: data must be non-null. */ @SuppressWarnings("unchecked") private static Integer getKeyOfData(Component comp, Object data) { Object[] inf = (Object[]) comp.getAttribute(Attributes.ECHO_DATA); if (inf == null) comp.setAttribute(Attributes.ECHO_DATA, inf = new Object[] { new Integer(0), new HashMap(4) }); final Integer key = (Integer) inf[0]; ((Map) inf[1]).put(key, data); inf[0] = new Integer(key.intValue() + 1); return key; }
public static void addModel(Component comp, Object model) { final String name = getModelName(comp); comp.setAttribute(name, model); }
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 } }
public void doAfterCompose(Component comp) throws Exception { _binder = new AnnotateDataBinder(comp); comp.setAttribute("binder", _binder); _binder.loadAll(); } }
/** * Internal use only. * Check and init Activator */ public void initActivator() { if (_rootComp != null && !_rootComp.hasAttribute(ACTIVATOR)) _rootComp.setAttribute(ACTIVATOR, new Activator()); //keep only one instance in root comp } }
/** * Update the original recipient list, set the response attribute, and close the dialog */ public void onClick$btnOK() { recipients.clear(); recipients.addAll(modelRecipients); root.setAttribute("ok", txtComment.isVisible() ? txtComment.getText() : true); root.detach(); } }
public void setViewModel(Object vm) { checkInit(); _rootComp.setAttribute(BinderCtrl.VM, vm); _hasGetConverterMethod = true; //reset to true _hasGetValidatorMethod = true; //reset to true collectNotifyCommands(vm); }
/** * get a Binder Keeper or create it by demand. * * @param comp * @return */ static BinderKeeper getInstance(Component comp) { BinderKeeper keeper = (BinderKeeper) comp.getAttribute(KEY_BINDER_KEEPER, true); if (keeper == null) { comp.setAttribute(KEY_BINDER_KEEPER, keeper = new BinderKeeper(comp)); } return keeper; }
private void setValue(int col, int row, String value) { Component cmp = getCell(col, row).getFirstChild(); cmp.setAttribute("value", value); if (cmp instanceof Label) { ((Label) cmp).setValue(value); } else { ((Textbox) cmp).setValue(value); } }
public void handle(ServletRequest request, ServletResponse response, AccessDeniedException accessDeniedException) throws IOException, ServletException { // Put exception into request scope (perhaps of use to a view) ((HttpServletRequest) request).setAttribute(AccessDeniedHandlerImpl.ACEGI_SECURITY_ACCESS_DENIED_EXCEPTION_KEY, accessDeniedException); final Component comp = (Component) request.getAttribute(ZkEventExceptionFilter.COMPONENT); if (!comp.isListenerAvailable(ON_ACCESSDENIED, true)) { final EventListener<Event> listener = new ShowWindowEventListener<Event>(); comp.setAttribute(ON_ACCESSDENIED, listener); comp.addEventListener(ON_ACCESSDENIED, listener); } final String url = getErrorPage(); Events.postEvent(new Event(ON_ACCESSDENIED, comp, url != null ? url : "~./accessDenied.zul")); } }