Object
ReadOnlyJavaBeanObjectProperty provides an adapter between a regular
read only Java Bean property of T and a JavaFX
ReadOnlyObjectProperty. It cannot be created directly, but a
ReadOnlyJavaBeanObjectPropertyBuilder has to be used.
As a minimum, the Java Bean class must implement a getter for the
property.
The class, as well as the getter method, must be declared public.
If the getter of an instance of this class is called, the property of
the Java Bean is returned. If the Java Bean property is bound (i.e. it supports
PropertyChangeListeners), this ReadOnlyJavaBeanObjectProperty will be
aware of changes in the Java Bean. Otherwise it can be notified about
changes by calling fireValueChangedEvent().
Deploying an Application as a Module
If the Java Bean class is in a named module, then it must be reflectively
accessible to the javafx.base module.
A class is reflectively accessible if the module
opens the containing package to at
least the javafx.base module.
For example, if com.foo.MyBeanClass is in the foo.app module,
the module-info.java might
look like this:
module foo.app {
opens com.foo to javafx.base;
}
Alternatively, a class is reflectively accessible if the module
exports the containing package
unconditionally.
javafx.beans.property.ReadOnlyObjectProperty , ReadOnlyJavaBeanObjectPropertyBuilder
| Modifier and Type | Field and Description |
|---|---|
| private final ReadOnlyPropertyDescriptor | |
| private final ReadOnlyPropertyDescriptor |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | dispose()
Implements javafx. Signals to the JavaFX property that it will not be used anymore and any references can be removed. |
| public void | fireValueChangedEvent()
Overrides javafx. Implements javafx. This method can be called to notify the adapter of a change of the Java Bean value, if the Java Bean property is not bound (i.e. it does not support PropertyChangeListeners). |
| public T | get()
Implements javafx. Returns the current value of this |
| public Object | getBean()
Implements javafx. Returns the |
| public String | getName()
Implements javafx. Returns the name of this property. |
| descriptor | back to summary |
|---|---|
| private final ReadOnlyPropertyDescriptor<T> descriptor | |
| listener | back to summary |
|---|---|
| private final ReadOnlyPropertyDescriptor<T>. | |
| ReadOnlyJavaBeanObjectProperty | back to summary |
|---|---|
| pack-priv ReadOnlyJavaBeanObjectProperty(ReadOnlyPropertyDescriptor<T> descriptor, Object bean) | |
| dispose | back to summary |
|---|---|
| public void dispose() Implements javafx. Doc from javafx. Signals to the JavaFX property that it will not be used anymore and any references can be removed. A call of this method usually results in the property stopping to observe the Java Bean property by unregistering its listener(s).
| |
| fireValueChangedEvent | back to summary |
|---|---|
| public void fireValueChangedEvent() Overrides javafx. Implements javafx. Doc from javafx. This method can be called to notify the adapter of a change of the Java Bean value, if the Java Bean property is not bound (i.e. it does not support PropertyChangeListeners).
| |
| get | back to summary |
|---|---|
| public T get() Implements javafx. Doc from javafx. Returns the current value of this
| |
| getBean | back to summary |
|---|---|
| public Object getBean() Implements javafx. Doc from javafx. Returns the
| |
| getName | back to summary |
|---|---|
| public String getName() Implements javafx. Doc from javafx. Returns the name of this property. If the property does not have a name,
this method returns an empty
| |