Java 类javafx.beans.value.ObservableBooleanValue 实例源码

项目:easyMvvmFx    文件:ViewLoaderReflectionUtils.java   
/**
 * This method adds listeners for the {@link SceneLifecycle}.
 */
static void addSceneLifecycleHooks(ViewModel viewModel, ObservableBooleanValue viewInSceneProperty) {
    if(viewModel != null) {

        if(viewModel instanceof SceneLifecycle) {
            SceneLifecycle lifecycleViewModel = (SceneLifecycle) viewModel;

            PreventGarbageCollectionStore.getInstance().put(viewInSceneProperty);

            viewInSceneProperty.addListener((observable, oldValue, newValue) -> {
    if(newValue) {
        lifecycleViewModel.onViewAdded();
    } else {
        lifecycleViewModel.onViewRemoved();
                    PreventGarbageCollectionStore.getInstance().remove(viewInSceneProperty);
    }
});
        }
    }
}
项目:javafx-qiniu-tinypng-client    文件:ViewLoaderReflectionUtils.java   
/**
 * This method adds listeners for the {@link SceneLifecycle}.
 */
static void addSceneLifecycleHooks(ViewModel viewModel, ObservableBooleanValue viewInSceneProperty) {
    if(viewModel != null) {

        if(viewModel instanceof SceneLifecycle) {
            SceneLifecycle lifecycleViewModel = (SceneLifecycle) viewModel;

            PreventGarbageCollectionStore.getInstance().put(viewInSceneProperty);

            viewInSceneProperty.addListener((observable, oldValue, newValue) -> {
    if(newValue) {
        lifecycleViewModel.onViewAdded();
    } else {
        lifecycleViewModel.onViewRemoved();
                    PreventGarbageCollectionStore.getInstance().remove(viewInSceneProperty);
    }
});
        }
    }
}
项目:jmonkeybuilder    文件:VirtualAssetEditorDialog.java   
@Override
@FXThread
protected @NotNull ObservableBooleanValue buildAdditionalDisableCondition() {

    final VirtualResourceTree<C> resourceTree = getResourceTree();
    final MultipleSelectionModel<TreeItem<VirtualResourceElement<?>>> selectionModel = resourceTree.getSelectionModel();
    final ReadOnlyObjectProperty<TreeItem<VirtualResourceElement<?>>> selectedItemProperty = selectionModel.selectedItemProperty();

    final Class<C> type = getObjectsType();
    final BooleanBinding typeCondition = new BooleanBinding() {

        @Override
        protected boolean computeValue() {
            final TreeItem<VirtualResourceElement<?>> treeItem = selectedItemProperty.get();
            return treeItem == null || !type.isInstance(treeItem.getValue().getObject());
        }

        @Override
        public Boolean getValue() {
            return computeValue();
        }
    };

    return Bindings.or(selectedItemProperty.isNull(), typeCondition);
}
项目:myWMS    文件:BODTOPlugin.java   
/**
 * Generate the table layout for table selectors.
 * The method should be overridden when the table layout needs to be customised.
 * @param context the context for preparing the controller.
 * @return the table layout.
 */
protected BODTOTable<T> getTable(ViewContextBase context) {
    BODTOTable<T> table = new BODTOTable<>();   
    configureCommands(table.getCommands());
    table.getCommands().end();
    context.autoInjectBean(table);

    UserPermissions userPermissions = getUserPermissions();
    Iterable<String> columns = getTableColumns().stream()
            .filter(s -> Optional.ofNullable(userPermissions.isVisible(s)).map(ObservableBooleanValue::get).orElse(true))
            ::iterator;

    TableColumnBinding<BODTO<T>> tcb = new TableColumnBinding<>(BeanUtils.getBeanInfo(toClass), columns, "id"::equals);
    tcb.setConverterFactory(this::getConverter);
    Bindings.bindContent(table.getTable().getColumns(), tcb);

    table.getCommands()
        .cru()
    .end();

    refresh(table, context);
    table.addQueryListener(o -> refresh(table, context));
    table.addFlowLifecycle(new FlowLifeCycle.OnRefresh((c,f) -> refresh(table, context)));
    return table;
}
项目:myWMS    文件:CRUDPlugin.java   
/**
 * Generate the table layout for table selectors.
 * The method should be overridden when the table layout needs to be customised.
 * @param context the context for preparing the controller.
 * @return the table layout.
 */
