- java.lang.Object
-
- javafx.beans.binding.ListExpression<E>
-
- javafx.beans.property.ReadOnlyListProperty<E>
-
- javafx.beans.property.ListProperty<E>
-
- javafx.beans.property.ListPropertyBase<E>
-
- javafx.beans.property.SimpleListProperty<E>
-
- javafx.beans.property.ReadOnlyListWrapper<E>
-
- All Implemented Interfaces:
-
Iterable<E>
,Collection<E>
,List<E>
,Observable
,Property<E>
,ReadOnlyProperty<E>
,ObservableListValue<E>
,ObservableObjectValue<E>
,ObservableValue<E>
,WritableListValue<E>
,WritableObjectValue<E>
,WritableValue<E>
,ObservableList<E>
public class ReadOnlyListWrapper<E> extends SimpleListProperty<E>
该类提供了一个方便的类来定义只读属性。 它创建两个同步的属性。 一个属性是只读的,可以传递给外部用户。 另一个属性是可读写的,只能在内部使用。- 从以下版本开始:
- JavaFX 2.1
-
-
Property Summary
-
Properties inherited from class javafx.beans.property.ListPropertyBase
empty, size
-
-
构造方法摘要
构造方法 Constructor 描述 ReadOnlyListWrapper()
构造函数为ReadOnlyListWrapper
ReadOnlyListWrapper(Object bean, String name)
构造函数为ReadOnlyListWrapper
ReadOnlyListWrapper(Object bean, String name, ObservableList<E> initialValue)
构造函数为ReadOnlyListWrapper
ReadOnlyListWrapper(ObservableList<E> initialValue)
构造函数为ReadOnlyListWrapper
-
方法摘要
所有方法 接口方法 具体的方法 Modifier and Type 方法 描述 protected void
fireValueChangedEvent()
发送通知到所有连接InvalidationListeners
,ChangeListeners
,并ListChangeListener
。protected void
fireValueChangedEvent(ListChangeListener.Change<? extends E> change)
发送通知到所有连接InvalidationListeners
,ChangeListeners
,并ListChangeListener
。ReadOnlyListProperty<E>
getReadOnlyProperty()
返回readonly属性,该属性与此ReadOnlyListWrapper
同步。-
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, 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, subList, toArray, toArray, valueAt, valueAt
-
Methods inherited from class javafx.beans.property.ListProperty
bindBidirectional, setValue, unbindBidirectional
-
Methods inherited from class javafx.beans.property.ListPropertyBase
addListener, addListener, addListener, bind, emptyProperty, get, invalidated, isBound, removeListener, removeListener, removeListener, set, sizeProperty, toString, unbind
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface javafx.collections.ObservableList
addAll, filtered, remove, removeAll, retainAll, setAll, setAll, sorted, sorted
-
Methods inherited from interface javafx.beans.value.ObservableValue
getValue
-
Methods inherited from class javafx.beans.property.ReadOnlyListProperty
bindContent, bindContentBidirectional, equals, hashCode, unbindContent, unbindContentBidirectional
-
Methods inherited from class javafx.beans.property.SimpleListProperty
getBean, getName
-
Methods inherited from interface javafx.beans.value.WritableValue
getValue
-
-
-
-
构造方法详细信息
-
ReadOnlyListWrapper
public ReadOnlyListWrapper()
构造函数为ReadOnlyListWrapper
-
ReadOnlyListWrapper
public ReadOnlyListWrapper(ObservableList<E> initialValue)
构造函数为ReadOnlyListWrapper
- 参数
-
initialValue
- 包装值的初始值
-
ReadOnlyListWrapper
public ReadOnlyListWrapper(Object bean, String name)
构造函数为ReadOnlyListWrapper
- 参数
-
bean
- 这个ReadOnlyListWrapper
的豆 -
name
- 这个名字ReadOnlyListWrapper
-
ReadOnlyListWrapper
public ReadOnlyListWrapper(Object bean, String name, ObservableList<E> initialValue)
构造函数为ReadOnlyListWrapper
- 参数
-
bean
- 这个ReadOnlyListWrapper
的豆 -
name
- 这个名字ReadOnlyListWrapper
-
initialValue
- 包装值的初始值
-
-
方法详细信息
-
getReadOnlyProperty
public ReadOnlyListProperty<E> getReadOnlyProperty()
返回readonly属性,该属性与此ReadOnlyListWrapper
同步。- 结果
- 只读属性
-
fireValueChangedEvent
protected void fireValueChangedEvent()
发送通知到所有连接InvalidationListeners
,ChangeListeners
,并ListChangeListener
。 通过调用ListPropertyBase.set(ObservableList)
手动或绑定属性的情况下,如果绑定变为无效,则调用此方法。
-
fireValueChangedEvent
protected void fireValueChangedEvent(ListChangeListener.Change<? extends E> change)
发送通知到所有连接InvalidationListeners
,ChangeListeners
,并ListChangeListener
。 当列表的内容更改时调用此方法。- 重写:
-
fireValueChangedEvent
在ListPropertyBase<E>
- 参数
-
change
- 需要传播的更改
-
-