public abstract class BooleanPropertyBase extends BooleanProperty
BooleanPropertyBase
is the base class for a property
wrapping a boolean
value.
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.BooleanProperty
Modifier and Type | Class and Description |
---|---|
private static class |
BooleanPropertyBase.Listener |
private class |
BooleanPropertyBase.ValueWrapper |
Modifier and Type | Field and Description |
---|---|
private <any> |
helper |
private InvalidationListener |
listener |
private ObservableBooleanValue |
observable |
private boolean |
valid |
private boolean |
value |
Constructor and Description |
---|
BooleanPropertyBase()
The constructor of the
BooleanPropertyBase . |
BooleanPropertyBase(boolean initialValue)
The constructor of the
BooleanPropertyBase . |
Modifier and Type | Method and Description |
---|---|
void |
addListener(<any> listener) |
void |
addListener(InvalidationListener listener) |
void |
bind(<any> rawObservable)
Create a unidirection binding for this
Property . |
protected void |
fireValueChangedEvent()
Sends notifications to all attached
InvalidationListeners and
ChangeListeners . |
boolean |
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(boolean newValue) |
java.lang.String |
toString()
Returns a string representation of this
BooleanPropertyBase object. |
void |
unbind()
Remove the unidirectional binding for this
Property . |
asObject, bindBidirectional, booleanProperty, setValue, unbindBidirectional
readOnlyBooleanProperty
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getBean, getName
private boolean value
private ObservableBooleanValue observable
private InvalidationListener listener
private boolean valid
private <any> helper
public BooleanPropertyBase()
BooleanPropertyBase
.public BooleanPropertyBase(boolean initialValue)
BooleanPropertyBase
.initialValue
- the initial value of the wrapped valuepublic 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(boolean)
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 boolean get()
public void set(boolean newValue)
public boolean isBound()
Property
is bound.true
if the Property
is bound, false
otherwise#bind(javafx.beans.value.ObservableValue)
public void bind(<any> rawObservable)
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. Note:
rawObservable
- 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()
BooleanPropertyBase
object.toString
in class BooleanProperty
BooleanPropertyBase
object.