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.
| Modifier and Type | Field and Description |
|---|---|
| private final WeakReference |
| Access | Constructor and Description |
|---|---|
| public | WeakEventHandler(final EventHandler<T>
the original event handler to which to forward event
notifications eventHandler)Creates a new instance of |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| public void | handle(final T
the event which occurred event)Implements javafx. Forwards event notification to the associated event handler. |
| public boolean | Returns: true if the associated handler has been garbage
collected, false otherwiseIndicates whether the associated event handler has been garbage collected. |
| weakRef | back to summary |
|---|---|
| private final WeakReference<EventHandler<T>> weakRef | |
| WeakEventHandler | back to summary |
|---|---|
| public WeakEventHandler(final EventHandler<T> eventHandler) Creates a new instance of
| |
| clear | back to summary |
|---|---|
| pack-priv void clear() | |
| handle | back to summary |
|---|---|
| public void handle(final T event) Implements javafx. Forwards event notification to the associated event handler.
| |
| wasGarbageCollected | back to summary |
|---|---|
| public boolean wasGarbageCollected() Indicates whether the associated event handler has been garbage
collected. Used by containers to detect when the storage of corresponding
references to this
| |