See: Description
| Interface | Description |
|---|---|
| ListenerAttachHandle |
A listener handle can be used to
attach a listener to some observable instance. |
| ListenerDetachHandle |
A listener handle can be used to
detach a listener from some observable instance. |
| ListenerHandle |
| Class | Description |
|---|---|
| ListenerHandleBuilder<O,L> |
A builder for a
ListenerHandle. |
| ListenerHandles |
Factory class for functionality surrounding
ListenerHandles. |
Using the default JavaFX 8 features, it is necessary to store both the observed instance and the listener if the
latter has to be added or removed repeatedly. A ListenerHandle encapsulates those references and the state whether a listener is currently added or not. It provides
an attach() and a
detach method which add or remove the listener.
Redundant calls (i.e. attaching when the listener is already added) are no-ops.
All features of LibFX which deal with listeners are aware of ListenerHandles and respective methods
will return them. For observable classes included in the JDK, the factory
ListenerHandles provides methods to easily create a handle.
ListenerHandle,
ListenerHandlesThis documentation is licensed under CC-BY 4.0, attributed to Nicolai Parlog from CodeFX.