protected CrudTable<T> getTable(ViewContextBase context) {
    CrudTable<T> table = new CrudTable<>(); 

    configureCommands(table.getCommands());
    table.getCommands().end();
    UserPermissions userPermissions = getUserPermissions();
    Iterable<String> columns = getTableColumns().stream()
            .filter(s -> Optional.ofNullable(userPermissions.isVisible(s)).map(ObservableBooleanValue::get).orElse(true))
            ::iterator;

    TableColumnBinding<T> tcb = new TableColumnBinding<>(getBeanInfo(), columns, "id"::equals);
    tcb.setConverterFactory(this::getConverter);
    Bindings.bindContent(table.getTable().getColumns(), tcb);
    table.getCommands()
        .crud(isCreateAllowed(), true, true, true, isDeleteAllowed())
    .end();

    context.autoInjectBean(table);
    Runnable refreshData = () -> refresh(table, context);

    refreshData.run();

    table.addQueryListener(o -> refreshData.run());     
    return table;
}
项目:myWMS    文件:MyWMSEditor.java   
@SuppressWarnings("unchecked")
@Override
public void bind(EditorHelper e, String id, BasicEntityEditor node) {
    ObservableValue value = e.getValueProperty(id);
    Class type = e.getValueClass(id);

    if (BasicEntity.class.isAssignableFrom(type)) {
        node.configure(getContext(), type);
    }

    ObservableBooleanValue editable = e.getEditableProperty(id, value);
    ObservableBooleanValue visible = e.getVisibleProperty(id, value);

    StringConverter converter = e.getConverter(id, value);          
    if (converter != null) node.setConverter(converter);

    bindBidirectionalValue(node, node.valueProperty(), value);
    if (editable != null) node.disableProperty().bind(BooleanExpression.booleanExpression(editable).not());
    if (visible != null) node.visibleProperty().bind(visible);
    e.onBind(id, value, node);
}
项目:iso-game-engine    文件:Stage.java   
/**
 * Reconstruct the scene graph
 * */
private void rebuildSceneGraph(
    final long t,
    final ObservableBooleanValue isDebug,
    final ObservableList<Node> graph
) {
    graph.clear();
    terrain.iterateTiles(currentAngle).forEachRemaining(tile -> {
        final Point2D l = terrain.correctedIsoCoord(tile.pos, currentAngle);
        tile.rebuildSceneGraph(isDebug, currentAngle);
        tile.subGraph.setTranslateX(l.getX());
        tile.subGraph.setTranslateY(l.getY());
        graph.add(tile.subGraph);
    });

    for (final Sprite s : allSprites) s.invalidate();
}
项目:SmartModInserter    文件:Bindings.java   
/**
 * Returns a new observable string which contains either the contents of ifTrue, or ifFalse, depending on the condition
 * @param condition
 * @param ifTrue
 * @param ifFalse
 * @return
 */
