org.reactfx.value.OrElseConst 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.value.ObservableValue;
import org.reactfx.Subscription;
class OrElseConst extends ValBase {
private final ObservableValue extends T> src;
private final T other;
OrElseConst(ObservableValue extends T> src, T other) {
this.src = src;
this.other = other;
}
@Override
protected T computeValue() {
T val = src.getValue();
return val != null ? val : other;
}
@Override
protected Subscription connect() {
return Val.observeInvalidations(src, obs -> invalidate());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy