File tree Expand file tree Collapse file tree 1 file changed +20
-5
lines changed
Expand file tree Collapse file tree 1 file changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -25,11 +25,26 @@ JavaBeans provides the following implementations for `Property`, each implementa
2525
2626### Observables
2727
28- An ` ObservableValue ` is a value which can be observed for changes using listeners.
28+ An ` ObservableValue ` is a value which can be observed for changes using listeners. Based
29+ on the ` java.util.Supplier ` interface.
30+
2931An ` ObservableProperty ` is a property which can be observed for changed using listeners.
32+ Based on the ` Property ` and ` ObservableValue ` interfaces.
3033
31- Both ` ObservableValue ` and ` ObservableProperty ` have primitive specializations.
34+ Both have primitive specializations for types: ` long ` , ` int ` , ` boolean ` , ` double ` .
35+
36+ Creation of such properties should be done using ` ObservableFactory ` .
37+
38+ #### Listeners
39+
40+ Users may register ` ChangeListener ` s to an _ observable_ .
41+ Any changes to that _ observable_ 's value will
42+ cause an invocation of the listener with ` ChangeEvent ` .
43+
44+ ``` Java
45+ ObservableIntProperty prop = ....
46+ prop. addChangeListener((e)- > {
47+ System . out. println(" New value: " + e. getNewValue())
48+ });
49+ ```
3250
33- There are several implementations provided:
34- - Simple: a basic variable value which can be read from and written to.
35- - Atomic: a thread-safe implementation.
You can’t perform that action at this time.
0 commit comments