JavaBeanLongProperty provides an adapter between a regular
Java Bean property of type long or Long and a JavaFX
LongProperty. It cannot be created directly, but a
JavaBeanLongPropertyBuilder has to be used.
As a minimum, the Java Bean class must implement a getter and a setter for the
property.
The class, as well as the getter and a setter methods, 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 setter is called, the value will be passed
to the Java Bean property. If the Java Bean property is bound (i.e. it supports
PropertyChangeListeners), this JavaBeanLongProperty will be
aware of changes in the Java Bean. Otherwise it can be notified about
changes by calling fireValueChangedEvent(). If the Java Bean property
is also constrained (i.e. it supports VetoableChangeListeners), this
JavaBeanLongProperty will reject changes, if it is bound to an
ObservableValue<Long>.
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.LongProperty , JavaBeanLongPropertyBuilder
| Modifier and Type | Field and Description |
|---|---|
| private final PropertyDescriptor | |
| private ExpressionHelper | |
| private final PropertyDescriptor | |
| private ObservableValue |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | addListener(ChangeListener<? super Number>
The listener to register listener)Implements javafx. Adds a |
| public void | addListener(InvalidationListener
The listener to register listener)Implements javafx. Adds an |
| public void | bind(ObservableValue<? extends Number>
The observable this observable)Property should be bound to.Implements javafx. Create a unidirection binding for this |
| 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()
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 long | get()
Implements javafx. Get the wrapped value. |
| public Object | getBean()
Implements javafx. Returns the |
| public String | getName()
Implements javafx. Returns the name of this property. |
| public boolean | isBound()
Implements javafx. Can be used to check, if a |
| public void | removeListener(ChangeListener<? super Number>
The listener to remove listener)Implements javafx. Removes the given listener from the list of listeners that are notified
whenever the value of the |
| public void | removeListener(InvalidationListener
The listener to remove listener)Implements javafx. Removes the given listener from the list of listeners, that are notified
whenever the value of the |
| public void | set(final long
The new value value)Implements javafx. Set the wrapped value. |
| public String | Returns: a string representation of thisJavaBeanLongProperty object.Overrides javafx. Returns a string representation of this |
| public void | unbind()
Implements javafx. Remove the unidirectional binding for this |
| descriptor | back to summary |
|---|---|
| private final PropertyDescriptor<Number> descriptor | |
| helper | back to summary |
|---|---|
| private ExpressionHelper<Number> helper | |
| listener | back to summary |
|---|---|
| private final PropertyDescriptor<Number>. | |
| observable | back to summary |
|---|---|
| private ObservableValue<? extends Number> observable | |
| JavaBeanLongProperty | back to summary |
|---|---|
| pack-priv JavaBeanLongProperty(PropertyDescriptor<Number> descriptor, Object bean) | |
| addListener | back to summary |
|---|---|
| public void addListener(ChangeListener<? super Number> listener) Implements javafx. Doc from javafx. Adds a
Note that the same actual
The
| |
| addListener | back to summary |
|---|---|
| public void addListener(InvalidationListener listener) Implements javafx. Doc from javafx. Adds an
Note that the same actual
The
| |
| bind | back to summary |
|---|---|
| public void bind(ObservableValue<? extends Number> observable) Implements javafx. Doc from javafx. Create a unidirection binding for this Note that JavaFX has all the bind calls implemented through weak listeners. This means the bound property can be garbage collected and stopped from being updated.
| |
| 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() 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 long get() Implements javafx. Doc from javafx. Get the wrapped value.
Unlike
| |
| 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 | |
| isBound | back to summary |
|---|---|
| public boolean isBound() Implements javafx. Doc from javafx. Can be used to check, if a
| |
| removeListener | back to summary |
|---|---|
| public void removeListener(ChangeListener<? super Number> listener) Implements javafx. Doc from javafx. Removes the given listener from the list of listeners that are notified
whenever the value of the If the given listener has not been previously registered (i.e. it was never added) then this method call is a no-op. If it had been previously added then it will be removed. If it had been added more than once, then only the first occurrence will be removed.
| |
| removeListener | back to summary |
|---|---|
| public void removeListener(InvalidationListener listener) Implements javafx. Doc from javafx. Removes the given listener from the list of listeners, that are notified
whenever the value of the If the given listener has not been previously registered (i.e. it was never added) then this method call is a no-op. If it had been previously added then it will be removed. If it had been added more than once, then only the first occurrence will be removed.
| |
| set | back to summary |
|---|---|
| public void set(final long value) Implements javafx. Doc from javafx. Set the wrapped value.
Unlike
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides javafx. Returns a string representation of this | |
| unbind | back to summary |
|---|---|
| public void unbind() Implements javafx. Doc from javafx. Remove the unidirectional binding for this
| |