Class Model

All Implemented Interfaces:
IModel, IValidable
Direct Known Subclasses:
AbstractDefinitionModel, AbstractDtGranularEditorManagingModel, AddressingAttributesCollectionModel, CompoundModel, EditableModel, EmfIntervalBoundModelValue, EmptyModel, InfobasePublicationsModel, PackageDataModel, PredefinedDataModel, PropertyPaletteModel, SpreadSheetScrollBarUseModel, WebServiceDataModel

public abstract class Model extends Validable implements IModel
Base class for models.
See Also:
  • Constructor Details

    • Model

      public Model()
  • Method Details

    • isOnline

      public boolean isOnline()
      Specified by:
      isOnline in interface IModel
      Returns:
      true if this model is online, false otherwise.
    • commit

      public void commit()
      Description copied from interface: IModel
      Commits the changes to the data model.
      Specified by:
      commit in interface IModel
    • discard

      public void discard()
      Description copied from interface: IModel
      Discards the changes stored in the model buffer since last IModel.commit() operation.
      Specified by:
      discard in interface IModel
    • createWorkingCopy

      public IModel createWorkingCopy()
      Specified by:
      createWorkingCopy in interface IModel
      Returns:
      the model working copy or null if working copies is not supported by the model.
    • getComponent

      public IComponent<?> getComponent()
      Specified by:
      getComponent in interface IModel
      Returns:
      the component associated with the model or null if no association established.
    • setComponent

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

      public void addModelListener(IModelListener listener)
      Description copied from interface: IModel
      Adds the model listener.
      Specified by:
      addModelListener in interface IModel
      Parameters:
      listener - the listener to add.
    • removeModelListener

      public void removeModelListener(IModelListener listener)
      Description copied from interface: IModel
      Removes the model listener.
      Specified by:
      removeModelListener in interface IModel
      Parameters:
      listener - the listener to remove.
    • dispose

      public void dispose()
      Description copied from interface: IModel
      Disposes this model.
      Specified by:
      dispose in interface IModel
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • notifyModelChanged

      protected final void notifyModelChanged(ChangeOrigin changeOrigin)
      Notifies the model listeners about the model changes.
    • notifyModelCommitted

      protected final void notifyModelCommitted()
      Notifies the model listeners about the model is committed.
    • setOnline

      protected final void setOnline(boolean value)
      Marks model as online or offline notifying this model's listeners.
      Parameters:
      value - true to go online or false to go offline.
    • getRunnableQueue

      protected final IRunnableQueue getRunnableQueue()
      Returns:
      the runnable queue associated with this model.
    • getCurrentChangeOrigin

      protected final ChangeOrigin getCurrentChangeOrigin()
      Gets the current change origin for this model.
      Returns:
      the current change origin.
      See Also:
    • beginExternalUpdate

      protected final void beginExternalUpdate()
      Begins the external update operation in the associated component.
      See Also:
    • endExternalUpdate

      protected final void endExternalUpdate()
      Ends the external update operation in the associated component.
      See Also:
    • checkOnline

      protected final void checkOnline()
      Checks this model is online.
      Throws:
      IllegalStateException - if this value is offline.
    • checkOffline

      protected final void checkOffline()
      Checks this model is offline.
      Throws:
      IllegalStateException - if this value is online.