public void setAuService(AuService ausvc) { if (ausvc != null) initAuxInfo().ausvc = ausvc; else if (_auxinf != null) _auxinf.ausvc = null; }
/** Changes the visibility directly without sending any update to the client. * It is the caller's responsibility to maintain the consistency. * It is rarely called. In most cases, you shall use {@link #setVisible} instead. * @since 5.0.4 */ protected void setVisibleDirectly(boolean visible) { initAuxInfo().visible = visible; }
protected void setSubBindingAnnotationCount(int diff, AbstractComponent node) { node.initAuxInfo().subAnnotCnt += diff; }
public void setWidgetClass(String wgtcls) { if (wgtcls != null && wgtcls.length() > 0) { initAuxInfo().wgtcls = wgtcls; } else if (_auxinf != null) { _auxinf.wgtcls = null; } }
public boolean removeCallback(String name, Callback callback) { if (initAuxInfo().callbacks != null) { List<Callback<?>> list = _auxinf.callbacks.get(name); if (list != null) return list.remove(callback); } return false; }
public Template setTemplate(String name, Template template) { if (template == null) { return _auxinf != null && _auxinf.templates != null ? _auxinf.templates.remove(name) : null; } else { AuxInfo auxinf = initAuxInfo(); if (auxinf.templates == null) auxinf.templates = new HashMap<String, Template>(4); return auxinf.templates.put(name, template); } }
public String setClientAttribute(String name, String value) { if (name == null) throw new IllegalArgumentException(); final String old; if (value != null) { if (initAuxInfo().domattrs == null) _auxinf.domattrs = new LinkedHashMap<String, String>(4); old = _auxinf.domattrs.put(name, value); } else old = _auxinf != null && _auxinf.domattrs != null ? _auxinf.domattrs.remove(name) : null; return old; }
public boolean addCallback(String name, Callback callback) { if (callback == null) throw new IllegalArgumentException(); if (initAuxInfo().callbacks == null) _auxinf.callbacks = new LinkedHashMap<String, List<Callback<?>>>(2); List<Callback<?>> list = _auxinf.callbacks.get(name); if (list == null) { list = new LinkedList<Callback<?>>(); _auxinf.callbacks.put(name, list); } return list.add(callback); }
private SimpleScope attrs() { if (initAuxInfo().attrs == null) _auxinf.attrs = new SimpleScope(this); return _auxinf.attrs; }
public Collection<Callback> getCallback(String name) { if (initAuxInfo().callbacks != null) { List<Callback<?>> list = _auxinf.callbacks.get(name); if (list != null) return cast(list); } return Collections.emptyList(); }
public boolean setVisible(boolean visible) { final boolean old = _auxinf == null || _auxinf.visible; if (old != visible) { initAuxInfo().visible = visible; smartUpdate("visible", _auxinf.visible); } return old; }
private void setBindingAnnotation0(boolean hasBindingAnnot) { AuxInfo auxinf = initAuxInfo(); boolean old = auxinf.hasBindingAnnot; if (old != hasBindingAnnot) { int diff = hasBindingAnnot ? 1 : -1; auxinf.hasBindingAnnot = hasBindingAnnot; updateSubBindingAnnotationCount(diff); } }
public void setStubonly(String stubonly) { int v; if ("false".equals(stubonly)) v = -1; else if ("true".equals(stubonly)) v = 1; else if ("inherit".equals(stubonly)) v = 0; else throw new UiException("Not allowed: " + stubonly); if ((_auxinf != null ? _auxinf.stubonly : 0) != v) initAuxInfo().stubonly = (byte) v; //no need to update client (it is all about server-side handling) }
public String setWidgetOverride(String name, String script) { if (name == null) throw new IllegalArgumentException(); final String old; if (script != null) { if (initAuxInfo().wgtovds == null) _auxinf.wgtovds = new LinkedHashMap<String, String>(4); old = _auxinf.wgtovds.put(name, script); } else old = _auxinf != null && _auxinf.wgtovds != null ? _auxinf.wgtovds.remove(name) : null; if (!Objects.equals(script, old)) smartUpdateWidgetOverride(name, script); return old; }
public String setWidgetListener(String evtnm, String script) { if (evtnm == null) throw new IllegalArgumentException(); final String old; if (script != null) { if (initAuxInfo().wgtlsns == null) _auxinf.wgtlsns = new LinkedHashMap<String, String>(4); old = _auxinf.wgtlsns.put(evtnm, script); } else old = _auxinf != null && _auxinf.wgtlsns != null ? _auxinf.wgtlsns.remove(evtnm) : null; if (!Objects.equals(script, old)) smartUpdateWidgetListener(evtnm, script); return old; }
/** Clones the shared annotations, if shared. * @param autocreate whether to create an annotation map if not available. */ private void unshareAnnotationMap(boolean autocreate) { if (_auxinf != null && _auxinf.annotsShared) { _auxinf.annots = (AnnotationMap) _auxinf.annots.clone(); _auxinf.annotsShared = false; } else if (autocreate && initAuxInfo().annots == null) { _auxinf.annots = new AnnotationMap(); } }
/** Clones the shared event handlers, if shared. * @param autocreate whether to create an event handler map if not available. */ private void unshareEventHandlerMap(boolean autocreate) { if (_auxinf != null && _auxinf.evthdsShared) { _auxinf.evthds = (EventHandlerMap) _auxinf.evthds.clone(); _auxinf.evthdsShared = false; } else if (autocreate && initAuxInfo().evthds == null) { _auxinf.evthds = new EventHandlerMap(); } }
public void setAutag(String tag) { if (tag != null && Strings.isEmpty(tag)) tag = null; if (!Objects.equals(_auxinf != null ? _auxinf.autag : null, tag)) { initAuxInfo().autag = tag; smartUpdate("autag", getAutag()); } }
public void addSharedEventHandlerMap(EventHandlerMap evthds) { if (evthds != null && !evthds.isEmpty()) { unshareEventHandlerMap(false); if (initAuxInfo().evthds == null) { _auxinf.evthds = evthds; _auxinf.evthdsShared = true; } else { _auxinf.evthds.addAll(evthds); } final Desktop desktop = getDesktop(); if (desktop != null) onListenerChange(desktop, true); } }
public void setMold(String mold) { if (mold != null && (DEFAULT.equals(mold) || mold.length() == 0)) mold = null; if (!Objects.equals(_auxinf != null ? _auxinf.mold : DEFAULT, mold)) { if (!_def.hasMold(mold != null ? mold : DEFAULT)) throw new UiException("Unknown mold: " + mold + "; allowed: " + _def.getMoldNames()); final String oldtype = getWidgetClass(); initAuxInfo().mold = mold; if (Objects.equals(oldtype, getWidgetClass())) smartUpdate("mold", getMold()); else invalidate(); } }