Class AbstractTypeDescriptionModel
- java.lang.Object
-
- com._1c.g5.aef2.validators.Validable
-
- com._1c.g5.aef2.models.Model
-
- com._1c.g5.aef2.models.CompoundModel
-
- com._1c.g5.v8.dt.md.ui.aef.models.type.AbstractTypeDescriptionModel
-
- All Implemented Interfaces:
ICompoundModel
,IEditableModel
,IModel
,IValidable
,ITypeDescriptionModel
- Direct Known Subclasses:
AbstractTypeDescriptionDialogModel
,BmTypeDescriptionModel
,EmfTypeDescriptionModel
,TypeDescriptionModel
public abstract class AbstractTypeDescriptionModel extends CompoundModel implements ITypeDescriptionModel
The abstract model for type description component.
-
-
Constructor Summary
Constructors Constructor Description AbstractTypeDescriptionModel(org.eclipse.emf.ecore.EObject parent, org.eclipse.emf.ecore.EObject parentContext, org.eclipse.emf.ecore.EReference feature, IV8Project v8project)
Creates a new instance of the model.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
buildTypeDescriptionValue()
Builds and set the newTypeDescription
from qualifiers.void
commit()
Commits the changes to the data model.ITypeDescriptionDialogModel
createDialogModel()
protected abstract IValue<TypeDescription>
createTypeDescriptionModel(org.eclipse.emf.ecore.EObject parent, org.eclipse.emf.ecore.EReference feature)
Creates a newIValue
model ofTypeDescription
type.void
dispose()
Disposes this model.IValue<Boolean>
getBinaryFixed()
IValue<Integer>
getBinaryLength()
int
getBinaryLengthMaximum()
int
getBinaryLengthMinimum()
protected org.eclipse.emf.ecore.EObject
getContextObject()
Returns the context object to obtain types list.IValue<DateFractions>
getDateFractions()
org.eclipse.emf.ecore.EReference
getFeature()
IList<TypeItem>
getMultiItems()
IValue<Boolean>
getNumberNonNegative()
IValue<Integer>
getNumberPrecision()
int
getNumberPrecisionMaximum()
int
getNumberPrecisionMinimum()
IValue<Integer>
getNumberScale()
int
getNumberScaleMaximum()
int
getNumberScaleMinimum()
org.eclipse.emf.ecore.EObject
getParent()
org.eclipse.emf.ecore.EObject
getParentContext()
Gets parent context of theITypeDescriptionModel
ScriptVariantProvider
getScriptVariantProvider()
IValue<TypeItem>
getSingleTypeItem()
IValue<Boolean>
getStringFixed()
IValue<Integer>
getStringLength()
int
getStringLengthMaximum()
int
getStringLengthMinimum()
IValue<TypeDescription>
getTypeDescription()
TypeDescriptionInfo
getTypeDescriptionInfo()
TypeInfo
getTypeInfo(TypeItem item)
List<TypeItem>
getTypes(boolean needRefresh)
Returns a list ofTypeItem
.IV8Project
getV8project()
boolean
isBinaryFixedEnabled()
boolean
isDateFractionsEnabled()
boolean
isEditable()
Checks if this model is editable.boolean
isNumberPositiveEnabled()
boolean
isNumberPositiveOnly()
boolean
isStringFixedEnabled()
protected void
refresh(TypeDescription td)
Refreshes the model state from the givenTypeDescription
.protected TypeItem
resolveItem(TypeItem item)
If a given item is a proxy object, resolves it against the resource set in the project parameters of the model.void
setComponent(IComponent<?> component)
Associate this model with the component.void
setEditable(boolean editable)
Sets model editable state.void
setTypeFilter(Predicate<TypeItem> filter)
Sets the filter to apply to the list of model type items.-
Methods inherited from class com._1c.g5.aef2.models.CompoundModel
addModel, getChange, getModels, isOnline, validate
-
Methods inherited from class com._1c.g5.aef2.models.Model
addModelListener, beginExternalUpdate, checkOffline, checkOnline, createWorkingCopy, discard, endExternalUpdate, getComponent, getCurrentChangeOrigin, getRunnableQueue, notifyModelChanged, notifyModelCommitted, removeModelListener, setOnline, toString
-
Methods inherited from class com._1c.g5.aef2.validators.Validable
addValidator, getValidatorTarget, removeValidator, 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, createWorkingCopy, discard, getChange, getComponent, isOnline, removeModelListener
-
Methods inherited from interface com._1c.g5.aef2.validators.IValidable
addValidator, removeValidator, validate, validate
-
-
-
-
Constructor Detail
-
AbstractTypeDescriptionModel
public AbstractTypeDescriptionModel(org.eclipse.emf.ecore.EObject parent, org.eclipse.emf.ecore.EObject parentContext, org.eclipse.emf.ecore.EReference feature, IV8Project v8project)
Creates a new instance of the model.- Parameters:
parent
- the parent objectparentContext
- parent context object, can benull
if there is no contextfeature
- the feature of the parentv8project
- the V8 project, cannot benull
-
-
Method Detail
-
setComponent
public void setComponent(IComponent<?> component)
Description copied from interface:IModel
Associate this model with the component.- Specified by:
setComponent
in interfaceIModel
- Overrides:
setComponent
in classCompoundModel
- Parameters:
component
- the component to associate with.
-
getTypes
public List<TypeItem> getTypes(boolean needRefresh)
Description copied from interface:ITypeDescriptionModel
Returns a list ofTypeItem
. If model type filter is set, the list will be filtered.- Specified by:
getTypes
in interfaceITypeDescriptionModel
- Parameters:
needRefresh
-true
if the collection of type is need to update- Returns:
- a list of
TypeItem
objects, nevernull
-
setTypeFilter
public void setTypeFilter(Predicate<TypeItem> filter)
Description copied from interface:ITypeDescriptionModel
Sets the filter to apply to the list of model type items.- Specified by:
setTypeFilter
in interfaceITypeDescriptionModel
- Parameters:
filter
- the filter to apply to the list of returned type items, cannot benull
-
dispose
public void dispose()
Description copied from interface:IModel
Disposes this model.- Specified by:
dispose
in interfaceIModel
- Overrides:
dispose
in classCompoundModel
-
createDialogModel
public ITypeDescriptionDialogModel createDialogModel()
- Specified by:
createDialogModel
in interfaceITypeDescriptionModel
- Returns:
- the newly created dialog model
-
getTypeDescription
public IValue<TypeDescription> getTypeDescription()
- Specified by:
getTypeDescription
in interfaceITypeDescriptionModel
- Returns:
- the
TypeDescription
model.
-
getSingleTypeItem
public IValue<TypeItem> getSingleTypeItem()
- Specified by:
getSingleTypeItem
in interfaceITypeDescriptionModel
- Returns:
- the single
TypeItem
model.
-
getMultiItems
public IList<TypeItem> getMultiItems()
- Specified by:
getMultiItems
in interfaceITypeDescriptionModel
- Returns:
- the
TypeItem
list model.
-
getNumberPrecision
public IValue<Integer> getNumberPrecision()
- Specified by:
getNumberPrecision
in interfaceITypeDescriptionModel
- Returns:
- the
Integer
model that represents number precision
-
getNumberScale
public IValue<Integer> getNumberScale()
- Specified by:
getNumberScale
in interfaceITypeDescriptionModel
- Returns:
- the
Integer
model that represents number scale
-
getNumberNonNegative
public IValue<Boolean> getNumberNonNegative()
- Specified by:
getNumberNonNegative
in interfaceITypeDescriptionModel
- Returns:
- the
Boolean
model that indicates number is not negative
-
getDateFractions
public IValue<DateFractions> getDateFractions()
- Specified by:
getDateFractions
in interfaceITypeDescriptionModel
- Returns:
- the
DateFractions
model of the date
-
getStringLength
public IValue<Integer> getStringLength()
- Specified by:
getStringLength
in interfaceITypeDescriptionModel
- Returns:
- the
Integer
model that represents string length
-
getStringFixed
public IValue<Boolean> getStringFixed()
- Specified by:
getStringFixed
in interfaceITypeDescriptionModel
- Returns:
- the
Boolean
model that indicates string is fixed or not
-
getBinaryLength
public IValue<Integer> getBinaryLength()
- Specified by:
getBinaryLength
in interfaceITypeDescriptionModel
- Returns:
- the
Integer
model that represents binary length
-
getBinaryFixed
public IValue<Boolean> getBinaryFixed()
- Specified by:
getBinaryFixed
in interfaceITypeDescriptionModel
- Returns:
- the
Boolean
model that indicates binary is fixed or not
-
getScriptVariantProvider
public ScriptVariantProvider getScriptVariantProvider()
- Specified by:
getScriptVariantProvider
in interfaceITypeDescriptionModel
- Returns:
ScriptVariantProvider
instance
-
commit
public void commit()
Description copied from interface:IModel
Commits the changes to the data model.
-
getNumberPrecisionMinimum
public int getNumberPrecisionMinimum()
- Specified by:
getNumberPrecisionMinimum
in interfaceITypeDescriptionModel
- Returns:
- the number precision minimum value
-
getNumberPrecisionMaximum
public int getNumberPrecisionMaximum()
- Specified by:
getNumberPrecisionMaximum
in interfaceITypeDescriptionModel
- Returns:
- the number precision maximum value
-
getNumberScaleMinimum
public int getNumberScaleMinimum()
- Specified by:
getNumberScaleMinimum
in interfaceITypeDescriptionModel
- Returns:
- the number scale minimum value
-
getNumberScaleMaximum
public int getNumberScaleMaximum()
- Specified by:
getNumberScaleMaximum
in interfaceITypeDescriptionModel
- Returns:
- the number scale maximum value
-
isNumberPositiveOnly
public boolean isNumberPositiveOnly()
- Specified by:
isNumberPositiveOnly
in interfaceITypeDescriptionModel
- Returns:
- the number positive only state
-
getStringLengthMinimum
public int getStringLengthMinimum()
- Specified by:
getStringLengthMinimum
in interfaceITypeDescriptionModel
- Returns:
- the string length minimum value
-
getStringLengthMaximum
public int getStringLengthMaximum()
- Specified by:
getStringLengthMaximum
in interfaceITypeDescriptionModel
- Returns:
- the string length maximum value
-
getBinaryLengthMinimum
public int getBinaryLengthMinimum()
- Specified by:
getBinaryLengthMinimum
in interfaceITypeDescriptionModel
- Returns:
- the binary length minimum value
-
getBinaryLengthMaximum
public int getBinaryLengthMaximum()
- Specified by:
getBinaryLengthMaximum
in interfaceITypeDescriptionModel
- Returns:
- the binary length maximum value
-
getV8project
public IV8Project getV8project()
- Specified by:
getV8project
in interfaceITypeDescriptionModel
- Returns:
- the
IV8Project
object
-
getParent
public org.eclipse.emf.ecore.EObject getParent()
- Specified by:
getParent
in interfaceITypeDescriptionModel
- Returns:
- the parent object
-
getParentContext
public org.eclipse.emf.ecore.EObject getParentContext()
Description copied from interface:ITypeDescriptionModel
Gets parent context of theITypeDescriptionModel
- Specified by:
getParentContext
in interfaceITypeDescriptionModel
- Returns:
- parent context object, can be
null
if there is no context
-
getFeature
public org.eclipse.emf.ecore.EReference getFeature()
- Specified by:
getFeature
in interfaceITypeDescriptionModel
- Returns:
- the feature
-
getTypeDescriptionInfo
public TypeDescriptionInfo getTypeDescriptionInfo()
- Returns:
- the
TypeDescriptionInfo
instance.
-
isNumberPositiveEnabled
public boolean isNumberPositiveEnabled()
- Specified by:
isNumberPositiveEnabled
in interfaceITypeDescriptionModel
- Returns:
- the number positive enabling state
-
isDateFractionsEnabled
public boolean isDateFractionsEnabled()
- Specified by:
isDateFractionsEnabled
in interfaceITypeDescriptionModel
- Returns:
- the
DateFractions
enabling state
-
isStringFixedEnabled
public boolean isStringFixedEnabled()
- Specified by:
isStringFixedEnabled
in interfaceITypeDescriptionModel
- Returns:
- the string fixed enabling state
-
isBinaryFixedEnabled
public boolean isBinaryFixedEnabled()
- Specified by:
isBinaryFixedEnabled
in interfaceITypeDescriptionModel
- Returns:
- the binary fixed enabling state
-
isEditable
public boolean isEditable()
Description copied from interface:IEditableModel
Checks if this model is editable.- Specified by:
isEditable
in interfaceIEditableModel
- Returns:
true
if this model is editable,false
otherwise
-
setEditable
public void setEditable(boolean editable)
Description copied from interface:IEditableModel
Sets model editable state.- Specified by:
setEditable
in interfaceIEditableModel
- Parameters:
editable
- the editable state,true
if this model is editable,false
otherwise
-
refresh
protected void refresh(TypeDescription td)
Refreshes the model state from the givenTypeDescription
.- Parameters:
td
- theTypeDescription
.
-
buildTypeDescriptionValue
protected void buildTypeDescriptionValue()
Builds and set the newTypeDescription
from qualifiers.
-
createTypeDescriptionModel
protected abstract IValue<TypeDescription> createTypeDescriptionModel(org.eclipse.emf.ecore.EObject parent, org.eclipse.emf.ecore.EReference feature)
Creates a newIValue
model ofTypeDescription
type.- Parameters:
parent
- the parent objectfeature
- the feature
-
resolveItem
protected TypeItem resolveItem(TypeItem item)
If a given item is a proxy object, resolves it against the resource set in the project parameters of the model.- Parameters:
item
- The item to resolve- Returns:
- The resolved item
-
getContextObject
protected org.eclipse.emf.ecore.EObject getContextObject()
Returns the context object to obtain types list.- Returns:
- the context object to obtain types list, never
null
.
-
-