org.reactfx.value.ValWrapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of reactfx Show documentation
Show all versions of reactfx Show documentation
Reactive event streams for JavaFX
package org.reactfx.value;
import javafx.beans.InvalidationListener;
import javafx.beans.value.ObservableValue;
import org.reactfx.Subscription;
class ValWrapper> extends ValBase {
private final D delegate;
ValWrapper(D delegate) {
this.delegate = delegate;
}
D getDelegate() {
return delegate;
}
@Override
protected Subscription connect() {
InvalidationListener listener = obs -> invalidate();
delegate.addListener(listener);
return () -> delegate.removeListener(listener);
}
@Override
protected T computeValue() {
return delegate.getValue();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy