Top Description Constructors Methods
javafx.beans.property

public abstract Class ObjectProperty<T>

extends ReadOnlyObjectProperty<T>
implements Property<T>, WritableObjectValue<T>
Class Inheritance
All Implemented Interfaces
javafx.beans.value.WritableObjectValue, 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.ObjectPropertyBase, javafx.beans.property.adapter.JavaBeanObjectProperty
Type Parameters
<T>
the type of the wrapped Object
Imports
javafx.beans.binding.Bindings, javafx.beans.value.ObservableValue, .WritableObjectValue, javafx.collections.ObservableList, .ObservableMap, .ObservableSet

This class provides a full implementation of a Property wrapping an arbitrary Object. The value of a ObjectProperty can be get and set with get(), getValue(), set(Object), and setValue(Object). 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 ObjectProperty can be read with getBean() and getName(). For specialized implementations for ObservableList, ObservableSet and ObservableMap that also report changes inside the collections, see ListProperty, SetProperty and MapProperty, respectively.
Since
JavaFX 2.0
See Also
javafx.beans.value.ObservableObjectValue, javafx.beans.value.WritableObjectValue, ReadOnlyObjectProperty, Property

Constructor Summary

AccessConstructor and Description
public
ObjectProperty()

Creates a default ObjectProperty.

Method Summary

Modifier and TypeMethod and Description
public void
bindBidirectional(Property<T>
the other Property
other
)

Implements javafx.beans.property.Property.bindBidirectional.

Create a bidirectional binding between this Property and another one.

public void
setValue(T
The new value
v
)

Implements javafx.beans.value.WritableValue.setValue.

Set the wrapped value.

public String

Returns:

a string representation of this ObjectProperty object.
toString
()

Overrides javafx.beans.property.ReadOnlyObjectProperty.toString.

Returns a string representation of this ObjectProperty object.

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

Implements javafx.beans.property.Property.unbindBidirectional.

Removes a bidirectional binding between this Property and another one.

Constructor Detail

ObjectPropertyback to summary
public ObjectProperty()

Creates a default ObjectProperty.

Method Detail

bindBidirectionalback to summary
public void bindBidirectional(Property<T> 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<T>

the other Property

Annotations
@Override
setValueback to summary
public void setValue(T v)

Implements javafx.beans.value.WritableValue.setValue.

Doc from javafx.beans.value.WritableValue.setValue.

Set the wrapped value.

Parameters
v:T

The new value

Annotations
@Override
toStringback to summary
public String toString()

Overrides javafx.beans.property.ReadOnlyObjectProperty.toString.

Returns a string representation of this ObjectProperty object.

Returns:String

a string representation of this ObjectProperty object.

Annotations
@Override
unbindBidirectionalback to summary
public void unbindBidirectional(Property<T> 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<T>

the other Property

Annotations
@Override