Top Description Constructors Methods
javafx.beans.property

public abstract Class BooleanProperty

extends ReadOnlyBooleanProperty
implements Property<Boolean>, WritableBooleanValue
Class Inheritance
All Implemented Interfaces
javafx.beans.value.WritableBooleanValue, javafx.beans.value.WritableValue, javafx.beans.property.Property, javafx.beans.property.ReadOnlyProperty, javafx.beans.value.ObservableValue, javafx.beans.Observable
Known Direct Subclasses
javafx.beans.property.BooleanPropertyBase, javafx.beans.property.adapter.JavaBeanBooleanProperty
Imports
java.util.Objects, com.sun.javafx.binding.BidirectionalBinding, .Logging, javafx.beans.binding.Bindings, javafx.beans.value.ObservableValue, .WritableBooleanValue

This class provides a full implementation of a Property wrapping a boolean value.

The value of a BooleanProperty can be get and set with get(), getValue(), set(boolean), and setValue(Boolean).

A property can be bound and unbound unidirectional with bind(ObservableValue) and unbind(). Bidirectional bindings can be created and removed with bindBidirectional(Property) and unbindBidirectional(Property).

The context of a BooleanProperty can be read with getBean() and getName().

Note

setting or binding this property to a null value will set the property to "false". See setValue(java.lang.Boolean).

Since
JavaFX 2.0
See Also
javafx.beans.value.ObservableBooleanValue, javafx.beans.value.WritableBooleanValue, ReadOnlyBooleanProperty, Property

Constructor Summary

AccessConstructor and Description
public
BooleanProperty()

Sole constructor

Method Summary

Modifier and TypeMethod and Description
public ObjectProperty<Boolean>

Returns:

the new ObjectProperty
asObject
()

Overrides javafx.beans.property.ReadOnlyBooleanProperty.asObject.

Creates an javafx.beans.property.ObjectProperty that holds the value of this BooleanProperty.

public void
bindBidirectional(Property<Boolean>
the other Property
other
)

Implements javafx.beans.property.Property.bindBidirectional.

Create a bidirectional binding between this Property and another one.

public static BooleanProperty

Returns:

A BooleanProperty that wraps the Property if necessary
booleanProperty
(final Property<Boolean>
The source Property
property
)

Returns a BooleanProperty that wraps a javafx.beans.property.Property.

public void
public String

Returns:

a string representation of this BooleanProperty object.
toString
()

Overrides javafx.beans.property.ReadOnlyBooleanProperty.toString.

Returns a string representation of this BooleanProperty object.

public void
unbindBidirectional(Property<Boolean>
the other Property
other
)

Implements javafx.beans.property.Property.unbindBidirectional.

Removes a bidirectional binding between this Property and another one.

Inherited from javafx.beans.property.ReadOnlyBooleanProperty:
readOnlyBooleanProperty

Constructor Detail

BooleanPropertyback to summary
public BooleanProperty()

Sole constructor

Method Detail

asObjectback to summary
public ObjectProperty<Boolean> asObject()

Overrides javafx.beans.property.ReadOnlyBooleanProperty.asObject.

Creates an javafx.beans.property.ObjectProperty that holds the value of this BooleanProperty. If the value of this BooleanProperty changes, the value of the ObjectProperty will be updated automatically.

Returns:ObjectProperty<Boolean>

the new ObjectProperty

Annotations
@Override
Since
JavaFX 8.0
bindBidirectionalback to summary
public void bindBidirectional(Property<Boolean> other)

Implements javafx.beans.property.Property.bindBidirectional.

Doc from javafx.beans.property.Property.bindBidirectional.

Create a bidirectional binding between this Property and another one. Bidirectional bindings exists independently of unidirectional bindings. So it is possible to add unidirectional binding to a property with bidirectional binding and vice-versa. However, this practice is discouraged.

It is possible to have multiple bidirectional bindings of one Property.

JavaFX bidirectional binding implementation use weak listeners. This means bidirectional binding does not prevent properties from being garbage collected.

Parameters
other:Property<Boolean>

the other Property

Annotations
@Override
booleanPropertyback to summary
public static BooleanProperty booleanProperty(final Property<Boolean> property)

Returns a BooleanProperty that wraps a javafx.beans.property.Property. If the Property is already a BooleanProperty, it will be returned. Otherwise a new BooleanProperty is created that is bound to the Property.

Note

null values in the source property will be interpreted as "false"

Parameters
property:Property<Boolean>

The source Property

Returns:BooleanProperty

A BooleanProperty that wraps the Property if necessary

Exceptions
NullPointerException:
if property is null
Since
JavaFX 8.0
setValueback to summary
public void setValue(Boolean v)

Implements javafx.beans.value.WritableValue.setValue, javafx.beans.value.WritableBooleanValue.setValue.

Doc from javafx.beans.value.WritableBooleanValue.setValue.

Set the wrapped value.

Note

this method should accept null without throwing an exception, setting "false" instead.

Parameters
v:Boolean

The new value

Annotations
@Override
toStringback to summary
public String toString()

Overrides javafx.beans.property.ReadOnlyBooleanProperty.toString.

Returns a string representation of this BooleanProperty object.

Returns:String

a string representation of this BooleanProperty object.

Annotations
@Override
unbindBidirectionalback to summary
public void unbindBidirectional(Property<Boolean> other)

Implements javafx.beans.property.Property.unbindBidirectional.

Doc from javafx.beans.property.Property.unbindBidirectional.

Removes a bidirectional binding between this Property and another one. If no bidirectional binding between the properties exists, calling this method has no effect. It is possible to unbind by a call on the second property. This code will work:

    property1.bindBidirectional(property2);
    property2.unbindBidirectional(property1);
Parameters
other:Property<Boolean>

the other Property

Annotations
@Override