Class BmValueModel

All Implemented Interfaces:
IAttribute<IBmObject,org.eclipse.emf.ecore.EStructuralFeature>, IEditableModel, IEmfAttribute<IBmObject>, IModel, IEmfValueAttribute<Value,IBmObject>, IValue<Value>, IValidable, IModelApiAwareModel, IValueModel
Direct Known Subclasses:
AddressingAttributeModel, BmCharacteristicsDescriptionValueModel, UnfilledParentValueModel

public class BmValueModel extends BmValue<Value> implements IValueModel
The BM IValueModel implementation.
  • Field Details

  • Constructor Details

    • BmValueModel

      public BmValueModel(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature, org.eclipse.emf.ecore.EStructuralFeature typeDescriptionFeature, IV8Project v8project)
      Creates a new model.
      Parameters:
      object - the IBmObject that keeps the Value feature, cannot be null
      feature - the feature of the Value object, cannot be null
      typeDescriptionFeature - the feature of the TypeDescription object, cannot be null
      v8project - the V8 project, cannot be null
    • BmValueModel

      public BmValueModel(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature, IV8Project v8project, IColorProvider colorProvider, IFontProvider fontProvider)
      Creates a new model.
      Parameters:
      object - the IBmObject that keeps the Value feature, cannot be null
      feature - the feature of the Value object, cannot be null
      v8project - the V8 project, cannot be null
      colorProvider - the color provider, cannot be null
      fontProvider - the font provider, cannot be null
  • Method Details

    • setComponent

      public void setComponent(IComponent<?> component)
      Description copied from interface: IModel
      Associate this model with the component.
      Specified by:
      setComponent in interface IModel
      Overrides:
      setComponent in class Model
      Parameters:
      component - the component to associate with.
    • get

      public Value get()
      Specified by:
      get in interface IValue<Value>
      Overrides:
      get in class Value<Value>
      Returns:
      the stored value.
    • getTypeItemModel

      public IValue<TypeItem> getTypeItemModel()
      Description copied from interface: IValueModel
      Returns the model of TypeItem. It is the changeable model that can be changed from component, i.e. in case the user select the type from type selection dialog, or can be changed in automatically in case if the TypeDescription was changed.
      Specified by:
      getTypeItemModel in interface IValueModel
      Returns:
      the model of TypeItem, cannot be null
    • isEqual

      public boolean isEqual(Value other)
      Description copied from interface: IValue
      Checks the value for equality with the current stored value.
      Specified by:
      isEqual in interface IValue<Value>
      Overrides:
      isEqual in class Value<Value>
      Parameters:
      other - the other value to check.
      Returns:
      true if other value is equal to this value, false otherwise.
    • dispose

      public void dispose()
      Description copied from interface: IModel
      Disposes this model.
      Specified by:
      dispose in interface IModel
      Overrides:
      dispose in class BmValue<Value>
    • getTypeDescription

      public TypeDescription getTypeDescription()
      Description copied from interface: IValueModel
      Returns the TypeDescription of the object that keeps the Value.
      Specified by:
      getTypeDescription in interface IValueModel
      Returns:
      the TypeDescription instance.
    • getCurrentTypeItem

      public TypeItem getCurrentTypeItem()
      Description copied from interface: IValueModel
      Returns the current TypeItem. It is calculated object that is depends on current state of IValueModel.getTypeItemModel() and IValueModel.getTypeDescription().
      Specified by:
      getCurrentTypeItem in interface IValueModel
      Returns:
      the current TypeItem.
    • getV8project

      public IV8Project getV8project()
      Description copied from interface: IValueModel
      Returns the {@link IV8Project).
      Specified by:
      getV8project in interface IValueModel
      Returns:
      the v8 project.
    • getColorProvider

      public IColorProvider getColorProvider()
      Specified by:
      getColorProvider in interface IValueModel
      Returns:
      the color provider, can be null
    • getFontProvider

      public IFontProvider getFontProvider()
      Specified by:
      getFontProvider in interface IValueModel
      Returns:
      the font provider, can be null
    • createTypeDescriptionModel

      protected void createTypeDescriptionModel(org.eclipse.emf.ecore.EStructuralFeature typeDescriptionFeature)
      Creates type description source model.
      Parameters:
      typeDescriptionFeature - the type description source field
    • initTypeItemModelExternal

      protected void initTypeItemModelExternal()
      Inits TypeItem model external.
    • getContextObject

      protected org.eclipse.emf.ecore.EObject getContextObject()
      Returns the context object to retrieve types.
      Returns:
      the context object.