Module javafx.base
Package javafx.event

Class WeakEventHandler<T extends Event>

java.lang.Object
javafx.event.WeakEventHandler<T>
Type Parameters:
T - the event class this handler can handle
All Implemented Interfaces:
EventListener, EventHandler<T>

public final class WeakEventHandler<T extends Event> extends Object implements EventHandler<T>
Used in event handler registration in place of its associated event handler. Its sole purpose is to break the otherwise strong reference between an event handler container and its associated event handler. While the container still holds strong reference to the registered WeakEventHandler proxy, the proxy itself references the original handler only weakly and so doesn't prevent it from being garbage collected. Until this weak reference is broken, any event notification received by the proxy is forwarded to the original handler.
Since:
JavaFX 8.0