@Override void onListChanged(final List oldList) { updateWidgetsAndFireEvent(false, property, oldList, newList); } }));
@Override void onListChanged(final List oldList) { updateWidgetsAndFireEvent(false, property, oldList, newList); } }));
/** * Updates all bound widgets and fires the corresponding {@link PropertyChangeEvent}. * * @param * <P> * The property type of the changed property. * @param sync * True if a {@link BindableListChangeHandler} component bound to a list should have it's value set via * {@link TakesValue#setValue(Object)}. * @param property * The name of the property that changed. Must not be null. * @param oldValue * The old value of the property. * @param newValue * The new value of the property. */ <P> void updateWidgetsAndFireEvent(final boolean sync, final String property, final P oldValue, final P newValue) { updateWidgetsAndFireEvent(sync, property, oldValue, newValue, null); }
/** * Updates all bound widgets and fires the corresponding {@link PropertyChangeEvent}. * * @param * <P> * The property type of the changed property. * @param sync * True if a {@link BindableListChangeHandler} component bound to a list should have it's value set via * {@link TakesValue#setValue(Object)}. * @param property * The name of the property that changed. Must not be null. * @param oldValue * The old value of the property. * @param newValue * The new value of the property. */ <P> void updateWidgetsAndFireEvent(final boolean sync, final String property, final P oldValue, final P newValue) { updateWidgetsAndFireEvent(sync, property, oldValue, newValue, null); }
/** * Updates all bound widgets if necessary (if a bound property's value has * changed). This method is invoked in case a bound property changed outside * the property's write method (when using a non accessor method). */ void updateWidgetsAndFireEvents() { for (final String property : propertyTypes.keySet()) { final Object knownValue = knownValues.get(property); final Object actualValue = proxy.get(property); if ((knownValue == null && actualValue != null) || (knownValue != null && !knownValue.equals(actualValue))) { final DataBinder nestedBinder = binders.get(property); if (nestedBinder != null) { nestedBinder.setModel(actualValue, StateSync.FROM_MODEL, true); proxy.set(property, nestedBinder.getModel()); } updateWidgetsAndFireEvent(true, property, knownValue, actualValue); } } }
/** * Updates all bound widgets if necessary (if a bound property's value has * changed). This method is invoked in case a bound property changed outside * the property's write method (when using a non accessor method). */ void updateWidgetsAndFireEvents() { for (final String property : propertyTypes.keySet()) { final Object knownValue = knownValues.get(property); final Object actualValue = proxy.get(property); if ((knownValue == null && actualValue != null) || (knownValue != null && !knownValue.equals(actualValue))) { final DataBinder nestedBinder = binders.get(property); if (nestedBinder != null) { nestedBinder.setModel(actualValue, StateSync.FROM_MODEL, true); proxy.set(property, nestedBinder.getModel()); } updateWidgetsAndFireEvent(true, property, knownValue, actualValue); } } }
private Consumer<Object> modelUpdater(final Object component, final Converter converter, final String lastSubProperty, final BindableProxyAgent<?> agent) { return uiValue -> { final Object oldValue = agent.proxy.get(lastSubProperty); final Object newValue = converter.toModelValue(uiValue); agent.trySettingModelProperty(lastSubProperty, converter, uiValue, newValue); agent.updateWidgetsAndFireEvent(false, lastSubProperty, oldValue, newValue, component); }; }
private Consumer<Object> modelUpdater(final Object component, final Converter converter, final String lastSubProperty, final BindableProxyAgent<?> agent) { return uiValue -> { final Object oldValue = agent.proxy.get(lastSubProperty); final Object newValue = converter.toModelValue(uiValue); agent.trySettingModelProperty(lastSubProperty, converter, uiValue, newValue); agent.updateWidgetsAndFireEvent(false, lastSubProperty, oldValue, newValue, component); }; }
updateWidgetsAndFireEvent(true, property, knownValues.get(property), value); proxy.set(property, newValue); maybeFirePropertyChangeEvent(property, knownValues.get(property), newValue); updateWidgetsAndFireEvent(true, property, knownValues.get(property), newValue, component);
updateWidgetsAndFireEvent(true, property, knownValues.get(property), value); proxy.set(property, newValue); maybeFirePropertyChangeEvent(property, knownValues.get(property), newValue); updateWidgetsAndFireEvent(true, property, knownValues.get(property), newValue, component);
/** * Ensures that the given list property is wrapped in a * {@link BindableListWrapper}, so changes to the list become observable. * * @param property * the name of the list property * * @return a new the wrapped (proxied) list or the provided list if already * proxied */ private List ensureBoundListIsProxied(final String property) { final List oldList = (List) proxy.get(property); final List newList = ensureBoundListIsProxied(property, oldList); if (oldList != newList) updateWidgetsAndFireEvent(true, property, proxy.get(property), newList); return newList; }
/** * Ensures that the given list property is wrapped in a * {@link BindableListWrapper}, so changes to the list become observable. * * @param property * the name of the list property * * @return a new the wrapped (proxied) list or the provided list if already * proxied */ private List ensureBoundListIsProxied(final String property) { final List oldList = (List) proxy.get(property); final List newList = ensureBoundListIsProxied(property, oldList); if (oldList != newList) updateWidgetsAndFireEvent(true, property, proxy.get(property), newList); return newList; }
agent.updateWidgetsAndFireEvent(false, key, oldValue, value);
agent.updateWidgetsAndFireEvent(false, key, oldValue, value);