Package javafx.beans.binding

Examples of javafx.beans.binding.BooleanBinding


    }

    @Override
    public ObservableBooleanValue pendingProperty() {
        if(pending == null) {
            pending = new BooleanBinding() {
                @Override
                protected boolean computeValue() {
                    return state == State.ACC_HAS_EVENT;
                }
            };
View Full Code Here


    }

    @Override
    public ObservableBooleanValue pendingProperty() {
        if(pending == null) {
            pending = new BooleanBinding() {
                @Override
                protected boolean computeValue() {
                    return hasEvent;
                }
            };
View Full Code Here

    }

    @Override
    public ObservableBooleanValue pendingProperty() {
        if(pending == null) {
            pending = new BooleanBinding() {
                @Override
                protected boolean computeValue() {
                    return expectedFuture != null;
                }
            };
View Full Code Here

    final CheckBox slVisibleCB = new CheckBox();
    slVisibleCB.disableProperty().bind(activateCB.selectedProperty().not());
    scopeLinesVisible.bind(slVisibleCB.selectedProperty());

    final Slider sllider = new Slider(1, 4, 1.5);
    sllider.disableProperty().bind(new BooleanBinding() {
      {
        bind(activateCB.selectedProperty(), slVisibleCB.selectedProperty());
      }

      @Override
View Full Code Here

        box.highlightFillProperty().bind(highlightFill);
        box.highlightTextFillProperty().bind(highlightTextFill);
        box.wrapTextProperty().bind(area.wrapTextProperty());
        box.graphicFactoryProperty().bind(area.paragraphGraphicFactoryProperty());

        BooleanBinding hasCaret = Bindings.equal(
                box.indexProperty(),
                area.currentParagraphProperty());

        // caret is visible only in the paragraph with the caret
        BooleanBinding cellCaretVisible = hasCaret.and(caretVisible);
        box.caretVisibleProperty().bind(cellCaretVisible);

        // bind cell's caret position to area's caret column,
        // when the cell is the one with the caret
        org.fxmisc.easybind.Subscription caretPositionSub =
                EasyBind.when(hasCaret).bind(
                        box.caretPositionProperty(),
                        area.caretColumnProperty());

        // keep paragraph selection updated
        ObjectBinding<IndexRange> cellSelection = Bindings.createObjectBinding(() -> {
            int idx = box.getIndex();
            return idx != -1
                    ? area.getParagraphSelection(idx)
                    : StyledTextArea.EMPTY_RANGE;
        }, area.selectionProperty(), box.indexProperty());
        box.selectionProperty().bind(cellSelection);

        return new Cell<Paragraph<S>, ParagraphBox<S>>() {
            @Override
            public ParagraphBox<S> getNode() {
                return box;
            }

            @Override
            public void updateIndex(int index) {
                box.setIndex(index);
            }

            @Override
            public void dispose() {
                box.highlightFillProperty().unbind();
                box.highlightTextFillProperty().unbind();
                box.wrapTextProperty().unbind();
                box.graphicFactoryProperty().unbind();

                box.caretVisibleProperty().unbind();
                cellCaretVisible.dispose();
                hasCaret.dispose();
                caretPositionSub.unsubscribe();

                box.selectionProperty().unbind();
                cellSelection.dispose();
View Full Code Here

        textColorPicker.valueProperty().addListener((o, old, color) -> updateTextColor(color));

        undoBtn.disableProperty().bind(Bindings.not(area.undoAvailableProperty()));
        redoBtn.disableProperty().bind(Bindings.not(area.redoAvailableProperty()));

        BooleanBinding selectionEmpty = new BooleanBinding() {
            { bind(area.selectionProperty()); }

            @Override
            protected boolean computeValue() {
                return area.getSelection().getLength() == 0;
View Full Code Here

    public DefaultFilters(final TimeLineController controller) {
        super("apply default filters");
        this.controller = controller;
        eventsModel = controller.getEventsModel();
        disabledProperty().bind(new BooleanBinding() {
            {
                bind(eventsModel.getRequestedZoomParamters());
            }

            @Override
View Full Code Here

    public ZoomOut(final TimeLineController controller) {
        super("apply default filters");
        this.controller = controller;
        eventsModel = controller.getEventsModel();
        disabledProperty().bind(new BooleanBinding() {
            {
                bind(eventsModel.getRequestedZoomParamters());
            }

            @Override
View Full Code Here

        wordsArea.textProperty().addListener(o -> {
            if (origDate.equals(datePicker.getValue()))
                datePicker.setValue(null);
        });

        BooleanBinding datePickerIsInvalid = or(
                datePicker.valueProperty().isNull(),

                createBooleanBinding(() ->
                        datePicker.getValue().isAfter(LocalDate.now())
                , /* depends on */ datePicker.valueProperty())
        );

        // Don't let the user click restore if the words area contains the current wallet words, or are an invalid set,
        // or if the date field isn't set, or if it's in the future.
        restoreButton.disableProperty().bind(
                or(
                        or(
                                not(validator.valid),
                                equal(origWords, wordsArea.textProperty())
                        ),

                        datePickerIsInvalid
                )
        );

        // Highlight the date picker in red if it's empty or in the future, so the user knows why restore is disabled.
        datePickerIsInvalid.addListener((dp, old, cur) -> {
            if (cur) {
                datePicker.getStyleClass().add("validation_error");
            } else {
                datePicker.getStyleClass().remove("validation_error");
            }
View Full Code Here

        isValid = new TextFieldValidator(field, predicate).valid;
    }

    public static void autoDisableButton(Button button, ValidationLink... links) {
        List<BooleanProperty> props = stream(links).map(ValidationLink::isValidProperty).collect(toList());
        BooleanBinding allValid = GuiUtils.conjunction(props);
        button.disableProperty().bind(allValid.not());
    }
View Full Code Here

TOP

Related Classes of javafx.beans.binding.BooleanBinding

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.