Class BmValue<T>

All Implemented Interfaces:
IAttribute<IBmObject,org.eclipse.emf.ecore.EStructuralFeature>, IEditableModel, IEmfAttribute<IBmObject>, IModel, IEmfValueAttribute<T,IBmObject>, IValue<T>, IValidable, IModelApiAwareModel
Direct Known Subclasses:
AddInModel, AggregatesModel, BinaryDataModel, BmAdjustableBooleanModel, BmBorderValue, BmCharacteristicsDescriptionDataPathModel, BmCharacteristicsDescriptionFieldModel, BmChartColorPaletteDescriptionModel, BmChartLineModel, BmChartReferenceBandsModelValue, BmChartReferenceLinesModelValue, BmChartScaleModelValue, BmCodeModel, BmColorModel, BmCommonAttributeDataSeparationModel, BmCommonModuleEnvironmentModel, BmConfigurationCompatibilityModeModel, BmDocumentNumeratorValue, BmEnableContentChangeModel, BmEventSubscriptionEventsModel, BmFontSelectionModel, BmFormDynamicListModel, BmFormItemTypeModel, BmFormPagesRepresentationModelValue, BmFormTableNameValueModel, BmGaugeChartQualityBandsModelValue, BmGraphicalSchemeLineModel, BmHandlerModel, BmInformationRegisterWriteModeModel, BmInlineTaskValue, BmIntervalBoundModelValue, BmMdObjectNameModel, BmMdTypeLinkModel, BmNamedElementNameModel, BmNullableChartLineModel, BmOpenMdHelpModel, BmPictureModel, BmPredefinedItemNameModel, BmRealPiePointModelValue, BmRealPointCountValue, BmRealSeriesCountValue, BmRealStockSeriesModelValue, BmSearchStringLocationModelValue, BmSkipNullValue, BmSourceUrlModel, BmStyleItemTypeModel, BmUnsettablePropertyFieldModel, BmUserSettingsGroupModel, BmValueModel, BmValueSelectionModel, BmValueUsedMobileApplicationFunctionalitiesModel, BmVersionedValue, BmVersionedValueGroupBehavior, FormBmValue, GeographicalCoordinatesSelectionModel, GraphicalSchemeCaseValue, GraphicalSchemeItemValue, IBaseBmHandlerNameModel.BaseBmHandlerNameModel, NavigatorTreeDialogActionBarBmValue, PropertyStateModel, TypeDescriptionExtensionModel, XdtoObjectTextRefactoringModel

public class BmValue<T> extends Value<T> implements IEmfValueAttribute<T,IBmObject>, IModelApiAwareModel
Represents a BM object feature value.
See Also:
  • Constructor Details

    • BmValue

      public BmValue(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature)
      Instantiates a new BM value.
      Parameters:
      object - the object, cannot be null
      feature - the object feature, cannot be null
    • BmValue

      public BmValue(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature, boolean resolve)
      Instantiates a new BM value.
      Parameters:
      object - the object, cannot be null
      feature - the object feature, cannot be null
      resolve - true if need resolve object for feature, false otherwise
    • BmValue

      protected BmValue(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature, T initialValue)
      Instantiates a new BM value with initial value. It is client responsibility to provide valid initial value.
      Parameters:
      object - the object, cannot be null
      feature - the object feature, cannot be null
      initialValue - the initial value, can be null
  • Method Details

    • getChange

      public IChange getChange()
      Specified by:
      getChange in interface IModel
      Returns:
      change describing the modifications done to the model.
    • dispose

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

      public IBmObject getObject()
      Description copied from interface: IAttribute
      Returns the object that keeps the attribute.
      Specified by:
      getObject in interface IAttribute<IBmObject,org.eclipse.emf.ecore.EStructuralFeature>
      Returns:
      the object that keeps the attribute.
    • getProperty

      public org.eclipse.emf.ecore.EStructuralFeature getProperty()
      Description copied from interface: IAttribute
      Returns the property.
      Specified by:
      getProperty in interface IAttribute<IBmObject,org.eclipse.emf.ecore.EStructuralFeature>
      Returns:
      the property.
    • setModelApi

      public void setModelApi(IModelApi modelApi)
      Description copied from interface: IModelApiAwareModel
      Sets the specified API to the model.
      Specified by:
      setModelApi in interface IModelApiAwareModel
      Parameters:
      modelApi - the API, can be null.
    • getModelApi

      public IModelApi getModelApi()
      Description copied from interface: IModelApiAwareModel
      Returns the model API.
      Specified by:
      getModelApi in interface IModelApiAwareModel
      Returns:
      the model API or null if it is not set.
    • createTask

      protected IModelApiTaskN<Void> createTask(IBmObject object, org.eclipse.emf.ecore.EStructuralFeature feature, T valueToApply)
      Creates an IModelApiTaskN that executes during applying changes.
      Parameters:
      object - the object to change, cannot be null.
      feature - the feature the feature to change, cannot be null.
      valueToApply - the value to apply.
      Returns:
      the created IModelApiTaskN.
    • getObjectValue

      protected T 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.
      Parameters:
      object - the object to get new value, cannot be null
      feature - the feture to get, cannot be null
      Returns:
      the current value, can be null
    • setObjectValue

      protected void setObjectValue(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature, T 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. attached to transaction).
      Parameters:
      object - the object to set new value, cannot be null.
      feature - the feture to set, cannot be null.
      newValue - the new value to set, can be null.
    • processBmValueChange

      protected void processBmValueChange(Object value)
      Process the BM value change and apply changes to this BmValue.
      Parameters:
      value - the new value, can be null
    • adapt

      protected static IModelApiTaskN<Void> adapt(IBmTask<?> bmTask)
      Converts the specified BM task to IModelApiTaskN.

      NOTE: this method is required until exists the API (tasks) that encapsulates the business logic in the BM task manner.

      Parameters:
      bmTask - the BM task, cannot be null.
      Returns:
      model api task, never null.