buttonConnect.disableProperty().bind(createBooleanBinding( () -> ((fieldHost.textProperty().isEmpty().get() || fieldPort.textProperty().isEmpty().get())
okey.disableProperty().bind(Bindings.createBooleanBinding( () -> IS_INVALID_MAIL.test(email.getText()), email.textProperty()
public void init(Runnable createPromptNodeRunnable, Node... cachedNodes) { animatedPromptTextFill = new SimpleObjectProperty<>(promptTextFill.get()); usePromptText = Bindings.createBooleanBinding(this::usePromptText, valueProperty, promptTextProperty,
/** * Converts a boolean object observable value into a boolean binding. * * @param observable the observable to be converted. * * @return a boolean binding. */ @Nonnull public static BooleanBinding mapToBoolean(@Nonnull final ObservableObjectValue<Boolean> observable) { requireNonNull(observable, ERROR_OBSERVABLE_NULL); return createBooleanBinding(observable::get, observable); }
/** * Creates a boolean binding based on a <tt>anyMatch</tt> predicate applied to the items. * * @param items the observable map of items. * @param predicate a non-interfering, stateless predicate to apply to the each element. * * @return a boolean binding */ @Nonnull public static <K, V> BooleanBinding anyMatch(@Nonnull final ObservableMap<K, V> items, @Nonnull final Predicate<? super V> predicate) { requireNonNull(items, ERROR_ITEMS_NULL); requireNonNull(predicate, ERROR_PREDICATE_NULL); return createBooleanBinding(() -> items.values().stream().anyMatch(predicate), items); }
/** * Creates a boolean binding based on a <tt>allMatch</tt> predicate applied to the items. * * @param items the observable list of items. * @param predicate a non-interfering, stateless predicate to apply to the each element. * * @return a boolean binding */ @Nonnull public static <T> BooleanBinding allMatch(@Nonnull final ObservableList<T> items, @Nonnull final Predicate<? super T> predicate) { requireNonNull(items, ERROR_ITEMS_NULL); requireNonNull(predicate, ERROR_PREDICATE_NULL); return createBooleanBinding(() -> items.stream().allMatch(predicate), items); }
/** * Creates a boolean binding based on a <tt>noneMatch</tt> predicate applied to the items. * * @param items the observable set of items. * @param predicate a non-interfering, stateless predicate to apply to the each element. * * @return a boolean binding */ @Nonnull public static <T> BooleanBinding noneMatch(@Nonnull final ObservableSet<T> items, @Nonnull final Predicate<? super T> predicate) { requireNonNull(items, ERROR_ITEMS_NULL); requireNonNull(predicate, ERROR_PREDICATE_NULL); return createBooleanBinding(() -> items.stream().noneMatch(predicate), items); }
/** * Creates a boolean binding based on a <tt>allMatch</tt> predicate applied to the items. * * @param items the observable set of items. * @param predicate a non-interfering, stateless predicate to apply to the each element. * * @return a boolean binding */ @Nonnull public static <T> BooleanBinding allMatch(@Nonnull final ObservableSet<T> items, @Nonnull final Predicate<? super T> predicate) { requireNonNull(items, ERROR_ITEMS_NULL); requireNonNull(predicate, ERROR_PREDICATE_NULL); return createBooleanBinding(() -> items.stream().allMatch(predicate), items); }
/** * Creates a boolean binding based on a <tt>noneMatch</tt> predicate applied to the items. * * @param items the observable map of items. * @param predicate a non-interfering, stateless predicate to apply to the each element. * * @return a boolean binding */ @Nonnull public static <K, V> BooleanBinding noneMatch(@Nonnull final ObservableMap<K, V> items, @Nonnull final Predicate<? super V> predicate) { requireNonNull(items, ERROR_ITEMS_NULL); requireNonNull(predicate, ERROR_PREDICATE_NULL); return createBooleanBinding(() -> items.values().stream().noneMatch(predicate), items); }
/** * Creates a boolean binding based on a <tt>anyMatch</tt> predicate applied to the items. * * @param items the observable set of items. * @param predicate a non-interfering, stateless predicate to apply to the each element. * * @return a boolean binding */ @Nonnull public static <T> BooleanBinding anyMatch(@Nonnull final ObservableSet<T> items, @Nonnull final Predicate<? super T> predicate) { requireNonNull(items, ERROR_ITEMS_NULL); requireNonNull(predicate, ERROR_PREDICATE_NULL); return createBooleanBinding(() -> items.stream().anyMatch(predicate), items); }
/** * Creates a boolean binding based on a <tt>noneMatch</tt> predicate applied to the items. * * @param items the observable list of items. * @param predicate a non-interfering, stateless predicate to apply to the each element. * * @return a boolean binding */ @Nonnull public static <T> BooleanBinding noneMatch(@Nonnull final ObservableList<T> items, @Nonnull final Predicate<? super T> predicate) { requireNonNull(items, ERROR_ITEMS_NULL); requireNonNull(predicate, ERROR_PREDICATE_NULL); return createBooleanBinding(() -> items.stream().noneMatch(predicate), items); }
/** * Creates a boolean binding based on a <tt>allMatch</tt> predicate applied to the items. * * @param items the observable map of items. * @param predicate a non-interfering, stateless predicate to apply to the each element. * * @return a boolean binding */ @Nonnull public static <K, V> BooleanBinding allMatch(@Nonnull final ObservableMap<K, V> items, @Nonnull final Predicate<? super V> predicate) { requireNonNull(items, ERROR_ITEMS_NULL); requireNonNull(predicate, ERROR_PREDICATE_NULL); return createBooleanBinding(() -> items.values().stream().allMatch(predicate), items); }
@Nonnull @Override public BooleanBinding noneMatch(@Nonnull final Predicate<? super T> predicate) { requireNonNull(predicate, ERROR_PREDICATE_NULL); return createBooleanBinding(() -> stream().noneMatch(predicate), dependencies()); }
@Nonnull @Override public BooleanBinding anyMatch(@Nonnull final Predicate<? super T> predicate) { requireNonNull(predicate, ERROR_PREDICATE_NULL); return createBooleanBinding(() -> stream().anyMatch(predicate), dependencies()); }
@Nonnull @Override public BooleanBinding allMatch(@Nonnull final Predicate<? super T> predicate) { requireNonNull(predicate, ERROR_PREDICATE_NULL); return createBooleanBinding(() -> stream().allMatch(predicate), dependencies()); }
@Nonnull @Override public BooleanBinding noneMatch(@Nonnull final ObservableValue<Predicate<? super T>> predicate) { requireNonNull(predicate, ERROR_PREDICATE_NULL); return createBooleanBinding(() -> { Predicate<? super T> p = predicate.getValue(); requireNonNull(p, ERROR_PREDICATE_NULL); return stream().noneMatch(p); }, dependencies(predicate)); }
@Nonnull @Override public BooleanBinding anyMatch(@Nonnull final ObservableValue<Predicate<? super T>> predicate) { requireNonNull(predicate, ERROR_PREDICATE_NULL); return createBooleanBinding(() -> { Predicate<? super T> p = predicate.getValue(); requireNonNull(p, ERROR_PREDICATE_NULL); return stream().anyMatch(p); }, dependencies(predicate)); }
@Nonnull @Override public BooleanBinding allMatch(@Nonnull final ObservableValue<Predicate<? super T>> predicate) { requireNonNull(predicate, ERROR_PREDICATE_NULL); return createBooleanBinding(() -> { Predicate<? super T> p = predicate.getValue(); requireNonNull(p, ERROR_PREDICATE_NULL); return stream().allMatch(p); }, dependencies(predicate)); }
@Nonnull protected BooleanBinding createDirtyBinding() { return Bindings.createBooleanBinding(this::checkValuesAreNotEqual, baseValueProperty(), valueProperty()); }
public ReferenceListAttributeEditWidget(ReferenceListAttribute<T,?> referenceListAttribute, TableView<T> tableView, Consumer<Data> navigateToData, UniformDesign uniformDesign, Supplier<List<? extends T>> newValueProvider, Supplier<Collection<T>> possibleValuesProvider, BiConsumer<T,List<T>> deleter , boolean isUserEditable, boolean isUserSelectable, boolean isUserCreateable) { this.uniformDesign = uniformDesign; this.newValueProvider = newValueProvider; this.possibleValuesProvider = possibleValuesProvider; this.isUserEditable = isUserEditable; this.isUserSelectable = isUserSelectable; this.referenceListAttribute = referenceListAttribute; this.tableView = tableView; this.navigateToData = navigateToData; multipleItemsSelected = Bindings.createBooleanBinding(() -> tableView.getSelectionModel().getSelectedItems().size() > 1, tableView.getSelectionModel().getSelectedItems()); this.isUserCreateable = isUserCreateable; this.deleter=deleter; }