Search in sources :

Example 1 with ObservableNumberValue

use of javafx.beans.value.ObservableNumberValue in project VocabHunter by VocabHunter.

the class AbstractFilterModel method bindValues.

protected void bindValues() {
    ObservableNumberValue count = countValue();
    StringBinding countText = Bindings.createStringBinding(() -> formatTotalWords(count), count);
    StringBinding filenameText = Bindings.createStringBinding(() -> filename(file.get()), file);
    error.bind(Bindings.equal(count, 0));
    countDescription.bind(Bindings.when(error).then(ERROR).otherwise(countText));
    filename.bind(filenameText);
}
Also used : ObservableNumberValue(javafx.beans.value.ObservableNumberValue) StringBinding(javafx.beans.binding.StringBinding)

Aggregations

StringBinding (javafx.beans.binding.StringBinding)1 ObservableNumberValue (javafx.beans.value.ObservableNumberValue)1