Example usage for javafx.scene.control Spinner getValueFactory

List of usage examples for javafx.scene.control Spinner getValueFactory

Introduction

In this page you can find the example usage for javafx.scene.control Spinner getValueFactory.

Prototype

public final SpinnerValueFactory<T> getValueFactory() 

Source Link

Usage

From source file:ninja.javafx.smartcsv.fx.validation.ValidationEditorController.java

private void updateSpinner(Spinner rule, Integer value, CheckBox ruleEnabled) {
    if (value == null) {
        ruleEnabled.setSelected(false);/*w w  w .j a va 2  s. c  om*/
    } else {
        ruleEnabled.setSelected(true);
        rule.getValueFactory().setValue(value);
    }
}

From source file:ninja.javafx.smartcsv.fx.validation.ValidationEditorController.java

private void initSpinner(Spinner rule, CheckBox ruleEnabled) {
    rule.disableProperty().bind(ruleEnabled.selectedProperty().not());
    ruleEnabled.selectedProperty().addListener((observable, oldValue, newValue) -> {
        if (!newValue) {
            rule.getValueFactory().setValue(0);
        }/*ww  w.j  av  a  2  s  .  c om*/
    });
}