/** * Updates all target observable objects to reflect the current state of the * model observable objects. * */ public final void updateTargets() { for (Iterator it = bindings.iterator(); it.hasNext();) { Binding binding = (Binding) it.next(); binding.updateModelToTarget(); } }
/** * Updates all model observable objects to reflect the current state of the * target observable objects. * */ public final void updateModels() { for (Iterator it = bindings.iterator(); it.hasNext();) { Binding binding = (Binding) it.next(); binding.updateTargetToModel(); } }
/** * Updates all target observable objects to reflect the current state of the * model observable objects. * */ public final void updateTargets() { for (Iterator it = bindings.iterator(); it.hasNext();) { Binding binding = (Binding) it.next(); binding.updateModelToTarget(); } }
/** * Updates all model observable objects to reflect the current state of the * target observable objects. * */ public final void updateModels() { for (Iterator it = bindings.iterator(); it.hasNext();) { Binding binding = (Binding) it.next(); binding.updateTargetToModel(); } }
private void recompute() { if (isDirty) { Map newContents = new HashMap(); for (Iterator it = bindings.iterator(); it.hasNext();) { Binding binding = (Binding) it.next(); IObservableValue validationError = binding .getValidationStatus(); dependencies.add(validationError); validationError.addChangeListener(markDirtyChangeListener); IStatus validationStatusValue = (IStatus) validationError .getValue(); newContents.put(binding, validationStatusValue); } wrappedMap.putAll(newContents); isDirty = false; } }
private void recompute() { if (isDirty) { Map newContents = new HashMap(); for (Iterator it = bindings.iterator(); it.hasNext();) { Binding binding = (Binding) it.next(); IObservableValue validationError = binding .getValidationStatus(); dependencies.add(validationError); validationError.addChangeListener(markDirtyChangeListener); IStatus validationStatusValue = (IStatus) validationError .getValue(); newContents.put(binding, validationStatusValue); } wrappedMap.putAll(newContents); isDirty = false; } }
@Override protected void doSetValue(Object value) { boolean oldStale = stale; // Update the staleness state by checking whether any of the current // dependencies is stale. stale = false; for (Iterator iter = targets.iterator(); iter.hasNext();) { IObservable dependency = (IObservable) iter.next(); if (dependency.isStale()) { stale = true; break; } } Object oldValue = this.value; this.value = value; // If either becoming non-stale or setting a new value, we must fire // a value change event. if ((oldStale && !stale) || !Util.equals(oldValue, value)) { fireValueChange(Diffs.createValueDiff(oldValue, value)); } else if (!oldStale && stale) { fireStale(); } }
protected void doSetValue(Object value) { boolean oldStale = stale; // Update the staleness state by checking whether any of the current // dependencies is stale. stale = false; for (Iterator iter = targets.iterator(); iter.hasNext();) { IObservable dependency = (IObservable) iter.next(); if (dependency.isStale()) { stale = true; break; } } Object oldValue = this.value; this.value = value; // If either becoming non-stale or setting a new value, we must fire // a value change event. if ((oldStale && !stale) || !Util.equals(oldValue, value)) { fireValueChange(Diffs.createValueDiff(oldValue, value)); } else if (!oldStale && stale) { fireStale(); } }
@Override protected void doSetValue(IStatus value) { boolean oldStale = stale; // Update the staleness state by checking whether any of the current // dependencies is stale. stale = false; for (Iterator<IObservable> iter = targets.iterator(); iter.hasNext();) { IObservable dependency = iter.next(); if (dependency.isStale()) { stale = true; break; } } IStatus oldValue = this.value; this.value = value; // If either becoming non-stale or setting a new value, we must fire // a value change event. if ((oldStale && !stale) || !Util.equals(oldValue, value)) { fireValueChange(Diffs.createValueDiff(oldValue, value)); } else if (!oldStale && stale) { fireStale(); } }