Class PropertyStateModel
- 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>
-
- com._1c.g5.v8.dt.aef2.bm.models.BmValue<MdPropertyState>
-
- com._1c.g5.v8.dt.md.ui.extension.aef.models.PropertyStateModel
-
- All Implemented Interfaces:
IAttribute<IBmObject,org.eclipse.emf.ecore.EStructuralFeature>
,IEditableModel
,IEmfAttribute<IBmObject>
,IModel
,IEmfValueAttribute<MdPropertyState,IBmObject>
,IValue<MdPropertyState>
,IValidable
,IModelApiAwareModel
- Direct Known Subclasses:
CommonAttributeAutoUsePropertyStateModel
,CommonAttributeDataSeparationPropertyStateModel
,ExtendedConfigurationObjectPropertyStateModel
,FormPropertyStateModel
public class PropertyStateModel extends BmValue<MdPropertyState>
AEF model for metadata property state.
-
-
Constructor Summary
Constructors Constructor Description PropertyStateModel(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature, IMdAdoptedPropertyAccess mdAdoptedPropertyAccess, IMdAdoptedPropertyNotifier mdAdoptedPropertyNotifier, IModelObjectAdopter modelObjectAdopter)
Constructor ofPropertyStateModel
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
Disposes this model.protected MdPropertyState
getObjectValue(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature, boolean resolve)
Gets the current value of the provided model object feature.protected void
processBmValueChange(Object value)
Process the BM value change and apply changes to thisBmValue
.protected void
setObjectValue(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature, MdPropertyState newValue)
Sets the new value of the provided model object feature during the commit.
The method is invoked within the task, so the given objects have the relevant state (e.g.protected boolean
shouldSetSourceValue(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature, MdPropertyType type, MdPropertyState newState)
Check value is should be set to new stateprotected boolean
shouldUnsetValue(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature, MdPropertyState newState)
Check value is should be unset to defaultprotected void
unsetValue(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature)
Set default value to given object in specified feature-
Methods inherited from class com._1c.g5.v8.dt.aef2.bm.models.BmValue
adapt, createTask, getChange, getModelApi, getObject, getProperty, setModelApi
-
Methods inherited from class com._1c.g5.aef2.models.value.Value
addValueListener, createWorkingCopy, discard, get, getCommittedValue, getUncommittedValue, getValidatorTarget, isEqual, notifyValueChanged, queueNotifyValueChanged, removeValueListener, set, setCommittedValue, setUncommittedValue, setValue, 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, discard, getComponent, isOnline, removeModelListener, setComponent
-
Methods inherited from interface com._1c.g5.aef2.validators.IValidable
addValidator, removeValidator, validate, validate
-
Methods inherited from interface com._1c.g5.aef2.models.value.IValue
addValueListener, createWorkingCopy, get, isEqual, removeValueListener, set
-
-
-
-
Constructor Detail
-
PropertyStateModel
public PropertyStateModel(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature, IMdAdoptedPropertyAccess mdAdoptedPropertyAccess, IMdAdoptedPropertyNotifier mdAdoptedPropertyNotifier, IModelObjectAdopter modelObjectAdopter)
Constructor ofPropertyStateModel
.- Parameters:
object
- the object, cannot benull
feature
- the object feature, cannot benull
mdAdoptedPropertyAccess
- the metadata adopted property access, cannot benull
mdAdoptedPropertyNotifier
- the metadata adopted property notifier, cannot benull
modelObjectAdopter
- the model object adopter, cannot benull
-
-
Method Detail
-
dispose
public void dispose()
Description copied from interface:IModel
Disposes this model.- Specified by:
dispose
in interfaceIModel
- Overrides:
dispose
in classBmValue<MdPropertyState>
-
getObjectValue
protected MdPropertyState getObjectValue(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature, boolean resolve)
Description copied from class:BmValue
Gets the current value of the provided model object feature.- Overrides:
getObjectValue
in classBmValue<MdPropertyState>
- Parameters:
object
- the object to get new value, cannot benull
feature
- the feture to get, cannot benull
- Returns:
- the current value, can be
null
-
setObjectValue
protected void setObjectValue(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature, MdPropertyState newValue)
Description copied from class:BmValue
Sets the new value of the provided model object feature during the commit.
The method is invoked within the task, so the given objects have the relevant state (e.g. attached to transaction).- Overrides:
setObjectValue
in classBmValue<MdPropertyState>
- Parameters:
object
- the object to set new value, cannot benull
.feature
- the feture to set, cannot benull
.newValue
- the new value to set, can benull
.
-
processBmValueChange
protected void processBmValueChange(Object value)
Description copied from class:BmValue
Process the BM value change and apply changes to thisBmValue
.- Overrides:
processBmValueChange
in classBmValue<MdPropertyState>
- Parameters:
value
- the new value, can benull
-
shouldUnsetValue
protected boolean shouldUnsetValue(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature, MdPropertyState newState)
Check value is should be unset to default- Parameters:
object
- the object to set new value, cannot benull
.feature
- the feture to set, cannot benull
.newState
- the new state value to set, can benull
.- Returns:
true
if value in given object and specified feature should be unsets,false
in otherwise
-
unsetValue
protected void unsetValue(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature)
Set default value to given object in specified feature- Parameters:
object
- the object to set new value, cannot benull
.feature
- the feture to set, cannot benull
.
-
shouldSetSourceValue
protected boolean shouldSetSourceValue(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature, MdPropertyType type, MdPropertyState newState)
Check value is should be set to new state- Parameters:
target
- the object to set property, cannot benull
feature
- the property to set, cannot benull
type
- the metadata property type, cannot benull
newState
- the new value of the given property, may benull
to erase property value- Returns:
true
if value in given object and specified feature should be unsets,false
in otherwise
-
-