All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opendolphin.binding.BindClientOtherOfAble.groovy Maven / Gradle / Ivy

package org.opendolphin.binding

import org.opendolphin.core.client.ClientAttribute

class BindClientOtherOfAble {
    final ClientAttribute attribute
    final String targetPropertyName
    final Converter converter

    BindClientOtherOfAble(ClientAttribute attribute, String targetPropertyName, Converter converter) {
        this.attribute = attribute
        this.targetPropertyName = targetPropertyName
        this.converter = converter
    }

    @Deprecated // TODO (DOL-93) remove legacy code
    void of(Object target, Closure converter) {
        of target, new ConverterAdapter(converter)
    }

    @Deprecated // TODO (DOL-93) remove legacy code
    void of(Object target, Converter converter) {
        def listener = new JFXBinderPropertyChangeListener(attribute, target, targetPropertyName, converter)
        attribute.addPropertyChangeListener('value', listener)
        listener.update() // set the initial value after the binding and trigger the first notification
    }

    void of(Object target) {
        def listener = new JFXBinderPropertyChangeListener(attribute, target, targetPropertyName, converter)
        attribute.addPropertyChangeListener('value', listener)
        listener.update() // set the initial value after the binding and trigger the first notification
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy