/** * Internal use only. */ /* package */static void cacheSavePropertyBinding(ProxyNode node, String property, SavePropertyBinding savePropertyBinding) { while (node != null) { ProxyNode parent = node.getParent(); if (parent == null) { node.getCachedSavePropertyBinding().add(new Pair<String, SavePropertyBinding>(property, savePropertyBinding)); break; } else { String parentProperty = parent.getProperty(); if (!property.startsWith("[") && parentProperty != null && parentProperty.length() != 0) parentProperty += "."; property = parentProperty + property; node = parent; } } }
private Namespace getNamespace(Element el) { if (el != null) { String[] tags = el.tagName().split(":"); if (tags.length > 1) { Pair<Element, Namespace> pair = _nsMap.get(tags[0]); if (pair == null) { throw new UiExceptionX("Unknown namespace: [" + el.tagName() + "]", el.tagName()); } return pair.getY(); } Pair<Element, Namespace> p = _nsMap.get(""); if (p == null) return Namespace.NO_NAMESPACE; else return p.getY(); } return null; }
private Namespace getNamespace(Attribute attr) { if (attr != null) { String[] tags = attr.getOriginalKey().split(":"); if (tags.length > 1) { Pair<Element, Namespace> pair = _nsMap.get(tags[0]); if (pair == null) { throw new UiExceptionX("Unknown namespace: [" + attr.getOriginalKey() + "]", attr.getOriginalKey()); } return pair.getY(); } return Namespace.NO_NAMESPACE; // attribute will return an empty namespace } return null; }
private void initNamespaceMap(String filePath, Elements elements) { _nsMap.put("xml", new Pair<Element, Namespace>(null, Namespace.getSpecial("xml"))); _nsMap.put("xmlns", new Pair<Element, Namespace>(null, Namespace.getSpecial("xmlns"))); _nsMap.put(prefix, new Pair<Element, Namespace>(ele, ns)); List<Namespace> list = _elNSMap.get(ele); if (list == null) _nsMap.put("", new Pair<Element, Namespace>(null, new Namespace("", "")));
/** Returns the method for handling the specified event, or null * if not available. */ public static final Method getEventMethod(Class<?> cls, String evtnm) { final Pair<Class<?>, String> key = new Pair<Class<?>, String>(cls, evtnm); final Object o = _evtmtds.get(key); if (o != null) return o == Objects.UNKNOWN ? null : (Method) o; Method mtd = null; try { mtd = Classes.getCloseMethodBySubclass(cls, evtnm, new Class[] { Event.class }); //with event arg } catch (NoSuchMethodException ex) { try { mtd = cls.getMethod(evtnm); //no argument case } catch (NoSuchMethodException e2) { } } _evtmtds.put(key, mtd != null ? mtd : Objects.UNKNOWN); return mtd; }
Set<Pair<String, SavePropertyBinding>> cachedSavePropertyBindings = ((FormProxyObject) form).collectCachedSavePropertyBinding(); for (Pair<String, SavePropertyBinding> p : cachedSavePropertyBindings) { SavePropertyBinding spbinding = p.getY(); String fieldName = p.getX(); Component cachedComp = spbinding.getComponent(); if (cachedComp.getDesktop() != null) {
for (Iterator<Element> itt = elements.iterator(); itt.hasNext();) { Element e = itt.next(); scripts.add(new Pair<String, String>(e.getAttribute("src"), e.getText(true)));
List<Pair<String, String>> scripts = handler.getScripts(); Pair<String, String> scriptInfo = scripts.get(scripts.size() - 1); String scriptSrc = scriptInfo.getX(); String script = scriptInfo.getY(); if (scriptSrc != null && scriptSrc.length() != 0) { script = Devices.loadJavaScript(exec, scriptSrc);