E
- the type of the List
elementspublic abstract class ListPropertyBase<E> extends ListProperty<E>
ListPropertyBase
is the base class for a property
wrapping an javafx.collections.ObservableList
.
It provides all the functionality required for a property except for the
ReadOnlyProperty.getBean()
and ReadOnlyProperty.getName()
methods, which must be implemented
by extending classes.javafx.collections.ObservableList
,
ListProperty
Type | Property and Description |
---|---|
ReadOnlyBooleanProperty |
empty |
ReadOnlyIntegerProperty |
size |
Modifier and Type | Class and Description |
---|---|
private class |
ListPropertyBase.EmptyProperty |
private static class |
ListPropertyBase.Listener<E> |
private class |
ListPropertyBase.SizeProperty |
Modifier and Type | Field and Description |
---|---|
private ListPropertyBase.EmptyProperty |
empty0 |
private <any> |
helper |
private <any> |
listChangeListener |
private InvalidationListener |
listener |
private <any> |
observable |
private ListPropertyBase.SizeProperty |
size0 |
private boolean |
valid |
private <any> |
value |
Constructor and Description |
---|
ListPropertyBase()
The Constructor of
ListPropertyBase |
ListPropertyBase(<any> initialValue)
The constructor of the
ListPropertyBase . |
Modifier and Type | Method and Description |
---|---|
void |
addListener(<any> listener) |
void |
addListener(<any> listener) |
void |
addListener(InvalidationListener listener) |
void |
bind(<any> newObservable)
Create a unidirection binding for this
Property . |
ReadOnlyBooleanProperty |
emptyProperty() |
protected void |
fireValueChangedEvent()
Sends notifications to all attached
InvalidationListeners ,
ChangeListeners , and
javafx.collections.ListChangeListener . |
protected void |
fireValueChangedEvent(<any> change)
Sends notifications to all attached
InvalidationListeners ,
ChangeListeners , and
javafx.collections.ListChangeListener . |
<any> |
get() |
protected void |
invalidated()
The method
invalidated() can be overridden to receive
invalidation notifications. |
private void |
invalidateProperties() |
boolean |
isBound()
Can be used to check, if a
Property is bound. |
private void |
markInvalid(<any> oldValue) |
void |
removeListener(<any> listener) |
void |
removeListener(<any> listener) |
void |
removeListener(InvalidationListener listener) |
void |
set(<any> newValue) |
ReadOnlyIntegerProperty |
sizeProperty() |
java.lang.String |
toString()
Returns a string representation of this
ListPropertyBase object. |
void |
unbind()
Remove the unidirectional binding for this
Property . |
bindBidirectional, setValue, unbindBidirectional
bindContent, bindContentBidirectional, equals, hashCode, unbindContent, unbindContentBidirectional
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getBean, getName
public ReadOnlyIntegerProperty sizeProperty
public ReadOnlyBooleanProperty emptyProperty
private final <any> listChangeListener
private <any> value
private <any> observable
private InvalidationListener listener
private boolean valid
private <any> helper
private ListPropertyBase.SizeProperty size0
private ListPropertyBase.EmptyProperty empty0
public ListPropertyBase()
ListPropertyBase
public ListPropertyBase(<any> initialValue)
ListPropertyBase
.initialValue
- the initial value of the wrapped valuepublic ReadOnlyIntegerProperty sizeProperty()
public ReadOnlyBooleanProperty emptyProperty()
public void addListener(InvalidationListener listener)
public void removeListener(InvalidationListener listener)
public void addListener(<any> listener)
public void removeListener(<any> listener)
public void addListener(<any> listener)
public void removeListener(<any> listener)
protected void fireValueChangedEvent()
InvalidationListeners
,
ChangeListeners
, and
javafx.collections.ListChangeListener
.
This method is called when the value is changed, either manually by
calling #set(ObservableList)
or in case of a bound property, if the
binding becomes invalid.protected void fireValueChangedEvent(<any> change)
InvalidationListeners
,
ChangeListeners
, and
javafx.collections.ListChangeListener
.
This method is called when the content of the list changes.change
- the change that needs to be propagatedprivate void invalidateProperties()
private void markInvalid(<any> oldValue)
protected void invalidated()
invalidated()
can be overridden to receive
invalidation notifications. This is the preferred option in
Objects
defining the property, because it requires less memory.
The default implementation is empty.public <any> get()
public void set(<any> newValue)
public boolean isBound()
Property
Property
is bound.true
if the Property
is bound, false
otherwise#bind(javafx.beans.value.ObservableValue)
public void bind(<any> newObservable)
Property
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.
newObservable
- The observable this Property
should be bound to.public void unbind()
Property
Property
.
If the Property
is not bound, calling this method has no effect.#bind(javafx.beans.value.ObservableValue)
public java.lang.String toString()
ListPropertyBase
object.toString
in class ListProperty<E>
ListPropertyBase
object.