public static ObservableStringValue decision(ObservableBooleanValue condition,
                                             ObservableStringValue ifTrue,
                                             ObservableStringValue ifFalse) {
    StringProperty ret = new SimpleStringProperty();
    condition.addListener((obs, ov, nv) -> {
        ret.set(nv ? ifTrue.get() : ifFalse.get());
    });
    ifTrue.addListener((obs, ov, nv) -> {
        if (condition.get()) {
            ret.set(nv);
        }
    });
    ifFalse.addListener((obs, ov, nv) -> {
        if (!condition.get()) {
            ret.set(nv);
        }
    });
    ret.set(condition.get() ? ifTrue.get() : ifFalse.get());

    return ret;
}
项目:CloudTrailViewer    文件:ChartHoverUtil.java   
@Override
public void handle(MouseEvent e) {
    adjustingTooltip.set(true);

    Node chartNode = (Node) e.getSource();

    tooltip.show(chartNode, e.getScreenX(), e.getScreenY());
    setLabelPosition(e);

    ObservableBooleanValue stillHovering = chartNode.hoverProperty().or(adjustingTooltip);
    stillHovering.addListener(new ChangeListener<Boolean>() {
        @Override
        public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean nowHovering) {
            if (!nowHovering) {
                stillHovering.removeListener(this);
                tooltip.hide();
            }
        }
    });

    T chartData = (T) chartNode.getUserData();
    String txt = textProvider.apply(chartData);
    tooltip.setText(txt);

    adjustingTooltip.set(false);
}
项目:easyMvvmFx    文件:ObservableRules.java   
public static ObservableBooleanValue notEmpty(ObservableValue<String> source) {
    return Bindings.createBooleanBinding(() -> {
        final String s = source.getValue();

        return s != null && !s.trim().isEmpty();
    }, source);
}
项目:easyMvvmFx    文件:FxmlViewLoader.java   
private FXMLLoader createFxmlLoader(String resource, ResourceBundle resourceBundle, View<?> codeBehind, Object root,
                                    ViewModel viewModel, ContextImpl context, ObservableBooleanValue viewInSceneProperty) throws IOException {
    // Load FXML file
    final URL location = FxmlViewLoader.class.getResource(resource);
    if (location == null) {
        throw new IOException("Error loading FXML - can't load from given resourcepath: " + resource);
    }

    final FXMLLoader fxmlLoader = new FXMLLoader();

    fxmlLoader.setRoot(root);
    fxmlLoader.setResources(resourceBundle);
    fxmlLoader.setLocation(location);

    // when the user provides a viewModel but no codeBehind, we need to use
    // the custom controller factory.
    // in all other cases the default factory can be used.
    if (viewModel != null && codeBehind == null) {
        fxmlLoader
                .setControllerFactory(new ControllerFactoryForCustomViewModel(viewModel, resourceBundle, context, viewInSceneProperty));
    } else {
        fxmlLoader.setControllerFactory(new DefaultControllerFactory(resourceBundle, context, viewInSceneProperty));
    }

    // When the user provides a codeBehind instance we take care of the
    // injection of the viewModel to this
    // controller here.
    if (codeBehind != null) {
        fxmlLoader.setController(codeBehind);

        if (viewModel == null) {
            handleInjection(codeBehind, resourceBundle, context, viewInSceneProperty);
        } else {
            handleInjection(codeBehind, resourceBundle, viewModel, context, viewInSceneProperty);
        }
    }

    return fxmlLoader;
}
项目:easyMvvmFx    文件:FxmlViewLoader.java   
private static void handleInjection(View<?> codeBehind, ResourceBundle resourceBundle, ContextImpl context, ObservableBooleanValue viewInSceneProperty) {
    ResourceBundleInjector.injectResourceBundle(codeBehind, resourceBundle);

    Consumer<ViewModel> newVmConsumer = viewModel -> {
        ResourceBundleInjector.injectResourceBundle(viewModel, resourceBundle);
        ViewLoaderReflectionUtils.createAndInjectScopes(viewModel, context);
        ViewLoaderReflectionUtils.initializeViewModel(viewModel);

        ViewLoaderReflectionUtils.addSceneLifecycleHooks(viewModel, viewInSceneProperty);
    };

    ViewLoaderReflectionUtils.createAndInjectViewModel(codeBehind, newVmConsumer);
    ViewLoaderReflectionUtils.injectContext(codeBehind, context);
}
项目:easyMvvmFx    文件:FxmlViewLoader.java   
private static void handleInjection(View<?> codeBehind, ResourceBundle resourceBundle, ViewModel viewModel,
        ContextImpl context, ObservableBooleanValue viewInSceneProperty) {
    ResourceBundleInjector.injectResourceBundle(codeBehind, resourceBundle);

    if (viewModel != null) {
        ResourceBundleInjector.injectResourceBundle(viewModel, resourceBundle);
        ViewLoaderReflectionUtils.createAndInjectScopes(viewModel, context);
        ViewLoaderReflectionUtils.injectViewModel(codeBehind, viewModel);
        ViewLoaderReflectionUtils.injectContext(codeBehind, context);

        ViewLoaderReflectionUtils.addSceneLifecycleHooks(viewModel, viewInSceneProperty);
    }
}
项目:easyMvvmFx    文件:FxmlViewLoader.java   
public ControllerFactoryForCustomViewModel(ViewModel customViewModel, ResourceBundle resourceBundle,
                                           ContextImpl context, ObservableBooleanValue viewInSceneProperty) {
    this.customViewModel = customViewModel;
    this.resourceBundle = resourceBundle;
    this.context = context;
    this.viewInSceneProperty = viewInSceneProperty;
}
项目:javafx-qiniu-tinypng-client    文件:ObservableRules.java   
public static ObservableBooleanValue notEmpty(ObservableValue<String> source) {
    return Bindings.createBooleanBinding(() -> {
        final String s = source.getValue();

        return s != null && !s.trim().isEmpty();
    }, source);
}
项目:javafx-qiniu-tinypng-client    文件:FxmlViewLoader.java   
private FXMLLoader createFxmlLoader(String resource, ResourceBundle resourceBundle, View<?> codeBehind, Object root,
                                    ViewModel viewModel, ContextImpl context, ObservableBooleanValue viewInSceneProperty) throws IOException {
    // Load FXML file
    final URL location = FxmlViewLoader.class.getResource(resource);
    if (location == null) {
        throw new IOException("Error loading FXML - can't load from given resourcepath: " + resource);
    }

    final FXMLLoader fxmlLoader = new FXMLLoader();

    fxmlLoader.setRoot(root);
    fxmlLoader.setResources(resourceBundle);
    fxmlLoader.setLocation(location);

    // when the user provides a viewModel but no codeBehind, we need to use
    // the custom controller factory.
    // in all other cases the default factory can be used.
    if (viewModel != null && codeBehind == null) {
        fxmlLoader
                .setControllerFactory(new ControllerFactoryForCustomViewModel(viewModel, resourceBundle, context, viewInSceneProperty));
    } else {
        fxmlLoader.setControllerFactory(new DefaultControllerFactory(resourceBundle, context, viewInSceneProperty));
    }

    // When the user provides a codeBehind instance we take care of the
    // injection of the viewModel to this
    // controller here.
    if (codeBehind != null) {
        fxmlLoader.setController(codeBehind);

        if (viewModel == null) {
            handleInjection(codeBehind, resourceBundle, context, viewInSceneProperty);
        } else {
            handleInjection(codeBehind, resourceBundle, viewModel, context, viewInSceneProperty);
        }
    }

    return fxmlLoader;
}
项目:javafx-qiniu-tinypng-client    文件:FxmlViewLoader.java   
private static void handleInjection(View<?> codeBehind, ResourceBundle resourceBundle, ContextImpl context, ObservableBooleanValue viewInSceneProperty) {
    ResourceBundleInjector.injectResourceBundle(codeBehind, resourceBundle);

    Consumer<ViewModel> newVmConsumer = viewModel -> {
        ResourceBundleInjector.injectResourceBundle(viewModel, resourceBundle);
        ViewLoaderReflectionUtils.createAndInjectScopes(viewModel, context);
        ViewLoaderReflectionUtils.initializeViewModel(viewModel);

        ViewLoaderReflectionUtils.addSceneLifecycleHooks(viewModel, viewInSceneProperty);
    };

    ViewLoaderReflectionUtils.createAndInjectViewModel(codeBehind, newVmConsumer);
    ViewLoaderReflectionUtils.injectContext(codeBehind, context);
}
项目:javafx-qiniu-tinypng-client    文件:FxmlViewLoader.java   
private static void handleInjection(View<?> codeBehind, ResourceBundle resourceBundle, ViewModel viewModel,
        ContextImpl context, ObservableBooleanValue viewInSceneProperty) {
    ResourceBundleInjector.injectResourceBundle(codeBehind, resourceBundle);

    if (viewModel != null) {
        ResourceBundleInjector.injectResourceBundle(viewModel, resourceBundle);
        ViewLoaderReflectionUtils.createAndInjectScopes(viewModel, context);
        ViewLoaderReflectionUtils.injectViewModel(codeBehind, viewModel);
        ViewLoaderReflectionUtils.injectContext(codeBehind, context);

        ViewLoaderReflectionUtils.addSceneLifecycleHooks(viewModel, viewInSceneProperty);
    }
}
项目:javafx-qiniu-tinypng-client    文件:FxmlViewLoader.java   
public ControllerFactoryForCustomViewModel(ViewModel customViewModel, ResourceBundle resourceBundle,
                                           ContextImpl context, ObservableBooleanValue viewInSceneProperty) {
    this.customViewModel = customViewModel;
    this.resourceBundle = resourceBundle;
    this.context = context;
    this.viewInSceneProperty = viewInSceneProperty;
}
项目:shuffleboard    文件:FxUtils.java   
/**
 * A more general version of {@link Bindings#when(ObservableBooleanValue)}
 * that can accept general boolean properties as conditions.
 *
 * @param condition the condition to bind to
 *
 * @see Bindings#when(ObservableBooleanValue)
 */
