.and(Bindings.isNotNull(revisionText), Bindings.notEqual(revisionText, "unknown"))) .then(false).otherwise(true);
/** * Binds the visibility of {@link #selectedArea} and {@link #unselectedArea} to the {@code SnapshotView} 's * {@link SnapshotView#selectionActiveProperty() selectionActive} and {@link SnapshotView#hasSelectionProperty() * selectionValid} properties. */ @SuppressWarnings("unused") private void bindAreaVisibilityToSelection() { ReadOnlyBooleanProperty selectionExists = getSkinnable().hasSelectionProperty(); ReadOnlyBooleanProperty selectionActive = getSkinnable().selectionActiveProperty(); BooleanBinding existsAndActive = Bindings.and(selectionExists, selectionActive); selectedArea.visibleProperty().bind(existsAndActive); unselectedArea.visibleProperty().bind(existsAndActive); // UGLY WORKAROUND AHEAD! // The clipper should be created in 'styleAreas' but due to the problem explained in 'Clipper.setClip(Node)' // it has to be created here where the visibility is determined. // clip the unselected area according to the view's property - this is done by a designated inner class new Clipper(getSkinnable(), unselectedArea, () -> unselectedArea.visibleProperty().bind(existsAndActive)); }
/** * {@inheritDoc} */ @Override public void setupBindings() { super.setupBindings(); editableArea.visibleProperty().bind(Bindings.and(field.editableProperty(), field.multilineProperty())); editableField.visibleProperty().bind(Bindings.and(field.editableProperty(), field.multilineProperty().not())); readOnlyLabel.visibleProperty().bind(field.editableProperty().not()); editableField.textProperty().bindBidirectional(field.userInputProperty()); editableArea.textProperty().bindBidirectional(field.userInputProperty()); readOnlyLabel.textProperty().bind(field.userInputProperty()); fieldLabel.textProperty().bind(field.labelProperty()); editableField.promptTextProperty().bind(field.placeholderProperty()); editableArea.promptTextProperty().bind(field.placeholderProperty()); editableArea.managedProperty().bind(editableArea.visibleProperty()); editableField.managedProperty().bind(editableField.visibleProperty()); }
hasSelection.bind(and(isNotNull(selection), notEqual(Rectangle2D.EMPTY, selection))); selectionActive = new SimpleBooleanProperty(this, "selectionActive", false); //$NON-NLS-1$ selectionChanging = new SimpleBooleanProperty(this, "selectionChanging", false); //$NON-NLS-1$
tfDuration.disableProperty().bind(Bindings.and( rbAutoCalcDuration.selectedProperty(), exerciseViewModel.sportTypeRecordDistance));