Generates a bidirectional binding (or "bind with inverse") between two
instances of javafx.collections.ObservableList
.
A bidirectional binding is a binding that works in both directions. If
two properties a
and b
are linked with a bidirectional
binding and the value of a
changes, b
is set to the same
value automatically. And vice versa, if b
changes, a
is
set to the same value.
Only the content of the two lists is synchronized, which means that both lists are different, but they contain the same elements.
A bidirectional content-binding can be removed with
unbindContentBidirectional(Object, Object)
.
Note: this implementation of a bidirectional binding behaves differently from all other bindings here in two important aspects. A property that is linked to another property with a bidirectional binding can still be set (usually bindings would throw an exception). Secondly bidirectional bindings are calculated eagerly, i.e. a bound property is updated immediately.
<E>
| the type of the list elements | |
list1
| the first ObservableList<E> | |
list2
| the second ObservableList<E> |
NullPointerException
| if one of the lists is null | |
IllegalArgumentException
| if list1 == list2 |
Diagram: Bindings