public static When when(Property<Boolean> condition) {
  if (condition instanceof ObservableBooleanValue) {
    return Bindings.when((ObservableBooleanValue) condition);
  }
  SimpleBooleanProperty realCondition = new SimpleBooleanProperty();
  realCondition.bind(condition);
  return Bindings.when(realCondition);
}
项目:stvs    文件:WelcomeWizard.java   
private static ObservableBooleanValue allTrue(BooleanProperty... properties) {
  ObservableBooleanValue accu = new SimpleBooleanProperty(true);
  for (int i = 0; i < properties.length; i++) {
    accu = properties[i].and(accu);
  }
  return accu;
}
项目:jmonkeybuilder    文件:AssetEditorDialog.java   
@Override
@FXThread
protected @NotNull ObservableBooleanValue buildAdditionalDisableCondition() {
    final ResourceTree resourceTree = getResourceTree();
    final MultipleSelectionModel<TreeItem<ResourceElement>> selectionModel = resourceTree.getSelectionModel();
    final ReadOnlyObjectProperty<TreeItem<ResourceElement>> selectedItemProperty = selectionModel.selectedItemProperty();
    return selectedItemProperty.isNull();
}
项目:jmonkeybuilder    文件:ParticlesAssetEditorDialog.java   
@Override
@FXThread
protected @NotNull ObservableBooleanValue buildAdditionalDisableCondition() {
    final ComboBox<String> comboBox = getTextureParamNameComboBox();
    final SingleSelectionModel<String> selectionModel = comboBox.getSelectionModel();
    final ReadOnlyObjectProperty<String> itemProperty = selectionModel.selectedItemProperty();
    final ObservableBooleanValue parent = super.buildAdditionalDisableCondition();
    return Bindings.and(parent, itemProperty.isNull().or(itemProperty.isEqualTo("")));
}
项目:fx-animation-editor    文件:CollapseAnimator.java   
public void apply(ObservableBooleanValue expanded, ObservableBooleanValue animate, Region region) {
    Rectangle clip = new Rectangle();
    clip.widthProperty().bind(region.widthProperty());
    clip.heightProperty().bind(region.heightProperty());
    region.setClip(clip);
    region.setMinHeight(0);
    region.setMaxHeight(expanded.get() ? Region.USE_PREF_SIZE : 0);
    region.visibleProperty().bind(region.heightProperty().greaterThan(0));

    expanded.addListener((v, o, n) -> onExpandedChanged(n, animate.get(), region));
}
项目:fx-animation-editor    文件:FadeInAnimator.java   
public void apply(ObservableBooleanValue trigger, Node node) {
    this.trigger = trigger;
    this.node = node;
    configureTransition(node);
    node.getProperties().put(ANIMATION_TRIGGER_KEY, trigger); // Prevents trigger from being garbage collected.
    trigger.addListener(triggerChangeListener);
    node.setOpacity(trigger.get() ? to : from);
}
项目:myWMS    文件:MyWMSUserPermissions.java   
@Override
public ObservableBooleanValue isEditable(String colName) {
    if ("created".equals(colName)) return ObservableConstant.FALSE;
    if ("modified".equals(colName)) return ObservableConstant.FALSE;
    if (isLocked.getAsBoolean()) return ObservableConstant.FALSE;
    return permissions.isEditable(colName);
}
项目:myWMS    文件:PoJoEditor.java   
public ObservableBooleanValue getEditableProperty(String id, ObservableValue<?> property) {
    PropertyDescriptor pds = getPropertyDescriptor(id);
    if (pds.getWriteMethod() == null) {
        return ObservableConstant.FALSE;
    }
    else if (pds.getReadMethod().isAnnotationPresent(Id.class)) {               
        return ObservableConstant.FALSE;
    }
    ObservableBooleanValue up = editor.getUserPermissions().isEditable(id);
    return up;
}
项目:todomvcFX    文件:FilterHelper.java   
private static <T> ObservableList<T> filterInternal(ObservableList<T> items,
        Function<T, ObservableBooleanValue> conditionExtractor, final Predicate<T> predicate) {
    final ObservableList<T> filteredItems = FXCollections.observableArrayList();

    final InvalidationListener listener = observable -> {
        final List<T> completed = items.stream()
                .filter(predicate)
                .collect(Collectors.toList());

        filteredItems.setAll(completed);
    };

    items.addListener((ListChangeListener<T>) c -> {
        c.next();

        listener.invalidated(null);

        if (c.wasAdded()) {
            c.getAddedSubList()
                    .forEach(item -> conditionExtractor.apply(item).addListener(listener));
        }

        if (c.wasRemoved()) {
            c.getRemoved()
                    .forEach(item -> conditionExtractor.apply(item).removeListener(listener));
        }
    });

    return filteredItems;
}
项目:markdown-writer-fx    文件:MainWindow.java   
/**
 * Creates a boolean property that is bound to another boolean value
 * of the active editor.
 */
