private static void setSpinnerBehaviour( final IntegerSpinnerValueFactory svf, final boolean useDefaultValue, final ObservableIntegerValue defaultValue, final ObjectProperty<Integer> customValue ) { if (useDefaultValue) { svf.valueProperty().unbindBidirectional(customValue); svf.setValue(defaultValue.get()); } else { svf.setValue(customValue.getValue()); svf.valueProperty().bindBidirectional(customValue); } } }
@Override public void unbindBidirectional(Property<T> other) { delegate.unbindBidirectional(other); }
private void unbindColorProperties() { ObjectProperty<Color>[] lightProps = cssLightConfig.getColorProperties(); picker1.valueProperty().unbindBidirectional(lightProps[0]); picker2.valueProperty().unbindBidirectional(lightProps[1]); picker3.valueProperty().unbindBidirectional(lightProps[2]); ObjectProperty<Color>[] darkProps = cssDarkConfig.getColorProperties(); picker1.valueProperty().unbindBidirectional(darkProps[0]); picker2.valueProperty().unbindBidirectional(darkProps[1]); picker3.valueProperty().unbindBidirectional(darkProps[2]); }
/** * Unbinds the given items and selection property with the corresponding * elements. * * @param itemsBinding * The items property to be unbound with. * * @param selectionBinding * The selection property to be unbound with. * * @return Returns the current field to allow for chaining. */ public SingleSelectionField<V> unbind(ListProperty<V> itemsBinding, ObjectProperty<V> selectionBinding) { items.unbindBidirectional(itemsBinding); selection.unbindBidirectional(selectionBinding); return this; }
private static void setSpinnerBehaviour( final IntegerSpinnerValueFactory svf, final boolean useDefaultValue, final ObservableIntegerValue defaultValue, final ObjectProperty<Integer> customValue ) { if (useDefaultValue) { svf.valueProperty().unbindBidirectional(customValue); svf.setValue(defaultValue.get()); } else { svf.setValue(customValue.getValue()); svf.valueProperty().bindBidirectional(customValue); } } }
@Override public void changed(ObservableValue<? extends AuditralColorMapping> observable, AuditralColorMapping oldValue, AuditralColorMapping newValue) { if (oldValue != null) { colorDetail.valueProperty().unbindBidirectional(oldValue.color); occurrenceDetail.textProperty().unbindBidirectional(oldValue.occurrenceRegEx); loglevelDetail.textProperty().unbindBidirectional(oldValue.loglevelRegEx); workflowidDetail.textProperty().unbindBidirectional(oldValue.workflowInstanceIdRegEx); correlationidDetail.textProperty().unbindBidirectional(oldValue.correlationIdRegEx); conversionidDetail.textProperty().unbindBidirectional(oldValue.conversationIdRegEx); messageTypDetail.textProperty().unbindBidirectional(oldValue.messageTypeRegEx); idDetail.textProperty().unbindBidirectional(oldValue.idRegEx); } if (newValue != null) { colorDetail.valueProperty().bindBidirectional(newValue.color); occurrenceDetail.textProperty().bindBidirectional(newValue.occurrenceRegEx); loglevelDetail.textProperty().bindBidirectional(newValue.loglevelRegEx); workflowidDetail.textProperty().bindBidirectional(newValue.workflowInstanceIdRegEx); correlationidDetail.textProperty().bindBidirectional(newValue.correlationIdRegEx); conversionidDetail.textProperty().bindBidirectional(newValue.conversationIdRegEx); messageTypDetail.textProperty().bindBidirectional(newValue.messageTypeRegEx); idDetail.textProperty().bindBidirectional(newValue.idRegEx); colorDetail.fireEvent(new ActionEvent());// javafx bug workaround else color chooser wont update // http://javafx-jira.kenai.com/browse/RT-26633 } } });