本文整理匯總了Java中javafx.beans.binding.Bindings.createBooleanBinding方法的典型用法代碼示例。如果您正苦於以下問題:Java Bindings.createBooleanBinding方法的具體用法?Java Bindings.createBooleanBinding怎麽用?Java Bindings.createBooleanBinding使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javafx.beans.binding.Bindings
的用法示例。
在下文中一共展示了Bindings.createBooleanBinding方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: notEmpty
import javafx.beans.binding.Bindings; //導入方法依賴的package包/類
public static ObservableBooleanValue notEmpty(ObservableValue<String> source) {
return Bindings.createBooleanBinding(() -> {
final String s = source.getValue();
return s != null && !s.trim().isEmpty();
}, source);
}
示例2: createDefinitionInvalidBinding
import javafx.beans.binding.Bindings; //導入方法依賴的package包/類
/**
* Returns a self updating binding to check if the definition is invalid
* @param alreadyDefinedVariables check against this list if variable name is already present
* @return binding that always represents the return value of
* {@link IoVariableDefinitionPane#isDefinitionInvalid(List)}.
*/
public BooleanBinding createDefinitionInvalidBinding(
List<SpecIoVariable> alreadyDefinedVariables) {
return Bindings.createBooleanBinding(() -> isDefinitionInvalid(alreadyDefinedVariables),
nameTextField.textProperty(),
typeTextField.textProperty());
}
示例3: fromPredicate
import javafx.beans.binding.Bindings; //導入方法依賴的package包/類
public static <T> ObservableBooleanValue fromPredicate(ObservableValue<T> source, Predicate<T> predicate) {
return Bindings.createBooleanBinding(() -> predicate.test(source.getValue()), source);
}
示例4: matches
import javafx.beans.binding.Bindings; //導入方法依賴的package包/類
public static ObservableBooleanValue matches(ObservableValue<String> source, Pattern pattern) {
return Bindings.createBooleanBinding(() -> {
final String s = source.getValue();
return s != null && pattern.matcher(s).matches();
}, source);
}