@Override public void dispose() { property.removeListener(l); } };
@Override public void removeListener(InvalidationListener listener) { wrapped.removeListener(listener); }
@Override public void removeListener(ChangeListener<? super Number> listener) { wrapped.removeListener(listener); }
@Override public void removeListener(InvalidationListener listener) { delegate.removeListener(listener); }
public P beforeChange(T oldSource) { P oldValue = targetProperty != null ? targetProperty.getValue() : null; if (targetProperty != null) { targetProperty.removeListener(targetChangeListener); targetProperty.removeListener(targetInvalidationListener); } return oldValue; }
/** * Unbinds the given property with the field. * * @param binding * The property to be unbound with. * * @return Returns the current field to allow for chaining. */ public F unbind(P binding) { persistentValue.unbindBidirectional(binding); binding.removeListener(externalBindingListener); return (F) this; }
private <T> void installListener(Property<T> property, ChangeListener<? super T> listener) { property.addListener(listener); toDispose.add(() -> property.removeListener(listener)); }
@Override public void removeListener(ChangeListener<? super T> listener) { if (listener instanceof UIThreadAware) { getDelegate().removeListener(listener); } else { getDelegate().removeListener(new UIThreadAwareChangeListener<>(listener)); } }
@Override public void removeListener(InvalidationListener listener) { if (listener instanceof UIThreadAware) { getDelegate().removeListener(listener); } else { getDelegate().removeListener(new UIThreadAwareInvalidationListener(listener)); } } }
@Override public void unsubscribe() { if(!unsubscribed) { condition.removeListener((ChangeListener<Boolean>) this); Property<T> tgt = this.target.get(); if(tgt != null) { tgt.removeListener(this); tgt.unbind(); } unsubscribed = true; } } }
/** * {@inheritDoc} */ public void setBindingMode(BindingMode newValue) { if (BindingMode.CONTINUOUS.equals(newValue)) { value.addListener(bindingModeListener); } else { value.removeListener(bindingModeListener); } }
@Override @SuppressWarnings("unchecked") public void uninstallListener(T element, EventListener listener) { if (listener instanceof ChangeListener) { ChangeListener cl = (ChangeListener) listener; for (Property<?> property : element.properties()) { if (matches(property.getName())) { property.removeListener(cl); } } } }
/** * Unbinds everything */ public void unbind() { property.removeListener(text2fieldListener); textField.focusedProperty().removeListener(focusLostListener); textField.onKeyPressedProperty().setValue(null); }
private void monitorChanges() { properties.addListener((ListChangeListener<Property>) change -> { while (change.next()) { if (change.wasAdded()) change.getAddedSubList().forEach(p -> p.addListener(dirtyListener)); if (change.wasRemoved()) change.getRemoved().forEach(p -> p.removeListener(dirtyListener)); } }); }
@Override public <T> Binding bidirectionalTo(final Property<T> property, BidirectionalConverter<T, Number> converter) { final Binding unidirectionalBinding = to(property, converter); final ChangeListener<Number> listener = (obs, oldVal, newVal) -> property.set(converter.convertBack(newVal)); javaFxProperty.addListener(listener); return () -> { javaFxProperty.removeListener(listener); unidirectionalBinding.unbind(); }; }
@Override public <T> Binding bidirectionalTo(final Property<T> property, BidirectionalConverter<T, S> converter) { final Binding unidirectionalBinding = to(property, converter); final ChangeListener<S> listener = (obs, oldVal, newVal) -> property.set(converter.convertBack(newVal)); javaFxProperty.addListener(listener); return () -> { javaFxProperty.removeListener(listener); unidirectionalBinding.unbind(); }; }
@Override public <T> Binding bidirectionalTo(final Property<T> property, final BidirectionalConverter<T, S> converter) { final Binding unidirectionalBinding = to(property, converter); final ChangeListener<S> listener = (obs, oldVal, newVal) -> property.set(converter.convertBack(newVal)); javaFxProperty.addListener(listener); return () -> { javaFxProperty.removeListener(listener); unidirectionalBinding.unbind(); }; }
@Override public <T> Binding bidirectionalTo(final Property<T> property, BidirectionalConverter<T, Number> converter) { final Binding unidirectionalBinding = to(property, converter); final ChangeListener<Number> listener = (obs, oldVal, newVal) -> property.set(converter.convertBack(newVal)); javaFxProperty.addListener(listener); return () -> { javaFxProperty.removeListener(listener); unidirectionalBinding.unbind(); }; }
@Override public <T> Binding bidirectionalToNumeric(Property<T> property, BidirectionalConverter<T, S> converter) { final Binding unidirectionalBinding = to(property, converter); final ChangeListener<Number> listener = (obs, oldVal, newVal) -> property.set(converter.convertBack(convertNumber(newVal))); javaFxProperty.addListener(listener); return () -> { javaFxProperty.removeListener(listener); unidirectionalBinding.unbind(); }; } }
@Override public <T> Binding bidirectionalToNumeric(final Property<T> property, final BidirectionalConverter<T, S> converter) { final Binding unidirectionalBinding = to(property, converter); final ChangeListener<Number> listener = (obs, oldVal, newVal) -> property.set(converter.convertBack(convertNumber(newVal))); javaFxProperty.addListener(listener); return () -> { javaFxProperty.removeListener(listener); unidirectionalBinding.unbind(); }; } }