Search in sources :

Example 1 with BooleanPropertyBase

use of javafx.beans.property.BooleanPropertyBase in project jabref by JabRef.

the class BindingsHelper method includePseudoClassWhen.

public static void includePseudoClassWhen(Node node, PseudoClass pseudoClass, ObservableValue<? extends Boolean> condition) {
    BooleanProperty pseudoClassState = new BooleanPropertyBase(false) {

        @Override
        protected void invalidated() {
            node.pseudoClassStateChanged(pseudoClass, get());
        }

        @Override
        public Object getBean() {
            return node;
        }

        @Override
        public String getName() {
            return pseudoClass.getPseudoClassName();
        }
    };
    pseudoClassState.bind(condition);
}
Also used : BooleanProperty(javafx.beans.property.BooleanProperty) BooleanPropertyBase(javafx.beans.property.BooleanPropertyBase)

Aggregations

BooleanProperty (javafx.beans.property.BooleanProperty)1 BooleanPropertyBase (javafx.beans.property.BooleanPropertyBase)1