org.reactfx.inhibeans.ObservableBase 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.inhibeans;
import org.reactfx.util.ListHelper;
import javafx.beans.InvalidationListener;
import javafx.beans.Observable;
public abstract class ObservableBase implements Observable {
private ListHelper listeners;
@Override
public void addListener(InvalidationListener listener) {
listeners = ListHelper.add(listeners, listener);
}
@Override
public void removeListener(InvalidationListener listener) {
listeners = ListHelper.remove(listeners, listener);
}
protected void notifyListeners() {
ListHelper.forEach(listeners, l -> l.invalidated(this));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy