Skip navigation links

Package org.codefx.libfx.control.properties

Makes using a Control's propertyMap more convenient.

See: Description

Package org.codefx.libfx.control.properties Description

Makes using a Control's propertyMap more convenient.

As such its main use will be to creators of controls.

Listening to the Property Map

In order to use the property map, a control has to create a listener which does these things:

While implementing such a listener is not difficult, some details have to be considered. This makes the code a little lengthy and hinders readability while at the same time repeating the same pattern over and over.

ControlPropertyListener

This package provides usability functions to create such a listener in a concise and readable way (this code would be inside a control):

 ControlProperties.on(getProperties())
        .forKey("SomeKey")
        .processValue(valueString -> System.out.println(valueString))
        .buildAndAttach();
 
It returns an instance of ControlPropertyListenerHandle which can be used to easily detach and reattach the listener.
See Also:
ControlPropertyListener, ControlPropertyListenerBuilder
Skip navigation links

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