public void bindFilterPredicate ( ObjectProperty < TreeItemPredicate < Category > > predicateProperty ) { predicateProperty . bind ( Bindings . createObjectBinding ( ( ) -> { if ( searchText . get ( ) == null || searchText . get ( ) . isEmpty ( ) ) { return null ; } return TreeItemPredicate . create ( filterPredicate ) ; } , searchText ) ) ; }
Binds the predicateProperty to ensure filtering according to the searchText .