55import java .util .List ;
66import java .util .Optional ;
77
8+ import javafx .beans .binding .Binding ;
89import javafx .beans .binding .Bindings ;
910import javafx .beans .binding .BooleanExpression ;
1011import javafx .collections .ObservableList ;
1617import org .jabref .model .util .FileHelper ;
1718import org .jabref .preferences .PreferencesService ;
1819
19- import org .fxmisc .easybind .EasyBind ;
20- import org .fxmisc .easybind .monadic .MonadicBinding ;
21- import org .fxmisc .easybind .monadic .MonadicObservableValue ;
20+ import com .tobiasdiez .easybind .EasyBind ;
2221
2322public class ActionHelper {
2423
@@ -41,18 +40,18 @@ public static BooleanExpression isFieldSetForSelectedEntry(Field field, StateMan
4140
4241 public static BooleanExpression isAnyFieldSetForSelectedEntry (List <Field > fields , StateManager stateManager ) {
4342 ObservableList <BibEntry > selectedEntries = stateManager .getSelectedEntries ();
44- MonadicBinding <Boolean > fieldsAreSet = EasyBind .monadic (Bindings .valueAt (selectedEntries , 0 ))
45- . flatMap (entry -> Bindings .createBooleanBinding (() -> {
43+ Binding <Boolean > fieldsAreSet = EasyBind .wrapNullable (Bindings .valueAt (selectedEntries , 0 ))
44+ . mapObservable (entry -> Bindings .createBooleanBinding (() -> {
4645 return entry .getFields ().stream ().anyMatch (fields ::contains );
4746 }, entry .getFieldsObservable ()))
48- .orElse (false );
47+ .orElse (false );
4948 return BooleanExpression .booleanExpression (fieldsAreSet );
5049 }
5150
5251 public static BooleanExpression isFilePresentForSelectedEntry (StateManager stateManager , PreferencesService preferencesService ) {
5352
5453 ObservableList <BibEntry > selectedEntries = stateManager .getSelectedEntries ();
55- MonadicObservableValue <Boolean > fileIsPresent = EasyBind .monadic (Bindings .valueAt (selectedEntries , 0 )).map (entry -> {
54+ Binding <Boolean > fileIsPresent = EasyBind .wrapNullable (Bindings .valueAt (selectedEntries , 0 )).map (entry -> {
5655 List <LinkedFile > files = entry .getFiles ();
5756
5857 if ((entry .getFiles ().size () > 0 ) && stateManager .getActiveDatabase ().isPresent ()) {
0 commit comments