- java.lang.Object
-
- javafx.beans.binding.ListExpression<E>
-
- javafx.beans.property.ReadOnlyListProperty<E>
-
- javafx.beans.property.ListProperty<E>
-
- 参数类型
-
E-List元素的类型
- All Implemented Interfaces:
-
Iterable<E>,Collection<E>,List<E>,Observable,Property<ObservableList<E>>,ReadOnlyProperty<E>,ObservableListValue<E>,ObservableObjectValue<E>,ObservableValue<E>,WritableListValue<E>,WritableObjectValue<E>,WritableValue<E>,ObservableList<E>
- 已知直接子类:
-
ListPropertyBase
public abstract class ListProperty<E> extends ReadOnlyListProperty<E> implements Property<ObservableList<E>>, WritableListValue<E>
这个类提供了一个Property包装一个ObservableList的完整实现。 a的值ListProperty可以获取和设置ObservableObjectValue.get(),ListExpression.getValue(),WritableObjectValue.set(Object),并setValue(ObservableList)。 可以使用Property.bind(javafx.beans.value.ObservableValue)和Property.unbind()绑定和绑定一个属性。 可以使用bindBidirectional(Property)和unbindBidirectional(Property)创建和删除双向绑定。ListProperty的上下文可以用ReadOnlyProperty.getBean()和ReadOnlyProperty.getName()读取。- 从以下版本开始:
- JavaFX 2.1
- 另请参见:
-
ObservableList,ObservableListValue,WritableListValue,ReadOnlyListProperty,Property
-
-
Property Summary
-
Properties inherited from class javafx.beans.binding.ListExpression
empty, size
-
-
构造方法摘要
构造方法 Constructor 描述 ListProperty()
-
方法摘要
所有方法 接口方法 具体的方法 Modifier and Type 方法 描述 voidbindBidirectional(Property<ObservableList<E>> other)在这个Property和另一个之间创建双向绑定。voidsetValue(ObservableList<E> v)设置包装的值。StringtoString()返回此ListProperty对象的字符串表示形式。voidunbindBidirectional(Property<ObservableList<E>> other)删除此Property之间的双向绑定。-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream
-
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, of, of, of, of, of, of, of, of, of, of, of, of, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray
-
Methods inherited from class javafx.beans.binding.ListExpression
add, add, addAll, addAll, addAll, asString, clear, contains, containsAll, emptyProperty, get, getSize, getValue, indexOf, isEmpty, isEqualTo, isNotEqualTo, isNotNull, isNull, iterator, lastIndexOf, listExpression, listIterator, listIterator, remove, remove, remove, removeAll, removeAll, retainAll, retainAll, set, setAll, setAll, size, sizeProperty, subList, toArray, toArray, valueAt, valueAt
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface javafx.beans.Observable
addListener, removeListener
-
Methods inherited from interface javafx.collections.ObservableList
addAll, addListener, filtered, remove, removeAll, removeListener, retainAll, setAll, setAll, sorted, sorted
-
Methods inherited from interface javafx.beans.value.ObservableObjectValue
get
-
Methods inherited from interface javafx.beans.value.ObservableValue
addListener, getValue, removeListener
-
Methods inherited from class javafx.beans.property.ReadOnlyListProperty
bindContent, bindContentBidirectional, equals, hashCode, unbindContent, unbindContentBidirectional
-
Methods inherited from interface javafx.beans.property.ReadOnlyProperty
getBean, getName
-
Methods inherited from interface javafx.beans.value.WritableObjectValue
get, set
-
Methods inherited from interface javafx.beans.value.WritableValue
getValue
-
-
-
-
方法详细信息
-
setValue
public void setValue(ObservableList<E> v)
设置包装的值。- Specified by:
-
setValue在接口WritableValue<E> - 参数
-
v- 新值
-
bindBidirectional
public void bindBidirectional(Property<ObservableList<E>> other)
在这个Property和另一个之间创建双向绑定。 双向绑定与单向绑定无关。 因此,可以向具有双向绑定的属性添加单向绑定,反之亦然。 但是,这种做法是不鼓励的。可以有一个属性的多个双向绑定。
JavaFX双向绑定实现使用弱侦听器。 这意味着双向绑定不会阻止属性被垃圾回收。
- Specified by:
-
bindBidirectional在接口Property<E> - 参数
-
other- 其他Property
-
unbindBidirectional
public void unbindBidirectional(Property<ObservableList<E>> other)
删除此Property和另一个之间的双向绑定。 如果不存在属性之间的双向绑定,则调用此方法不起作用。 可以通过第二个属性的调用解除绑定。 此代码将工作:property1.bindBirectional(property2); property2.unbindBidirectional(property1);- Specified by:
-
unbindBidirectional在接口Property<E> - 参数
-
other- 其他Property
-
toString
public String toString()
返回此ListProperty对象的字符串表示形式。- 重写:
-
toString在ReadOnlyListProperty<E> - 结果
-
这个
ListProperty对象的字符串表示形式。
-
-