Spec-Zone.ru › OpenJavaFX 8
javafx.beans.property

Interface Property<T>

Type Parameters:

T - the type of the wrapped value

All Superinterfaces:

Observable, ObservableValue<T>, ReadOnlyProperty<T>, WritableValue<T>

All Known Subinterfaces:

JavaBeanProperty<T>

All Known Implementing Classes:

BooleanProperty, BooleanPropertyBase, DoubleProperty, DoublePropertyBase, FloatProperty, FloatPropertyBase, IntegerProperty, IntegerPropertyBase, JavaBeanBooleanProperty, JavaBeanDoubleProperty, JavaBeanFloatProperty, JavaBeanIntegerProperty, JavaBeanLongProperty, JavaBeanObjectProperty, JavaBeanStringProperty, ListProperty, ListPropertyBase, LongProperty, LongPropertyBase, MapProperty, MapPropertyBase, ObjectProperty, ObjectPropertyBase, ReadOnlyBooleanWrapper, ReadOnlyDoubleWrapper, ReadOnlyFloatWrapper, ReadOnlyIntegerWrapper, ReadOnlyListWrapper, ReadOnlyLongWrapper, ReadOnlyMapWrapper, ReadOnlyObjectWrapper, ReadOnlySetWrapper, ReadOnlyStringWrapper, SetProperty, SetPropertyBase, SimpleBooleanProperty, SimpleDoubleProperty, SimpleFloatProperty, SimpleIntegerProperty, SimpleListProperty, SimpleLongProperty, SimpleMapProperty, SimpleObjectProperty, SimpleSetProperty, SimpleStringProperty, SimpleStyleableBooleanProperty, SimpleStyleableDoubleProperty, SimpleStyleableFloatProperty, SimpleStyleableIntegerProperty, SimpleStyleableLongProperty, SimpleStyleableObjectProperty, SimpleStyleableStringProperty, StringProperty, StringPropertyBase, StyleableBooleanProperty, StyleableDoubleProperty, StyleableFloatProperty, StyleableIntegerProperty, StyleableLongProperty, StyleableObjectProperty, StyleableStringProperty



public interface Property<T>
extends ReadOnlyProperty<T>, WritableValue<T>
Generic interface that defines the methods common to all (writable) properties independent of their type.

Since:

JavaFX 2.0

  • Method Summary

    All MethodsInstance MethodsAbstract Methods
    Modifier and Type Method and Description
    void bind(ObservableValue<? extends T> observable)
    Create a unidirection binding for this Property.
    void bindBidirectional(Property<T> other)
    Create a bidirectional binding between this Property and another one.
    boolean isBound()
    Can be used to check, if a Property is bound.
    void unbind()
    Remove the unidirectional binding for this Property.
    void unbindBidirectional(Property<T> other)
    Remove a bidirectional binding between this Property and another one.
    • Methods inherited from interface javafx.beans.property.ReadOnlyProperty

      getBean, getName
    • Methods inherited from interface javafx.beans.value.ObservableValue

      addListener, getValue, removeListener
    • Methods inherited from interface javafx.beans.Observable

      addListener, removeListener
    • Methods inherited from interface javafx.beans.value.WritableValue

      getValue, setValue
  • Method Detail

    • bind

      void bind(ObservableValue<? extends T> observable)
      Create a unidirection binding for this 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.

      Parameters:

      observable - The observable this Property should be bound to.

      Throws:

      NullPointerException - if observable is null

    • unbind

      void unbind()
      Remove the unidirectional binding for this Property. If the Property is not bound, calling this method has no effect.

      See Also:

      bind(javafx.beans.value.ObservableValue)

    • isBound

      boolean isBound()
      Can be used to check, if a Property is bound.

      Returns:

      true if the Property is bound, false otherwise

      See Also:

      bind(javafx.beans.value.ObservableValue)

    • bindBidirectional

      void bindBidirectional(Property<T> other)
      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 - the other Property

      Throws:

      NullPointerException - if other is null

    • unbindBidirectional

      void unbindBidirectional(Property<T> other)
      Remove 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.bindBirectional(property2);
           property2.unbindBidirectional(property1);

      Parameters:

      other - the other Property

      Throws:

      NullPointerException - if other is null

© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API