|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.binding.value.support.AbstractPropertyChangePublisher
org.springframework.binding.value.support.AbstractValueModel
org.springframework.binding.value.support.BufferedValueModel
org.springframework.binding.value.support.BufferedCollectionValueModel
public class BufferedCollectionValueModel
A BufferedValueModel
that uses an ObservableList as a buffer to hold
chandes to a Collection
or array
. Internally this is
called the "buffered list model."
On commit the following steps occur:
NOTE: Between calls to commit the list model adheres to the contract defined in
java.util.List
NOT the contract of the underlying collection's type.
This can result in the list model representing a state that is not possible for the
underlying collection.
Field Summary |
---|
Fields inherited from class org.springframework.binding.value.support.BufferedValueModel |
---|
BUFFERING_PROPERTY |
Fields inherited from class org.springframework.binding.value.support.AbstractValueModel |
---|
logger |
Fields inherited from interface org.springframework.binding.value.ValueModel |
---|
VALUE_PROPERTY |
Constructor Summary | |
---|---|
BufferedCollectionValueModel(ValueModel wrappedModel,
Class wrappedType)
Constructs a new BufferedCollectionValueModel. |
Method Summary | |
---|---|
protected ObservableList |
createBufferedListModel()
Create an empty buffered list model. |
protected void |
fireListModelChanged()
|
static Class |
getConcreteCollectionType(Class wrappedType)
|
protected Object |
getValueToCommit()
Provides a hook that allows for modification of the value that is committed to the underlying value model. |
protected boolean |
hasValueChanged(Object oldValue,
Object newValue)
Delegates to configured ValueChangeDetector . |
protected Collection |
prepareBackingCollection(Collection col)
Prepare the backing collection for installation into the buffered list model. |
void |
setValue(Object value)
Sets a new buffered value and turns this BufferedValueModel into the buffering state. |
Methods inherited from class org.springframework.binding.value.support.BufferedValueModel |
---|
commit, getCommitTrigger, getInnerMostWrappedValueModel, getValue, getWrappedValueModel, isBuffering, onWrappedValueChanged, revert, setCommitTrigger, toString |
Methods inherited from class org.springframework.binding.value.support.AbstractValueModel |
---|
addValueChangeListener, fireValueChange, fireValueChange, fireValueChange, fireValueChange, fireValueChange, fireValueChangeEvent, fireValueChangeWhenStillEqual, getValueChangeDetector, removeValueChangeListener, setValueChangeDetector, setValueSilently |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BufferedCollectionValueModel(ValueModel wrappedModel, Class wrappedType)
wrappedModel
- the value model to wrapwrappedType
- the class of the value contained by wrappedModel; this must be
assignable to java.util.Collection
or
Object[]
.Method Detail |
---|
public void setValue(Object value)
BufferedValueModel
setValue
in interface ValueModel
setValue
in class BufferedValueModel
value
- the value to be bufferedprotected Object getValueToCommit()
BufferedValueModel
getValueToCommit
in class BufferedValueModel
public static Class getConcreteCollectionType(Class wrappedType)
protected ObservableList createBufferedListModel()
protected Collection prepareBackingCollection(Collection col)
col
- The collection of objects to process
protected void fireListModelChanged()
protected boolean hasValueChanged(Object oldValue, Object newValue)
AbstractValueModel
ValueChangeDetector
.
hasValueChanged
in class AbstractValueModel
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |