/** * 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 * @param list * the list that needs to be proxied * * @return a new the wrapped (proxied) list or the provided list if already * proxied */ List ensureBoundListIsProxied(final String property, final List list) { if (!(list instanceof BindableListWrapper) && bindings.containsKey(property) && list != null) { final BindableListWrapper newList = new BindableListWrapper(list); addHandlersForBindableListWrapper(property, newList); return newList; } return list; }
/** * 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 * @param list * the list that needs to be proxied * * @return a new the wrapped (proxied) list or the provided list if already * proxied */ List ensureBoundListIsProxied(final String property, final List list) { if (!(list instanceof BindableListWrapper) && bindings.containsKey(property) && list != null) { final BindableListWrapper newList = new BindableListWrapper(list); addHandlersForBindableListWrapper(property, newList); return newList; } return list; }
private Binding createBinding(final Object component, final String property, final Converter converter, final Supplier<Map<Class<? extends GwtEvent>, HandlerRegistration>> handlerRegistrar) { final Binding binding = new Binding(property, component, converter, handlerRegistrar.get()); bindings.put(property, binding); if (propertyTypes.get(property).isList()) { if ("this".equals(property) && proxy instanceof BindableListWrapper) { addHandlersForBindableListWrapper("this", (BindableListWrapper) proxy); } else { proxy.set(property, ensureBoundListIsProxied(property)); } } return binding; }
private Binding createBinding(final Object component, final String property, final Converter converter, final Supplier<Map<Class<? extends GwtEvent>, HandlerRegistration>> handlerRegistrar) { final Binding binding = new Binding(property, component, converter, handlerRegistrar.get()); bindings.put(property, binding); if (propertyTypes.get(property).isList()) { if ("this".equals(property) && proxy instanceof BindableListWrapper) { addHandlersForBindableListWrapper("this", (BindableListWrapper) proxy); } else { proxy.set(property, ensureBoundListIsProxied(property)); } } return binding; }