private DataBinder<T> unbind(final boolean clearBindings) { for (final Binding binding : bindings.values()) { getAgent().unbind(binding); } if (clearBindings) { bindings.clear(); } clearModelHandlers(); // Proxies without bindings will be removed from the cache to make sure the // garbage collector can do its job (see // BindableProxyFactory#removeCachedProxyForModel). We throw away the // reference to the proxy to force a new lookup in case this data binder // will be reused. unwrapProxy(); return this; }
/** * Unbinds all widgets bound to the specified model property by previous calls * to {@link #bind(HasValue, Object, String)}. This method has no effect if * the specified property was never bound. * * @param property * The name of the property (or a property chain) to unbind, Must not * be null. * * @return the same {@link DataBinder} instance to support call chaining. * @throws InvalidPropertyExpressionException * If the provided property chain expression is invalid. */ public DataBinder<T> unbind(final String property) { for (final Binding binding : bindings.get(property)) { getAgent().unbind(binding); } bindings.removeAll(property); if (bindings.isEmpty()) { // Proxies without bindings will be removed from the cache to make sure // the garbage collector can do its job (see // BindableProxyFactory#removeCachedProxyForModel). We throw away the // reference to the proxy to force a new lookup in case this data binder // will be reused. unwrapProxy(); } return this; }
/** * Unbinds all widgets bound to the specified model property by previous calls * to {@link #bind(HasValue, Object, String)}. This method has no effect if * the specified property was never bound. * * @param property * The name of the property (or a property chain) to unbind, Must not * be null. * * @return the same {@link DataBinder} instance to support call chaining. * @throws InvalidPropertyExpressionException * If the provided property chain expression is invalid. */ public DataBinder<T> unbind(final String property) { for (final Binding binding : bindings.get(property)) { getAgent().unbind(binding); } bindings.removeAll(property); if (bindings.isEmpty()) { // Proxies without bindings will be removed from the cache to make sure // the garbage collector can do its job (see // BindableProxyFactory#removeCachedProxyForModel). We throw away the // reference to the proxy to force a new lookup in case this data binder // will be reused. unwrapProxy(); } return this; }
private DataBinder<T> unbind(final boolean clearBindings) { for (final Binding binding : bindings.values()) { getAgent().unbind(binding); } if (clearBindings) { bindings.clear(); } clearModelHandlers(); // Proxies without bindings will be removed from the cache to make sure the // garbage collector can do its job (see // BindableProxyFactory#removeCachedProxyForModel). We throw away the // reference to the proxy to force a new lookup in case this data binder // will be reused. unwrapProxy(); return this; }
/** * Unbinds all widgets bound to the specified model property by previous calls * to {@link #bind(HasValue, Object, String)}. This method has no effect if * the specified property was never bound. * * @param property * The name of the property (or a property chain) to unbind, Must not * be null. * * @return the same {@link DataBinder} instance to support call chaining. * @throws InvalidPropertyExpressionException * If the provided property chain expression is invalid. */ public DataBinder<T> unbind(final String property) { for (final Binding binding : bindings.get(property)) { getAgent().unbind(binding); } bindings.removeAll(property); if (bindings.isEmpty()) { // Proxies without bindings will be removed from the cache to make sure // the garbage collector can do its job (see // BindableProxyFactory#removeCachedProxyForModel). We throw away the // reference to the proxy to force a new lookup in case this data binder // will be reused. unwrapProxy(); } return this; }
private DataBinder<T> unbind(final boolean clearBindings) { for (final Binding binding : bindings.values()) { getAgent().unbind(binding); } if (clearBindings) { bindings.clear(); } clearModelHandlers(); // Proxies without bindings will be removed from the cache to make sure the // garbage collector can do its job (see // BindableProxyFactory#removeCachedProxyForModel). We throw away the // reference to the proxy to force a new lookup in case this data binder // will be reused. unwrapProxy(); return this; }
/** * Unbinds the property with the given name. * * @param binding * the name of the model property to unbind, must not be null. */ public void unbind(final Binding binding) { final String property = binding.getProperty(); validatePropertyExpr(property); final int dotPos = property.indexOf("."); if (dotPos > 0) { final String bindableProperty = property.substring(0, dotPos); final DataBinder binder = binders.get(bindableProperty); if (binder != null) { final BindableProxyAgent<T> nestedAgent = ((BindableProxy<T>) binder.getModel()).getBindableProxyAgent(); final Collection<Binding> nestedBindings = nestedAgent.bindings.get(property.substring(dotPos + 1)); for (final Binding nestedBinding : nestedBindings.toArray(new Binding[nestedBindings.size()])) { if (binding.getComponent() == nestedBinding.getComponent()) { nestedAgent.unbind(nestedBinding); } } } } binding.removeHandlers(); bindings.remove(property, binding); if (bindings.isEmpty()) { BindableProxyFactory.removeCachedProxyForModel(target); } }
/** * Unbinds the property with the given name. * * @param binding * the name of the model property to unbind, must not be null. */ public void unbind(final Binding binding) { final String property = binding.getProperty(); validatePropertyExpr(property); final int dotPos = property.indexOf("."); if (dotPos > 0) { final String bindableProperty = property.substring(0, dotPos); final DataBinder binder = binders.get(bindableProperty); if (binder != null) { final BindableProxyAgent<T> nestedAgent = ((BindableProxy<T>) binder.getModel()).getBindableProxyAgent(); final Collection<Binding> nestedBindings = nestedAgent.bindings.get(property.substring(dotPos + 1)); for (final Binding nestedBinding : nestedBindings.toArray(new Binding[nestedBindings.size()])) { if (binding.getComponent() == nestedBinding.getComponent()) { nestedAgent.unbind(nestedBinding); } } } } binding.removeHandlers(); bindings.remove(property, binding); if (bindings.isEmpty()) { BindableProxyFactory.removeCachedProxyForModel(target); } }
newProxy.getBindableProxyAgent().unbind(b); bindings.put(b.getProperty(), newProxy.getBindableProxyAgent() .bind(b.getComponent(), b.getProperty(), b.getConverter(), bindOnKeyUp, newInitState));
newProxy.getBindableProxyAgent().unbind(b); bindings.put(b.getProperty(), newProxy.getBindableProxyAgent() .bind(b.getComponent(), b.getProperty(), b.getConverter(), bindOnKeyUp, newInitState));
newProxy.getBindableProxyAgent().unbind(b); bindings.put(b.getProperty(), newProxy.getBindableProxyAgent() .bind(b.getComponent(), b.getProperty(), b.getConverter(), bindOnKeyUp, newInitState));