Package com._1c.g5.aef2.models.value
Class Value<T>
- java.lang.Object
-
- com._1c.g5.aef2.validators.Validable
-
- com._1c.g5.aef2.models.Model
-
- com._1c.g5.aef2.models.EditableModel
-
- com._1c.g5.aef2.models.value.Value<T>
-
- All Implemented Interfaces:
IEditableModel
,IModel
,IValue<T>
,IValidable
- Direct Known Subclasses:
BmValue
,EmfValue
,PojoValue
,ValueWorkingCopy
,ViewModelValue
public abstract class Value<T> extends EditableModel implements IValue<T>
BaseIValue
implementation.
-
-
Constructor Summary
Constructors Constructor Description Value()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addValueListener(IValueListener<T> listener)
Adds the value listener.Value<T>
createWorkingCopy()
void
discard()
Discards the changes stored in the model buffer since lastIModel.commit()
operation.void
dispose()
Disposes this model.T
get()
protected T
getCommittedValue()
protected T
getUncommittedValue()
protected Object
getValidatorTarget()
Provides validation target for this validable object.boolean
isEqual(T other)
Checks the value for equality with the current stored value.protected void
notifyValueChanged(ChangeOrigin changeOrigin)
Notifies the listeners about a change of this value.protected void
queueNotifyValueChanged()
Asynchronously notifies the listeners about a change of this value.void
removeValueListener(IValueListener<T> listener)
Removes the value listener.void
set(T value)
protected void
setCommittedValue(T committedValue)
protected void
setUncommittedValue(T uncommittedValue)
protected void
setValue(T value)
Sets both the committed and the uncommitted values at the same time.String
toString()
-
Methods inherited from class com._1c.g5.aef2.models.EditableModel
isEditable, setEditable
-
Methods inherited from class com._1c.g5.aef2.models.Model
addModelListener, beginExternalUpdate, checkOffline, checkOnline, commit, endExternalUpdate, getComponent, getCurrentChangeOrigin, getRunnableQueue, isOnline, notifyModelChanged, notifyModelCommitted, removeModelListener, setComponent, setOnline
-
Methods inherited from class com._1c.g5.aef2.validators.Validable
addValidator, removeValidator, validate, validate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com._1c.g5.aef2.models.IModel
addModelListener, commit, getChange, getComponent, isOnline, removeModelListener, setComponent
-
Methods inherited from interface com._1c.g5.aef2.validators.IValidable
addValidator, removeValidator, validate, validate
-
-
-
-
Method Detail
-
discard
public void discard()
Description copied from interface:IModel
Discards the changes stored in the model buffer since lastIModel.commit()
operation.
-
set
public void set(T value)
-
isEqual
public boolean isEqual(T other)
Description copied from interface:IValue
Checks the value for equality with the current stored value.
-
addValueListener
public void addValueListener(IValueListener<T> listener)
Description copied from interface:IValue
Adds the value listener.- Specified by:
addValueListener
in interfaceIValue<T>
- Parameters:
listener
- the listener to add.
-
removeValueListener
public void removeValueListener(IValueListener<T> listener)
Description copied from interface:IValue
Removes the value listener.- Specified by:
removeValueListener
in interfaceIValue<T>
- Parameters:
listener
- the listener to remove.
-
createWorkingCopy
public Value<T> createWorkingCopy()
- Specified by:
createWorkingCopy
in interfaceIModel
- Specified by:
createWorkingCopy
in interfaceIValue<T>
- Overrides:
createWorkingCopy
in classModel
- Returns:
- the model working copy or
null
if working copies is not supported by the model.
-
dispose
public void dispose()
Description copied from interface:IModel
Disposes this model.
-
getValidatorTarget
protected Object getValidatorTarget()
Description copied from class:Validable
Provides validation target for this validable object. Override this method to change the validation target of this validable.- Overrides:
getValidatorTarget
in classValidable
- Returns:
- this object validation target.
-
getCommittedValue
protected final T getCommittedValue()
- Returns:
- the committed value, under normal conditions it should be in sync with data source.
-
setCommittedValue
protected final void setCommittedValue(T committedValue)
- Parameters:
committedValue
- the new committed value to set.- See Also:
getCommittedValue()
-
getUncommittedValue
protected final T getUncommittedValue()
- Returns:
- the buffered but yet uncommitted value.
-
setUncommittedValue
protected final void setUncommittedValue(T uncommittedValue)
- Parameters:
uncommittedValue
- the new uncommitted value to set.
-
setValue
protected final void setValue(T value)
Sets both the committed and the uncommitted values at the same time.- Parameters:
value
- the value to set.
-
notifyValueChanged
protected final void notifyValueChanged(ChangeOrigin changeOrigin)
Notifies the listeners about a change of this value.
-
queueNotifyValueChanged
protected final void queueNotifyValueChanged()
Asynchronously notifies the listeners about a change of this value.
-
-