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 richtextfx Show documentation
Show all versions of richtextfx Show documentation
FX-Text-Area for formatted text and other special effects.
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();
}
}