Example usage for javafx.beans.value ObservableBooleanValue addListener

List of usage examples for javafx.beans.value ObservableBooleanValue addListener

Introduction

In this page you can find the example usage for javafx.beans.value ObservableBooleanValue addListener.

Prototype

void addListener(ChangeListener<? super T> listener);

Source Link

Document

Adds a ChangeListener which will be notified whenever the value of the ObservableValue changes.

Usage

From source file:com.eviware.loadui.ui.fx.util.NodeUtils.java

public static void bindStyleClass(@Nonnull final Node nodeToStyle, @Nonnull final String styleClass,
        ObservableBooleanValue value) {
    updateStyleClasses(nodeToStyle, styleClass, value.getValue());
    value.addListener(new ChangeListener<Boolean>() {
        @Override//from   w w w. j a v  a 2  s  . c o m
        public void changed(ObservableValue<? extends Boolean> arg0, Boolean oldValue, Boolean newValue) {
            updateStyleClasses(nodeToStyle, styleClass, newValue);
        }

    });
}