private BindPath createBindPath(String propertyName, BindPathSnooper snooper) { BindPath bp = new BindPath(); bp.propertyName = propertyName; bp.updateLocalSyntheticProperties(syntheticBindings); List<BindPath> childPaths = new ArrayList<BindPath>(); for (Map.Entry<String, BindPathSnooper> entry : snooper.fields.entrySet()) { childPaths.add(createBindPath(entry.getKey(), entry.getValue())); } bp.children = childPaths.toArray(new BindPath[childPaths.size()]); return bp; }
/** * Adds all the listeners to the objects in the bind path. * This assumes that we are not added as listeners to any of them, hence * it is not idempotent. * * @param listener This listener to attach. * @param newObject The object we should read our property off of. * @param updateSet The list of objects we have added listeners to */ public void addAllListeners(PropertyChangeListener listener, Object newObject, Set updateSet) { addListeners(listener, newObject, updateSet); if ((children != null) && (children.length > 0)) { try { Object newValue = null; if (newObject != null) { updateSet.add(newObject); newValue = extractNewValue(newObject); } for (BindPath child : children) { child.addAllListeners(listener, newValue, updateSet); } } catch (Exception e) { e.printStackTrace(System.out); //LOGME // do we ignore it, or fail? } } }
removeListeners(); if (newObject != null) { TriggerBinding syntheticTrigger = getSyntheticTriggerBinding(newObject); MetaClass mc = InvokerHelper.getMetaClass(newObject); if (syntheticTrigger != null) {
removeListeners(); if (newObject != null) { updateSet.add(newObject); newValue = extractNewValue(newObject); child.updatePath(listener, newValue, updateSet); addListeners(listener, newObject, updateSet);
public void unbind() { updateObjects.clear(); for (BindPath path : bindPaths) { // we can't just remove from the update set, // because we may be local or global, the path knows path.removeListeners(); } bound = false; }
public void bind() { updateObjects.clear(); for (BindPath bp : bindPaths) { bp.addAllListeners(this, bp.currentObject, updateObjects); } bound = true; }
public void propertyChange(PropertyChangeEvent evt) { if (updateObjects.contains(evt.getSource())) { for (BindPath bp : bindPaths) { Set newUpdates = new HashSet(); bp.updatePath(this, bp.currentObject, newUpdates); updateObjects = newUpdates; } } update(); } }
removeListeners(); if (newObject != null) { updateSet.add(newObject); newValue = extractNewValue(newObject); child.updatePath(listener, newValue, updateSet); addListeners(listener, newObject, updateSet);
public void unbind() { updateObjects.clear(); for (BindPath path : bindPaths) { // we can't just remove from the update set, // because we may be local or global, the path knows path.removeListeners(); } bound = false; }
public void bind() { updateObjects.clear(); for (BindPath bp : bindPaths) { bp.addAllListeners(this, bp.currentObject, updateObjects); } bound = true; }
public void propertyChange(PropertyChangeEvent evt) { if (updateObjects.contains(evt.getSource())) { for (BindPath bp : bindPaths) { Set newUpdates = new HashSet(); bp.updatePath(this, bp.currentObject, newUpdates); updateObjects = newUpdates; } } update(); } }
removeListeners(); if (newObject != null) { updateSet.add(newObject); newValue = extractNewValue(newObject); child.updatePath(listener, newValue, updateSet); addListeners(listener, newObject, updateSet);
/** * Adds all the listeners to the objects in the bind path. * This assumes that we are not added as listeners to any of them, hence * it is not idempotent. * * @param listener This listener to attach. * @param newObject The object we should read our property off of. * @param updateSet The list of objects we have added listeners to */ public void addAllListeners(PropertyChangeListener listener, Object newObject, Set updateSet) { addListeners(listener, newObject, updateSet); if ((children != null) && (children.length > 0)) { try { Object newValue = null; if (newObject != null) { updateSet.add(newObject); newValue = extractNewValue(newObject); } for (BindPath child : children) { child.addAllListeners(listener, newValue, updateSet); } } catch (Exception e) { e.printStackTrace(System.out); //LOGME // do we ignore it, or fail? } } }
private BindPath createBindPath(String propertyName, BindPathSnooper snooper) { BindPath bp = new BindPath(); bp.propertyName = propertyName; bp.updateLocalSyntheticProperties(syntheticBindings); List<BindPath> childPaths = new ArrayList<BindPath>(); for (Map.Entry<String, BindPathSnooper> entry : snooper.fields.entrySet()) { childPaths.add(createBindPath(entry.getKey(), entry.getValue())); } bp.children = childPaths.toArray(new BindPath[childPaths.size()]); return bp; }
removeListeners(); if (newObject != null) { TriggerBinding syntheticTrigger = getSyntheticTriggerBinding(newObject); MetaClass mc = InvokerHelper.getMetaClass(newObject); if (syntheticTrigger != null) {
public void unbind() { updateObjects.clear(); for (BindPath path : bindPaths) { // we can't just remove from the update set, // because we may be local or global, the path knows path.removeListeners(); } bound = false; }
public void bind() { updateObjects.clear(); for (BindPath bp : bindPaths) { bp.addAllListeners(this, bp.currentObject, updateObjects); } bound = true; }
public void propertyChange(PropertyChangeEvent evt) { if (updateObjects.contains(evt.getSource())) { for (BindPath bp : bindPaths) { Set newUpdates = new HashSet(); bp.updatePath(this, bp.currentObject, newUpdates); updateObjects = newUpdates; } } update(); } }
removeListeners(); if (newObject != null) { updateSet.add(newObject); newValue = extractNewValue(newObject); child.updatePath(listener, newValue, updateSet); addListeners(listener, newObject, updateSet);
/** * Adds all the listeners to the objects in the bind path. * This assumes that we are not added as listeners to any of them, hence * it is not idempotent. * * @param listener This listener to attach. * @param newObject The object we should read our property off of. * @param updateSet The list of objects we have added listeners to */ public void addAllListeners(PropertyChangeListener listener, Object newObject, Set updateSet) { addListeners(listener, newObject, updateSet); if ((children != null) && (children.length > 0)) { try { Object newValue = null; if (newObject != null) { updateSet.add(newObject); newValue = extractNewValue(newObject); } for (BindPath child : children) { child.addAllListeners(listener, newValue, updateSet); } } catch (Exception e) { e.printStackTrace(System.out); //LOGME // do we ignore it, or fail? } } }