Interface IBmLocalEditingContext

All Superinterfaces:
IBmEditingContext
All Known Implementing Classes:
CmiLocalEditingContext, LocalEditingContext, V8Commands.ReadOnlyEditingContextWrapper

public interface IBmLocalEditingContext extends IBmEditingContext
The local editing context.

In addition to IBmEditingContext the local editing context allows to navigate through a history of task execution. It can be reached by undo and redo operations. The undo/redo has a coupled canUndo()/canRedo() operation which gives the information about the possibility to perform the undo/redo.

The editing context can be saved. It means that the modified objects will be written on a disk in resources. The awareness whether editing context has 'unsaved' modifications can be reached by the calling isDirty().

After all necessary tasks are executed the context should be disposed.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds the given state listener to the editing context.
    boolean
    Checks if undo operation can be performed.
    boolean
    Checks if undo operation can be performed.
    void
    Disposes the editing context.
    org.eclipse.core.commands.operations.IUndoContext
    Returns the IUndoContext instance corresponding to the editing context.
    boolean
    Checks if the editing context is in the 'unsaved' state.
    boolean
    Checks whether the editing context is disposed.
    void
    Performs the redo operation.
    void
    Removes the given state listener from the editing context.
    void
    Saves the editing context asynchronously.
    void
    save(boolean sync)
    Saves the editing context.
    void
    Performs the undo operation.

    Methods inherited from interface com._1c.g5.v8.bm.integration.IBmEditingContext

    execute, getModel
  • Method Details

    • canUndo

      boolean canUndo()
      Checks if undo operation can be performed.
      Returns:
      true if undo operation can be performed, false otherwise.
    • canRedo

      boolean canRedo()
      Checks if undo operation can be performed.
      Returns:
      true if redo operation can be performed, false otherwise.
    • undo

      void undo()
      Performs the undo operation. Throws an exception if undo operation cannot be performed.
    • redo

      void redo()
      Performs the redo operation. Throws an exception if redo operation cannot be performed.
    • isDirty

      boolean isDirty()
      Checks if the editing context is in the 'unsaved' state.
      Returns:
      true if the editing context is in dirty state, false otherwise.
    • save

      void save()
      Saves the editing context asynchronously. It writes modified in tasks objects into resources.
    • save

      void save(boolean sync)
      Saves the editing context. It writes modified in tasks objects into resources.
      Parameters:
      sync - The flag indicating whether the editing context will be saved synchronously.
    • dispose

      void dispose()
      Disposes the editing context.
    • addStateListener

      void addStateListener(IBmEditingContextStateListener listener)
      Adds the given state listener to the editing context.
      Parameters:
      listener - The state listener. May not be null
    • removeStateListener

      void removeStateListener(IBmEditingContextStateListener listener)
      Removes the given state listener from the editing context.
      Parameters:
      listener - The state listener. May not be null.
    • getUndoContext

      org.eclipse.core.commands.operations.IUndoContext getUndoContext()
      Returns the IUndoContext instance corresponding to the editing context.
      Returns:
      the IUndoContext instance.
    • isDisposed

      boolean isDisposed()
      Checks whether the editing context is disposed.
      Returns:
      true if the editing context is disposed, false otherwise