Skip navigation links

Package org.codefx.libfx.listener.handle

Provides classes which make it easier to add and remove listeners from observable instances.

See: Description

Package org.codefx.libfx.listener.handle Description

Provides classes which make it easier to add and remove listeners from observable instances.

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.

See Also:
ListenerHandle, ListenerHandles
Skip navigation links

This documentation is licensed under CC-BY 4.0, attributed to Nicolai Parlog from CodeFX.