Interface IXtextFile.IModifyingUnitOfWork<T>

  • All Superinterfaces:
    org.eclipse.xtext.util.concurrent.IUnitOfWork<T,​org.eclipse.xtext.resource.XtextResource>
    All Known Implementing Classes:
    IXtextFile.ModifyingUnitOfWork, IXtextFile.ModifyingUnitOfWorkWithDelegate
    Enclosing interface:
    IXtextFile

    public static interface IXtextFile.IModifyingUnitOfWork<T>
    extends org.eclipse.xtext.util.concurrent.IUnitOfWork<T,​org.eclipse.xtext.resource.XtextResource>
    A modifying unit of work will be asked to create a buffer change that shall be applied to the buffer and will be notified of an undo change just after modifications have been applied to the buffer.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.eclipse.xtext.util.concurrent.IUnitOfWork

        org.eclipse.xtext.util.concurrent.IUnitOfWork.Void<T extends Object>
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void acceptUndoChange​(org.eclipse.handly.buffer.IBufferChange undoChange)
      Notification of an undo change.
      org.eclipse.handly.buffer.IBufferChange newBufferChange​(org.eclipse.text.edits.TextEdit edit, org.eclipse.handly.snapshot.ISnapshot base)
      Returns a new buffer change according to the given specifications.
      boolean shouldRetry()
      Returns whether the transaction should be retried if it has failed due to a stale snapshot.
      • Methods inherited from interface org.eclipse.xtext.util.concurrent.IUnitOfWork

        exec
    • Method Detail

      • newBufferChange

        org.eclipse.handly.buffer.IBufferChange newBufferChange​(org.eclipse.text.edits.TextEdit edit,
                                                                org.eclipse.handly.snapshot.ISnapshot base)
        Returns a new buffer change according to the given specifications.
        Parameters:
        edit - the text edit (not null)
        base - the snapshot on which the change is based (not null)
        Returns:
        the created buffer change (never null)
      • acceptUndoChange

        void acceptUndoChange​(org.eclipse.handly.buffer.IBufferChange undoChange)
        Notification of an undo change.
        Parameters:
        undoChange - the undo change, or null if the change created by this unit of work was not undoable
      • shouldRetry

        boolean shouldRetry()
        Returns whether the transaction should be retried if it has failed due to a stale snapshot. Note that if true is always returned, it may lead to an infinite loop.
        Returns:
        true if the transaction should be retried, false otherwise