T
- the type of the wrapped valuepublic abstract class ObjectPropertyBase<T> extends ObjectProperty<T>
ObjectPropertyBase
is the base class for a property
wrapping an arbitrary Object
.
It provides all the functionality required for a property except for the
ReadOnlyProperty.getBean()
and ReadOnlyProperty.getName()
methods, which must be implemented
by extending classes.ObjectProperty
Modifier and Type | Class and Description |
---|---|
private static class |
ObjectPropertyBase.Listener |
Modifier and Type | Field and Description |
---|---|
private <any> |
helper |
private InvalidationListener |
listener |
private <any> |
observable |
private boolean |
valid |
private T |
value |
Constructor and Description |
---|
ObjectPropertyBase()
The constructor of the
ObjectPropertyBase . |
ObjectPropertyBase(T initialValue)
The constructor of the
ObjectPropertyBase . |
Modifier and Type | Method and Description |
---|---|
void |
addListener(<any> listener) |
void |
addListener(InvalidationListener listener) |
void |
bind(<any> newObservable)
Create a unidirection binding for this
Property . |
protected void |
fireValueChangedEvent()
Sends notifications to all attached
InvalidationListeners and
ChangeListeners . |
T |
get() |
protected void |
invalidated()
The method
invalidated() can be overridden to receive
invalidation notifications. |
boolean |
isBound()
Can be used to check, if a
Property is bound. |
private void |
markInvalid() |
void |
removeListener(<any> listener) |
void |
removeListener(InvalidationListener listener) |
void |
set(T newValue) |
java.lang.String |
toString()
Returns a string representation of this
ObjectPropertyBase object. |
void |
unbind()
Remove the unidirectional binding for this
Property . |
bindBidirectional, setValue, unbindBidirectional
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getBean, getName
private T value
private <any> observable
private InvalidationListener listener
private boolean valid
private <any> helper
public ObjectPropertyBase()
ObjectPropertyBase
.public ObjectPropertyBase(T initialValue)
ObjectPropertyBase
.initialValue
- the initial value of the wrapped Object
public void addListener(InvalidationListener listener)
public void removeListener(InvalidationListener listener)
public void addListener(<any> listener)
public void removeListener(<any> listener)
protected void fireValueChangedEvent()
InvalidationListeners
and
ChangeListeners
.
This method is called when the value is changed, either manually by
calling set(T)
or in case of a bound property, if the
binding becomes invalid.private void markInvalid()
protected void invalidated()
invalidated()
can be overridden to receive
invalidation notifications. This is the preferred option in
Objects
defining the property, because it requires less memory.
The default implementation is empty.public T get()
public void set(T newValue)
public boolean isBound()
Property
is bound.true
if the Property
is bound, false
otherwise#bind(javafx.beans.value.ObservableValue)
public void bind(<any> newObservable)
Property
.
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.
newObservable
- The observable this Property
should be bound to.public void unbind()
Property
.
If the Property
is not bound, calling this method has no effect.#bind(javafx.beans.value.ObservableValue)
public java.lang.String toString()
ObjectPropertyBase
object.toString
in class ObjectProperty<T>
ObjectPropertyBase
object.