Top Fields Constructors Methods
org.reactfx

public Class Indicator

extends Object
implements ObservableBooleanValue, Guardian
Class Inheritance
All Implemented Interfaces
org.reactfx.Guardian, javafx.beans.value.ObservableBooleanValue, javafx.beans.value.ObservableValue, javafx.beans.Observable
Annotations
@Deprecated
Imports
java.util.function.Supplier, javafx.beans.InvalidationListener, javafx.beans.value.ChangeListener, .ObservableBooleanValue, org.reactfx.util.ListHelper

Deprecated

Indicator is unsafe on recursion: it may report misleading changes. Use SuspendableNo instead.

Field Summary

Modifier and TypeField and Description
private ListHelper<ChangeListener<? super Boolean>>
private ListHelper<InvalidationListener>
private int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addListener(ChangeListener<? super Boolean> listener)

Implements javafx.beans.value.ObservableValue.addListener.

Adds a ChangeListener which will be notified whenever the value of the ObservableValue changes.

public void
addListener(InvalidationListener listener)

Implements javafx.beans.Observable.addListener.

Adds an InvalidationListener which will be notified whenever the Observable becomes invalid.

public boolean
get()

Implements javafx.beans.value.ObservableBooleanValue.get.

Returns the current value of this ObservableBooleanValue.

public Boolean
getValue()

Implements javafx.beans.value.ObservableValue.getValue.

Returns the current value of this ObservableValue

public Guard
guard()

Implements org.reactfx.Guardian.guard.

Equivalent to on().

public boolean
public boolean
isOn()

private void
notifyListeners(boolean value)

public EventStream<Void>
offs()

public Guard

Returns:

a Guard that, when closed, resets this indicator to the original state.
on
()

Turns this indicator on.

public EventStream<Void>
ons()

public void
onWhile(Runnable r)

Runs the given computation, making sure this indicator is on.

public <T> T
onWhile(Supplier<T> f)

Runs the given computation, making sure this indicator is on.

private void
public void
removeListener(ChangeListener<? super Boolean> listener)

Implements javafx.beans.value.ObservableValue.removeListener.

Removes the given listener from the list of listeners that are notified whenever the value of the ObservableValue changes.

public void
removeListener(InvalidationListener listener)

Implements javafx.beans.Observable.removeListener.

Removes the given listener from the list of listeners, that are notified whenever the value of the Observable becomes invalid.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cListenersback to summary
private ListHelper<ChangeListener<? super Boolean>> cListeners
iListenersback to summary
private ListHelper<InvalidationListener> iListeners
onback to summary
private int on

Constructor Detail

Indicatorback to summary
public Indicator()

Method Detail

addListenerback to summary
public void addListener(ChangeListener<? super Boolean> listener)

Implements javafx.beans.value.ObservableValue.addListener.

Doc from javafx.beans.value.ObservableValue.addListener.

Adds a ChangeListener which will be notified whenever the value of the ObservableValue changes. If the same listener is added more than once, then it will be notified more than once. That is, no check is made to ensure uniqueness.

Note that the same actual ChangeListener instance may be safely registered for different ObservableValues.

The ObservableValue stores a strong reference to the listener which will prevent the listener from being garbage collected and may result in a memory leak. It is recommended to either unregister a listener by calling removeListener after use or to use an instance of WeakChangeListener avoid this situation.

Annotations
@Override
addListenerback to summary
public void addListener(InvalidationListener listener)

Implements javafx.beans.Observable.addListener.

Doc from javafx.beans.Observable.addListener.

Adds an InvalidationListener which will be notified whenever the Observable becomes invalid. If the same listener is added more than once, then it will be notified more than once. That is, no check is made to ensure uniqueness.

Note that the same actual InvalidationListener instance may be safely registered for different Observables.

The Observable stores a strong reference to the listener which will prevent the listener from being garbage collected and may result in a memory leak. It is recommended to either unregister a listener by calling removeListener after use or to use an instance of WeakInvalidationListener avoid this situation.

Annotations
@Override
getback to summary
public boolean get()

Implements javafx.beans.value.ObservableBooleanValue.get.

Doc from javafx.beans.value.ObservableBooleanValue.get.

Returns the current value of this ObservableBooleanValue.

Annotations
@Override
getValueback to summary
public Boolean getValue()

Implements javafx.beans.value.ObservableValue.getValue.

Doc from javafx.beans.value.ObservableValue.getValue.

Returns the current value of this ObservableValue

Annotations
@Override
guardback to summary
public Guard guard()

Implements org.reactfx.Guardian.guard.

Equivalent to on().

Annotations
@Override
isOffback to summary
public boolean isOff()
isOnback to summary
public boolean isOn()
notifyListenersback to summary
private void notifyListeners(boolean value)
offsback to summary
public EventStream<Void> offs()
onback to summary
public Guard on()

Turns this indicator on.

Returns:Guard

a Guard that, when closed, resets this indicator to the original state.

onsback to summary
public EventStream<Void> ons()
onWhileback to summary
public void onWhile(Runnable r)

Runs the given computation, making sure this indicator is on. When done, this indicator is reset to the previous state.

Equivalent to

try(Guard g = on()) {
    r.run();
}
onWhileback to summary
public <T> T onWhile(Supplier<T> f)

Runs the given computation, making sure this indicator is on. When done, this indicator is reset to the previous state.

T t = indicator.onWhile(f);
is equivalent to
T t;
try(Guard g = on()) {
    t = f.get();
}
releaseback to summary
private void release()
removeListenerback to summary
public void removeListener(ChangeListener<? super Boolean> listener)

Implements javafx.beans.value.ObservableValue.removeListener.

Doc from javafx.beans.value.ObservableValue.removeListener.

Removes the given listener from the list of listeners that are notified whenever the value of the ObservableValue changes.

If the given listener has not been previously registered (i.e. it was never added) then this method call is a no-op. If it had been previously added then it will be removed. If it had been added more than once, then only the first occurrence will be removed.

Annotations
@Override
removeListenerback to summary
public void removeListener(InvalidationListener listener)

Implements javafx.beans.Observable.removeListener.

Doc from javafx.beans.Observable.removeListener.

Removes the given listener from the list of listeners, that are notified whenever the value of the Observable becomes invalid.

If the given listener has not been previously registered (i.e. it was never added) then this method call is a no-op. If it had been previously added then it will be removed. If it had been added more than once, then only the first occurrence will be removed.

Annotations
@Override