private BooleanProperty createActiveBooleanProperty(Function<FileEditor, ObservableBooleanValue> func) {
    BooleanProperty b = new SimpleBooleanProperty();
    FileEditor fileEditor = fileEditorTabPane.getActiveFileEditor();
    if (fileEditor != null)
        b.bind(func.apply(fileEditor));
    fileEditorTabPane.activeFileEditorProperty().addListener((observable, oldFileEditor, newFileEditor) -> {
        b.unbind();
        if (newFileEditor != null)
            b.bind(func.apply(newFileEditor));
        else
            b.set(false);
    });
    return b;
}
项目:markdown-writer-fx    文件:MainWindow.java   
/**
 * Creates a boolean property that is bound to another boolean value
 * of the active editor's SmartEdit.
 */
private BooleanProperty createActiveEditBooleanProperty(Function<SmartEdit, ObservableBooleanValue> func) {
    BooleanProperty b = new SimpleBooleanProperty() {
        @Override
        public void set(boolean newValue) {
            // invoked when the user invokes an action
            // do not try to change SmartEdit properties because this
            // would throw a "bound value cannot be set" exception
        }
    };

    ChangeListener<? super FileEditor> listener = (observable, oldFileEditor, newFileEditor) -> {
        b.unbind();
        if (newFileEditor != null) {
            if (newFileEditor.getEditor() != null)
                b.bind(func.apply(newFileEditor.getEditor().getSmartEdit()));
            else {
                newFileEditor.editorProperty().addListener((ob, o, n) -> {
                    b.bind(func.apply(n.getSmartEdit()));
                });
            }
        } else
            b.set(false);
    };
    FileEditor fileEditor = fileEditorTabPane.getActiveFileEditor();
    listener.changed(null, null, fileEditor);
    fileEditorTabPane.activeFileEditorProperty().addListener(listener);
    return b;
}
项目:markdown-writer-fx    文件:Action.java   
public Action(String text, String accelerator, GlyphIcons icon,
    EventHandler<ActionEvent> action, ObservableBooleanValue disable,
    BooleanProperty selected)
{
    this.text = text;
    this.accelerator = (accelerator != null) ? KeyCombination.valueOf(accelerator) : null;
    this.icon = icon;
    this.action = action;
    this.disable = disable;
    this.selected = selected;
}
项目:speedment    文件:AddRemoveStringItem.java   
AddRemoveStringItem(
        final DOC column,
        final String label,
        final StringProperty value,
        final String tooltip,
        final ObservableBooleanValue enableThis) {

    super(label, tooltip, NO_DECORATOR);

    final String currentValue = value.get();
    if (currentValue == null) {
        this.strings  = FXCollections.observableArrayList();
    } else {
        this.strings  = FXCollections.observableArrayList(
            Stream.of(currentValue.split(","))
                .filter(s -> !s.isEmpty())
                .toArray(String[]::new)
        );
    }

    this.column  = requireNonNull(column);
    this.enabled = enableThis;
    this.cache   = new SimpleStringProperty();

    this.strings.addListener((ListChangeListener.Change<? extends String> c) -> {
        @SuppressWarnings("unchecked")
        final List<String> list = (List<String>) c.getList();
        value.setValue(getFormatedString(list));
    });
}
项目:assertj-javafx    文件:BooleanTest.java   
@Test
public void testObservableBooleanValue(){
    ObservableBooleanValue actual = new SimpleBooleanProperty(true);

    assertThat(actual).isTrue();

    assertThat(actual).hasSameValue(actual);
}
项目:assertj-javafx    文件:ObservableBooleanValueAssertions_isFalse_Test.java   
@Test
public void should_fail_if_actual_is_true(){
    try{
        ObservableBooleanValue actual = new SimpleBooleanProperty(true);

        new ObservableBooleanValueAssertions(actual).isFalse();
        fail("Should throw an AssertionError");
    }catch (AssertionError error){
        assertThat(error).hasMessageContaining("to be false but it wasn't");
    }
}
项目:assertj-javafx    文件:ObservableBooleanValueAssertions_isTrue_Test.java   
@Test
public void should_fail_if_actual_is_false(){
    try{
        ObservableBooleanValue actual = new SimpleBooleanProperty(false);

        new ObservableBooleanValueAssertions(actual).isTrue();
        fail("Should throw an AssertionError");
    }catch (AssertionError error){
        assertThat(error).hasMessageContaining("to be true but it wasn't");
    }
}
项目:ReactFX    文件:BooleanBinding.java   
/**
 * @deprecated Use {@link Val#suspendable(javafx.beans.value.ObservableValue)}.
 */
@Deprecated
public static BooleanBinding wrap(ObservableBooleanValue source) {
    return new BooleanBinding() {
        { bind(source); }

        @Override
        protected boolean computeValue() { return source.get(); }
    };
}
项目:easyMvvmFx    文件:ObservableRules.java   
public static <T> ObservableBooleanValue fromPredicate(ObservableValue<T> source, Predicate<T> predicate) {
    return Bindings.createBooleanBinding(() -> predicate.test(source.getValue()), source);
}
项目:easyMvvmFx    文件:ObservableRules.java   
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);
}
项目:easyMvvmFx    文件:FxmlViewLoader.java   
public DefaultControllerFactory(ResourceBundle resourceBundle, ContextImpl context, ObservableBooleanValue viewInSceneProperty) {
    this.resourceBundle = resourceBundle;
    this.context = context;
    this.viewInSceneProperty = viewInSceneProperty;
}
项目:LIRE-Lab    文件:CollectionTree.java   
public void bindVisibilityTo(ObservableBooleanValue value) {
    visibleProperty().bind(value);
}